Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb	(revision 3771)
+++ app/models/mailer.rb	(working copy)
@@ -27,6 +27,8 @@
   def self.default_url_options
     h = Setting.host_name
     h = h.to_s.gsub(%r{\/.*$}, '') unless Redmine::Utils.relative_url_root.blank?
+    # Ensure that a trailing slash of the Settings.host_name will be removed.
+    h.gsub!(/\/$/, '')
     { :host => h, :protocol => Setting.protocol }
   end
   
Index: test/unit/mailer_test.rb
===================================================================
--- test/unit/mailer_test.rb	(revision 3771)
+++ test/unit/mailer_test.rb	(working copy)
@@ -48,6 +48,26 @@
     end
   end
   
+  def test_generated_links_in_emails_with_trailing_slash
+    Setting.host_name = 'mydomain.foo/'
+    Setting.protocol = 'https'
+    
+    journal = Journal.find(2)
+    assert Mailer.deliver_issue_edit(journal)
+    
+    mail = ActionMailer::Base.deliveries.last
+    assert_kind_of TMail::Mail, mail
+    
+    assert_select_email do
+      # link to the main ticket
+      assert_select "a[href=?]", "https://mydomain.foo/issues/1", :text => "Bug #1: Can't print recipes"
+      # link to a referenced ticket
+      assert_select "a[href=?][title=?]", "https://mydomain.foo/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
+      # link to a changeset
+      assert_select "a[href=?][title=?]", "https://mydomain.foo/projects/ecookbook/repository/revisions/2", "This commit fixes #1, #2 and references #1 &amp; #3", :text => "r2"
+    end
+  end
+  
   def test_generated_links_with_prefix
     relative_url_root = Redmine::Utils.relative_url_root
     Setting.host_name = 'mydomain.foo/rdm'

