プロジェクト

全般

プロフィール

Vote #74319

完了

Don't add a display name and extra angle brackets in List-Id header field

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Email notifications_9
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
9
version_id:
127
issue_org_id:
14792
author_id:
55460
assigned_to_id:
332
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Continued from here: http://www.redmine.org/boards/1/topics/39232

If Setting.mail_from already contains a (valid) address like "Ticket System DoNotReplys@mydomain.com", then it's wrong to insert angle brackets in this line http://www.redmine.org/projects/redmine/repository/revisions/11988/entry/trunk/app/models/mailer.rb#L389

It creates List-Ids of the form ">", which, if I understand correctly, are not RFC compliant: http://www.ietf.org/rfc/rfc2919.txt

See also #10888 and propsed patch #13359


journals

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
You can fix this issue with the attached patch.
--------------------------------------------------------------------------------
The patch attached in #5913#note-17 also fixes this issue. It is unnecessary to merge attachment:fix-14792.diff if that patch is merged.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fixed in r17870 along with #5913.

I will commit the following test later.

<pre><code class="diff">
Index: test/unit/mailer_test.rb
===================================================================
--- test/unit/mailer_test.rb (リビジョン 17870)
+++ test/unit/mailer_test.rb (作業コピー)
@@ -213,6 +213,14 @@
assert_equal issue.author.login, mail.header['X-Redmine-Sender'].to_s
end

+ def test_email_headers_list_id_should_not_include_display_name
+ Setting.mail_from = 'Redmine <redmine@example.net>'
+ issue = Issue.find(1)
+ Mailer.deliver_issue_add(issue)
+ mail = last_email
+ assert_equal '<redmine.example.net>', mail.header['List-Id'].to_s
+ end
+
def test_plain_text_mail
Setting.plain_text_mail = 1
journal = Journal.find(2)
</code></pre>
--------------------------------------------------------------------------------
Adding a test method is too much. We can test that display name and other stuff is not included by adding only one line.

<pre><code class="diff">
Index: test/unit/mailer_test.rb
===================================================================
--- test/unit/mailer_test.rb (リビジョン 17872)
+++ test/unit/mailer_test.rb (作業コピー)
@@ -198,11 +198,13 @@
end

def test_email_headers
+ Setting.mail_from = 'Redmine <redmine@example.net>'
issue = Issue.find(1)
Mailer.deliver_issue_add(issue)
mail = last_email
assert_equal 'All', mail.header['X-Auto-Response-Suppress'].to_s
assert_equal 'auto-generated', mail.header['Auto-Submitted'].to_s
assert_equal '<redmine.example.net>', mail.header['List-Id'].to_s
end
</code></diff>
--------------------------------------------------------------------------------
Updated the test to catch this issue (r17873).
--------------------------------------------------------------------------------


related_issues

relates,New,13359,Better List-Id to help aid Gmail filtering
relates,Closed,30785,Mail handler does not ignore emails sent from emission email address if Setting.mail_from includes display name
relates,Closed,5913,Authors name in from address of email notifications

Admin Redmine さんが3年以上前に更新

  • カテゴリEmail notifications_9 にセット
  • 対象バージョン4.1.0_127 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0