Replaces List-Id header with Precedence and Auto-Submitted headers (#2984, #2879).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2655 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2009-04-05 12:33:45 +00:00
parent ca166b30e1
commit 66839c12dd
2 changed files with 12 additions and 1 deletions

View File

@ -267,7 +267,8 @@ class Mailer < ActionMailer::Base
headers 'X-Mailer' => 'Redmine', headers 'X-Mailer' => 'Redmine',
'X-Redmine-Host' => Setting.host_name, 'X-Redmine-Host' => Setting.host_name,
'X-Redmine-Site' => Setting.app_title, 'X-Redmine-Site' => Setting.app_title,
'List-Id' => "<#{Setting.mail_from.to_s.gsub('@', '.')}>" 'Precedence' => 'bulk',
'Auto-Submitted' => 'auto-generated'
end end
# Appends a Redmine header field (name is prepended with 'X-Redmine-') # Appends a Redmine header field (name is prepended with 'X-Redmine-')

View File

@ -88,6 +88,16 @@ class MailerTest < Test::Unit::TestCase
Redmine::Utils.relative_url_root = relative_url_root Redmine::Utils.relative_url_root = relative_url_root
end end
def test_email_headers
ActionMailer::Base.deliveries.clear
issue = Issue.find(1)
Mailer.deliver_issue_add(issue)
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal 'bulk', mail.header_string('Precedence')
assert_equal 'auto-generated', mail.header_string('Auto-Submitted')
end
def test_plain_text_mail def test_plain_text_mail
Setting.plain_text_mail = 1 Setting.plain_text_mail = 1
journal = Journal.find(2) journal = Journal.find(2)