Defect #1401

Related e-mail notifications aren't threaded

Added by Colan Schwartz over 9 years ago. Updated about 3 years ago.

Status:ClosedStart date:2008-06-06
Priority:NormalDue date:
Assignee:Paul Rivier% Done:

0%

Category:Email notifications
Target version:0.9.0
Resolution:Fixed Affected version:0.7.1

Description

Related notifications, those belonging to the same issue for example, don't show up as e-mail messages in the same thread. They each belong to separate threads. Notifications should be setting the necessary message headers.


Related issues

Duplicated by Redmine - Feature #603: Don't include new status for issues in email subject Closed 2008-02-04

Associated revisions

Revision 2281
Added by Jean-Philippe Lang almost 9 years ago

Adds Message-Id and References headers to email notifications so that issues and messages threads can be displayed by email clients (#1401).

History

#1 Updated by Paul Rivier over 9 years ago

  • Assignee set to Paul Rivier

Indeed. Email headers should contain two fields, Message-ID, and References.
Message-ID must be unique, therefore I propose (capital words are variables) :
redmine.PROJECT-NAME.issue-NUMBER.reply-REPLY-NUMBER@HOSTNAME

Any email notification can include multiple references to other notifications, for exemple, for 2nd reply to issue 49 for current redmine project :

Message-ID: <redmine.redmine.issue-49.reply-2@redmine.org>
References: <redmine.redmine.issue-49.reply-1@redmine.org>
            <redmine.redmine.issue-49.reply-0@redmine.org>

That will give, in the MUA, a very deep unary thread. This might seem a bit inconvenient, but it is the only way I see to ensure working threading for anyone subscribing in the middle of the discussion.

I can not unfortunatly put this on top of my todo list, so I put it fairly deep, but if someone want to volunteer, patches are welcome.

#2 Updated by Jean-Philippe Lang over 9 years ago

I think we should use something like a hash instead of raw project identifiers.

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

Something like this:

  # Generates a message id for the given object
  def message_id_for(obj)
    s = "redmine.%s.%s.%08d.%s" % [obj.project.identifier, obj.class.name, obj.id, obj.created_on.to_s]
    hash = Digest::MD5.hexdigest(s)
    host = Setting.mail_from.to_s.gsub(%r{^.*@}, '')
    "<#{hash}@#{host}>" 
  end

What do you think ?

#4 Updated by Paul Rivier over 9 years ago

I have no particular position on using readable string or hash. Why do you think a hash is better suited ?
Also, if using a hash, you should ensure to strip-out any character in [<>@], as specified in the internet text messages RFC.
Also, for objects having multiple revisions (edited message content, edited wiki page), message-id must be uniquified for each revision. It might be needed at some point in the future.

#5 Updated by Jean-Philippe Lang over 9 years ago

Why do you think a hash is better suited ?

Fixed length and [0-9a-f] only

Also, for objects having multiple revisions (edited message content, edited wiki page), message-id must be uniquified for each revision. It might be needed at some point in the future.

Good point.

#6 Updated by Paul Rivier over 9 years ago

Fixed length and [0-9a-f] only

Ok. This adress the fobidden chars by the way.

#7 Updated by James Turnbull about 9 years ago

+1

#8 Updated by Andreas Huggel almost 9 years ago

+1

#9 Updated by Jean-Philippe Lang almost 9 years ago

  • Category set to Email notifications
  • Status changed from New to Closed
  • Target version set to 0.9.0
  • Resolution set to Fixed

Headers added in r2281 for issues and messages.

#10 Updated by Gaurav Pandey about 3 years ago

Related messages are still not getting threaded in Microsoft Outlook 2010 and 2013. Microsoft Outlook 2010 and 2013 thread emails based on thread-topic and thread-index email headers and these headers are missing in Redmine emails.

#11 Updated by Jean-Baptiste Barth about 3 years ago

Gaurav Pandey wrote:

Related messages are still not getting threaded in Microsoft Outlook 2010 and 2013. Microsoft Outlook 2010 and 2013 thread emails based on thread-topic and thread-index email headers and these headers are missing in Redmine emails.

Do you have a documentation about that ? I can dig into that issue if I have a solid spec or documentation about what to add in Redmine headers. Also, I'd prefer a new issue for that, please make a new one and assign it to me directly. This issue is pretty old and already "solved" for most use cases.

#12 Updated by Toshi MARUYAMA about 3 years ago

Gaurav Pandey wrote:

Related messages are still not getting threaded in Microsoft Outlook 2010 and 2013. Microsoft Outlook 2010 and 2013 thread emails based on thread-topic and thread-index email headers and these headers are missing in Redmine emails.

It is #17096.

#13 Updated by Toshi MARUYAMA about 3 years ago

Jean-Baptiste Barth wrote:

Do you have a documentation about that ?

See #17096#note-13.

#14 Updated by Jean-Baptiste Barth about 3 years ago

Thanks Toshi, I let you take care of that then :)

Also available in: Atom PDF