Prepare to drop usage of MsgHdrToMimeMessage in favour of MimeParser.extractMimeMsg() in the WebExtension messages API
Categories
(Thunderbird :: Add-Ons: Extensions API, task)
Tracking
(thunderbird_esr115 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr115 | --- | wontfix |
People
(Reporter: TbSync, Assigned: TbSync)
References
Details
Attachments
(6 files, 3 obsolete files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The messages API currently uses MsgHdrToMimeMessage to parse messages. Since its behavior is heavily coupled to Thunderbird preferences and message attributes (like junk status), its outcome is not deterministic and sometimes unexpected. Some body parts are eaten, and others are returned after being passed through a convertToHTml() function, altering the original body (see nsISimpleMimeConverter.idl).
For various reasons, I created MimeParser.extractMimeMsg() for Thunderbird 102, which is a pure mime parser independent of any Thunderbird specialities.
I want to completely switch to this parser now. The following items have to be checked:
Assignee | ||
Comment 1•8 months ago
|
||
I want to replace MsgHdrToMimeMessage by a pure js parser, which does not have
to deal with Thunderbird specialities. The added method allows to use message
streams as input, so we do not have to extract the raw message first.
Updated•8 months ago
|
Assignee | ||
Comment 2•8 months ago
•
|
||
When this was originally created, I copied some guessing code from Thunderbird.
I no longer want to use it and instead honor the contentDisposition header. With
the old code in place, a mime part of type 'text/calendar' which is NOT marked as
an attachment, is still returned as an attachment.
Depends on D199337
Updated•8 months ago
|
Comment 3•8 months ago
|
||
Comment on attachment 9375979 [details]
Bug 1876008 - Be strict on the contentDisposition header and no longer guess attachments. r=mkmelin
Revision D199342 was moved to bug 1737532. Setting attachment 9375979 [details] to obsolete.
Assignee | ||
Comment 4•8 months ago
|
||
Updated•8 months ago
|
Assignee | ||
Comment 5•8 months ago
|
||
Updated•8 months ago
|
Assignee | ||
Comment 6•8 months ago
|
||
To make review of D199624 easier, code copied from one file to
another was not removed but commented. Removing it now.
Depends on D199624
Assignee | ||
Comment 7•8 months ago
|
||
This function is a utility function and does not need to be part of the
class.
Depends on D199629
Assignee | ||
Comment 8•8 months ago
|
||
This is an effort to increase readability of this module, by using
descriptive parameter names.
Depends on D199630
Assignee | ||
Comment 9•8 months ago
|
||
Our codebase uses many different jsmime emitters with similar code.
A base class others can derive from could be beneficial. This patch
moves the existing emitter used by mimeTree.sys.mjs into a class
without changing its current behaviour.
Depends on D199631
Assignee | ||
Comment 10•8 months ago
|
||
Depends on D199337
Updated•8 months ago
|
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Updated•8 months ago
|
Comment 11•8 months ago
|
||
Comment on attachment 9376707 [details]
WIP: Bug 1876008 - Derive ExtractMimeMsgEmitter from the MimeTreeEmitter base class and add basic support for decryption.
Revision D199758 was moved to bug 1878620. Setting attachment 9376707 [details] to obsolete.
Assignee | ||
Updated•8 months ago
|
Updated•8 months ago
|
Comment 12•8 months ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/989e6f7f2436
Move crypto functions related to MimeTree into a dedicated module. r=kaie
https://hg.mozilla.org/comm-central/rev/3bf17ff35910
Remove leftover functions from D199624. r=mkmelin,kaie
https://hg.mozilla.org/comm-central/rev/c03d4f8f77b5
Move stripHTMLFromArmoredBlocks() out of MimeTreeDecrypter class. r=kaie
https://hg.mozilla.org/comm-central/rev/d3f543fdcaf1
Rename input parameters of functions handling MimeTreeParts to mimeTreePart. r=kaie
https://hg.mozilla.org/comm-central/rev/5232c59e813f
Introduce a MimeTreeEmitter base class. r=kaie
https://hg.mozilla.org/comm-central/rev/a316d2940243
Introduce MimeParser.streamMimeMsg() and move ExtractMimeMsgEmitter into a class. r=mkmelin
Description
•