Defect #17096

Issue mails cannot be threaded by some mailers

Added by Toshi MARUYAMA over 3 years ago. Updated about 1 month ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email notifications
Target version:Candidate for next major release
Resolution: Affected version:2.4.4

Description

Redmine 1.4:

Issue adding:

Message-Id: <redmine.issue-1.20140605133813@example.net>

Issue editing:

Message-Id: <redmine.journal-1.20140605134129@example.net>
References: <redmine.issue-1.20140605133813@example.net>

Redmine 2.4:

Issue adding:

Message-ID: <redmine.issue-7.20140605044637.b10ff7cb511bccec@example.net>
References: <redmine.issue-7.20140605044637@example.net>

Issue editing:

Message-ID: <redmine.journal-8.20140605044912.bdbae389b638e71d@example.net>
References: <redmine.issue-7.20140605044637@example.net>

Redmine 2.4 issue adding "Message-ID" and editing "References" are not equal.

So, some mailers cannot thread issue mails.

mail-17096-01.diff Magnifier (4.64 KB) Toshi MARUYAMA, 2014-06-05 15:18

mail-17096-20140608.diff Magnifier (4.71 KB) Toshi MARUYAMA, 2014-06-08 11:47


Related issues

Related to Redmine - Feature #5037: Role-based issue custom field visibility Closed 2010-03-10
Related to Redmine - Patch #26791: Send individual notification mails per mail recipient New

History

#1 Updated by Toshi MARUYAMA over 3 years ago

  • Description updated (diff)

#2 Updated by Toshi MARUYAMA over 3 years ago

  • Subject changed from Issue mails cannot be sorting to Issue mails cannot be threaded
  • Description updated (diff)

#3 Updated by Toshi MARUYAMA over 3 years ago

Behavior changed by #5037 r12012.

test/unit/mailer_test.rb

@@ -231,19 +231,21 @@
   end

   def test_issue_add_message_id
-    issue = Issue.find(1)
-    Mailer.issue_add(issue).deliver
+    issue = Issue.find(2)
+    Mailer.deliver_issue_add(issue)
     mail = last_email
-    assert_equal Mailer.message_id_for(issue), mail.message_id
-    assert_nil mail.references
+    assert_match /^redmine\.issue-2\.20060719190421\.[a-f0-9]+@example\.net/, mail.message_id
+    assert_include "redmine.issue-2.20060719190421@example.net", mail.references
   end

   def test_issue_edit_message_id
-    journal = Journal.find(1)
-    Mailer.issue_edit(journal).deliver
+    journal = Journal.find(3)
+    journal.issue = Issue.find(2)
+
+    Mailer.deliver_issue_edit(journal)
     mail = last_email
-    assert_equal Mailer.message_id_for(journal), mail.message_id
-    assert_include Mailer.message_id_for(journal.issue), mail.references
+    assert_match /^redmine\.journal-3\.\d+\.[a-f0-9]+@example\.net/, mail.message_id
+    assert_include "redmine.issue-2.20060719190421@example.net", mail.references
     assert_select_email do
       # link to the update
       assert_select "a[href=?]",

#4 Updated by Toshi MARUYAMA over 3 years ago

  • Target version set to 2.6.0

#5 Updated by Toshi MARUYAMA over 3 years ago

  • Target version changed from 2.6.0 to 2.5.2

#6 Updated by Toshi MARUYAMA over 3 years ago

This is patch to fix.

#7 Updated by Toshi MARUYAMA over 3 years ago

This is new patch.
In note 6 patch, mail receiver can guess user id.

#8 Updated by Jean-Philippe Lang over 3 years ago

  • Subject changed from Issue mails cannot be threaded to Issue mails cannot be threaded by some mailers

As far as I can see, this patch only works if the same users are notified during all the issue thread. But this is not the case.

#9 Updated by Toshi MARUYAMA over 3 years ago

Jean-Philippe Lang wrote:

As far as I can see, this patch only works if the same users are notified during all the issue thread. But this is not the case.

Yes, it is same behavior before #5037.

Note-7 patch message id:

Issue adding:

Message-ID: <redmine.issue-72.20140627064350.1ebc022e@example.net>

Issue editing:

Message-ID: <redmine.journal-142.20140627064557.1ebc022e@example.net>
References: <redmine.issue-72.20140627064350.1ebc022e@example.net>

#10 Updated by Jean-Philippe Lang over 3 years ago

No it's not the same behaviour as before #5037. Before #5037, we always had a single email notification, the first message-id and all references were fixed, eg. <redmine.issue-72.20140627064350@example.net>.

With the patch in note-7 applied, the references header changes if a new custom field is added or if you change the permissions on custom fields. And that breaks all the thread. Exemple:

Issue creation:

Message-ID: <redmine.issue-16507.20140705102246.3ecc5e01@redmine.org>

First update (OK):

Message-ID: <redmine.journal-55676.20140705102328.3ecc5e01@redmine.org>
References: <redmine.issue-16507.20140705102246.3ecc5e01@redmine.org>

After adding a new custom field, you get:

Message-ID: <redmine.journal-55677.20140705102736.49bb14f7@redmine.org>
References: <redmine.issue-16507.20140705102246.49bb14f7@redmine.org>

#11 Updated by Toshi MARUYAMA over 3 years ago

Jean-Philippe Lang wrote:

With the patch in note-7 applied, the references header changes if a new custom field is added or if you change the permissions on custom fields. And that breaks all the thread.

Yes. But, it keeps while custom field condition.
In other case before #5037, if user not get issue creating mail, then by watching user get issue editing mail, mail thread is broken on some mailer.

This issue is mail thead broken on some mail in spĂ­te of getting issue creating mail and not changing custom field condition.

#12 Updated by Jean-Philippe Lang over 3 years ago

  • Target version changed from 2.5.2 to Candidate for next major release

#14 Updated by Toshi MARUYAMA over 2 years ago

  • Related to Feature #5037: Role-based issue custom field visibility added

#15 Updated by T E about 1 year ago

Hi,

are there any news on this? I am having problems with my notification mails, too and would love to see that fixed.

#16 Updated by Lukas Zapletal 11 months ago

are there any news on this? I am having problems with my notification mails, too and would love to see that fixed.

Yeah is gmail related to this? Having troubles too.

#17 Updated by Go MAEDA about 1 month ago

I think that adding consistent Message-Id and References filed will be easier if per user notification sending is implemented by #26791. We don't have to use random_hex in Mailer.token_for method. Instead, we can use EmailAddress#id or some hash value generated from an email address.

The following is an example of the idea.

Issue adding:

Message-Id: <redmine.issue-#{object.id}.#{timestamp}.#{email_address.id}@example.net>

Issue editing:

Message-Id: <redmine.journal-#{object.id}.#{timestamp}.#{email_address.id}@example.net>
References: <redmine.issue-#{object.id}.#{timestamp}.#{email_address.id}@example.net>

#18 Updated by Go MAEDA about 1 month ago

  • Related to Patch #26791: Send individual notification mails per mail recipient added

Also available in: Atom PDF