Defect #1401
Related e-mail notifications aren't threaded
| Status: | Closed | Start date: | 2008-06-06 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | Paul Rivier | % Done: | 0% |
|
| Category: | Email notifications | |||
| Target version: | 0.9.0 | |||
| Affected version: | 0.7.1 | Resolution: | Fixed |
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
Associated revisions
Adds Message-Id and References headers to email notifications so that issues and messages threads can be displayed by email clients (#1401).
History
Updated by Paul Rivier over 3 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.
Updated by Jean-Philippe Lang over 3 years ago
I think we should use something like a hash instead of raw project identifiers.
Updated by Jean-Philippe Lang over 3 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 ?
Updated by Paul Rivier over 3 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.
Updated by Jean-Philippe Lang over 3 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.
Updated by Paul Rivier over 3 years ago
Fixed length and [0-9a-f] only
Ok. This adress the fobidden chars by the way.
Updated by James Turnbull over 3 years ago
+1
Updated by Andreas Huggel about 3 years ago
+1
Updated by Jean-Philippe Lang about 3 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.