diff --git a/app/views/mailer/_issue_text_html.rhtml b/app/views/mailer/_issue_text_html.rhtml
index d0f247812..3b1812d98 100644
--- a/app/views/mailer/_issue_text_html.rhtml
+++ b/app/views/mailer/_issue_text_html.rhtml
@@ -1,14 +1,14 @@
-
<%= link_to "#{issue.tracker.name} ##{issue.id}: #{issue.subject}", issue_url %>
+<%= link_to(h("#{issue.tracker.name} ##{issue.id}: #{issue.subject}"), issue_url) %>
-- <%=l(:field_author)%>: <%= issue.author %>
-- <%=l(:field_status)%>: <%= issue.status %>
-- <%=l(:field_priority)%>: <%= issue.priority %>
-- <%=l(:field_assigned_to)%>: <%= issue.assigned_to %>
-- <%=l(:field_category)%>: <%= issue.category %>
-- <%=l(:field_fixed_version)%>: <%= issue.fixed_version %>
+- <%=l(:field_author)%>: <%=h issue.author %>
+- <%=l(:field_status)%>: <%=h issue.status %>
+- <%=l(:field_priority)%>: <%=h issue.priority %>
+- <%=l(:field_assigned_to)%>: <%=h issue.assigned_to %>
+- <%=l(:field_category)%>: <%=h issue.category %>
+- <%=l(:field_fixed_version)%>: <%=h issue.fixed_version %>
<% issue.custom_values.each do |c| %>
- - <%= c.custom_field.name %>: <%= show_value(c) %>
+ - <%=h c.custom_field.name %>: <%=h show_value(c) %>
<% end %>
diff --git a/app/views/mailer/account_activation_request.text.html.rhtml b/app/views/mailer/account_activation_request.text.html.rhtml
index 145ecfc8e..b19cf3219 100644
--- a/app/views/mailer/account_activation_request.text.html.rhtml
+++ b/app/views/mailer/account_activation_request.text.html.rhtml
@@ -1,2 +1,2 @@
-<%= l(:mail_body_account_activation_request, @user.login) %>
+<%= l(:mail_body_account_activation_request, h(@user.login)) %>
<%= link_to @url, @url %>
diff --git a/app/views/mailer/account_information.text.html.rhtml b/app/views/mailer/account_information.text.html.rhtml
index 3b6ab6a9d..94c3297ed 100644
--- a/app/views/mailer/account_information.text.html.rhtml
+++ b/app/views/mailer/account_information.text.html.rhtml
@@ -1,10 +1,10 @@
<% if @user.auth_source %>
-<%= l(:mail_body_account_information_external, @user.auth_source.name) %>
+<%= l(:mail_body_account_information_external, h(@user.auth_source.name)) %>
<% else %>
<%= l(:mail_body_account_information) %>:
- - <%= l(:field_login) %>: <%= @user.login %>
- - <%= l(:field_password) %>: <%= @password %>
+ - <%= l(:field_login) %>: <%=h @user.login %>
+ - <%= l(:field_password) %>: <%=h @password %>
<% end %>
diff --git a/app/views/mailer/attachments_added.text.html.rhtml b/app/views/mailer/attachments_added.text.html.rhtml
index d2355b1c4..369834b6d 100644
--- a/app/views/mailer/attachments_added.text.html.rhtml
+++ b/app/views/mailer/attachments_added.text.html.rhtml
@@ -1,5 +1,5 @@
<%= link_to @added_to, @added_to_url %>
<% @attachments.each do |attachment | %>
-- <%= attachment.filename %>
+- <%=h attachment.filename %>
<% end %>
diff --git a/app/views/mailer/document_added.text.html.rhtml b/app/views/mailer/document_added.text.html.rhtml
index dc1f659a0..8606dd784 100644
--- a/app/views/mailer/document_added.text.html.rhtml
+++ b/app/views/mailer/document_added.text.html.rhtml
@@ -1,3 +1,3 @@
-<%= link_to @document.title, @document_url %> (<%= @document.category.name %>)
+<%= link_to(h(@document.title), @document_url) %> (<%=h @document.category.name %>)
<%= textilizable(@document, :description, :only_path => false) %>
diff --git a/app/views/mailer/issue_add.text.html.rhtml b/app/views/mailer/issue_add.text.html.rhtml
index ef1d0dec4..bc62306c1 100644
--- a/app/views/mailer/issue_add.text.html.rhtml
+++ b/app/views/mailer/issue_add.text.html.rhtml
@@ -1,3 +1,3 @@
-<%= l(:text_issue_added, :id => "##{@issue.id}", :author => @issue.author) %>
+<%= l(:text_issue_added, :id => "##{@issue.id}", :author => h(@issue.author)) %>
<%= render :partial => "issue_text_html", :locals => { :issue => @issue, :issue_url => @issue_url } %>
diff --git a/app/views/mailer/issue_edit.text.html.rhtml b/app/views/mailer/issue_edit.text.html.rhtml
index b4a1f953e..05c67208e 100644
--- a/app/views/mailer/issue_edit.text.html.rhtml
+++ b/app/views/mailer/issue_edit.text.html.rhtml
@@ -1,4 +1,4 @@
-<%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @journal.user) %>
+<%= l(:text_issue_updated, :id => "##{@issue.id}", :author => h(@journal.user)) %>
<% for detail in @journal.details %>
diff --git a/app/views/mailer/lost_password.text.html.rhtml b/app/views/mailer/lost_password.text.html.rhtml
index 4dd570c94..40bb8e9c9 100644
--- a/app/views/mailer/lost_password.text.html.rhtml
+++ b/app/views/mailer/lost_password.text.html.rhtml
@@ -1,4 +1,4 @@
<%= l(:mail_body_lost_password) %>
<%= auto_link(@url) %>
-<%= l(:field_login) %>: <%= @token.user.login %>
+<%= l(:field_login) %>: <%=h @token.user.login %>
diff --git a/app/views/mailer/message_posted.text.html.rhtml b/app/views/mailer/message_posted.text.html.rhtml
index d91ce5a04..f43a8cf0f 100644
--- a/app/views/mailer/message_posted.text.html.rhtml
+++ b/app/views/mailer/message_posted.text.html.rhtml
@@ -1,4 +1,4 @@
-<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to @message.subject, @message_url %>
-<%= @message.author %>
+<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %>
+<%=h @message.author %>
<%= textilizable(@message, :content, :only_path => false) %>
diff --git a/app/views/mailer/news_added.text.html.rhtml b/app/views/mailer/news_added.text.html.rhtml
index 15bc89fac..758ebccb8 100644
--- a/app/views/mailer/news_added.text.html.rhtml
+++ b/app/views/mailer/news_added.text.html.rhtml
@@ -1,4 +1,4 @@
-<%= link_to @news.title, @news_url %>
-<%= @news.author.name %>
+<%= link_to(h(@news.title), @news_url) %>
+<%=h @news.author.name %>
<%= textilizable(@news, :description, :only_path => false) %>