mailer.patch

trunk @14155 - Sebastian Paluch, 2015-04-06 20:17

Download (2.09 KB)

View differences:

app/models/mail_handler.rb (working copy)
73 73

  
74 74
  cattr_accessor :ignored_emails_headers
75 75
  @@ignored_emails_headers = {
76
    'X-Auto-Response-Suppress' => /(oof|all)/,
77 76
    'Auto-Submitted' => /\Aauto-(replied|generated)/,
78 77
    'X-Autoreply' => 'yes'
79 78
  }
app/models/mailer.rb (working copy)
389 389
    headers.reverse_merge! 'X-Mailer' => 'Redmine',
390 390
            'X-Redmine-Host' => Setting.host_name,
391 391
            'X-Redmine-Site' => Setting.app_title,
392
            'X-Auto-Response-Suppress' => 'OOF',
392
            'X-Auto-Response-Suppress' => 'All',
393 393
            'Auto-Submitted' => 'auto-generated',
394 394
            'From' => Setting.mail_from,
395 395
            'List-Id' => "<#{Setting.mail_from.to_s.gsub('@', '.')}>"
test/unit/mail_handler_test.rb (working copy)
629 629
  def test_should_ignore_auto_replied_emails
630 630
    MailHandler.any_instance.expects(:dispatch).never
631 631
    [
632
      "X-Auto-Response-Suppress: OOF",
633 632
      "Auto-Submitted: auto-replied",
634 633
      "Auto-Submitted: Auto-Replied",
635 634
      "Auto-Submitted: auto-generated",
test/unit/mailer_test.rb (working copy)
197 197
    Mailer.deliver_issue_add(issue)
198 198
    mail = last_email
199 199
    assert_not_nil mail
200
    assert_equal 'OOF', mail.header['X-Auto-Response-Suppress'].to_s
200
    assert_equal 'All', mail.header['X-Auto-Response-Suppress'].to_s
201 201
    assert_equal 'auto-generated', mail.header['Auto-Submitted'].to_s
202 202
    assert_equal '<redmine.example.net>', mail.header['List-Id'].to_s
203 203
  end