Open Bug 513474 Opened 15 years ago Updated 2 years ago

Support X-Envelope-To in message summary files

Categories

(MailNews Core :: Database, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: iannbugzilla, Unassigned)

Details

Various mailing lists (such as mozilla and kde ones) put in an X-Envelope-To header field into messages sent out. If we add it to the message summary file then it could be used elsewhere (e.g. identity hinting when replying to such mailing lists).
There is an existing preference, mailnews.customDBHeaders, that you could just add this header to. Is there something that you want beyond this?
I have tested with setting mailnews.customDBHeaders to X-Envelope-To but doing GetStringProperty or GetProperty on a MsgHdr object just gives an empty string.
Even if it did work, any functionality relying on it being set to X-Envelope-To would break as soon as a user changed that pref.
this only affects headers when they're added to the db, so they either need to be new, or you need to rebuild index.

This pref is intended more for extensions to set, so the user shouldn't be changing it.

Also, bear in mind that you should add "x-envelope-to" to the pref, since it wants all lower-case.  https://developer.mozilla.org/en/Extensions/Thunderbird/customDBHeaders_Preference
Should core code be making use of this pref then?
Is there anyway of checking if a summary file has already got this header and if not triggering a rebuild?
Any code that wants a particular message header to get added to the .msf can and should use this pref - that's what it's for.

There's no way to tell if a summary file has this header, other than to iterate over all the headers and see if any of them have the property set. Or, you could do a one time upgrade by checking and setting a property on the folder, I suppose.
IIRC, when I added BCC header support, I also added it to the list of headers that IMAP downloads. Does the mailnews.customDBHeaders only affect what happens when the body is downloaded?
no, customDBHeaders are added to the header fetch command in IMAP.
It sounds like the actual use case this bug wants is "identity hinting when replying to such mailing lists" which is probably covered by other existing bugs, for example, a brief investigation found:

Bug 230247 - Make identity picker work for mailing lists
Bug 270927 - allow identity to be associated with contact/mailing list

If that is the intended goal, there is no need to persist the contents of the header.  The relevant information can be retrieved from the headers by streaming the message.  Presumably the information would only be used when replying (which already requires streaming if quoting is involved) or when displaying for the benefit of the message reader header (which also requires streaming).
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.