MessageHeader author field sometimes only contains last name instead of full name and email address
Categories
(Thunderbird :: Add-Ons: Extensions API, defect, P2)
Tracking
(thunderbird_esr128 fixed)
Tracking | Status | |
---|---|---|
thunderbird_esr128 | --- | fixed |
People
(Reporter: florian.unger, Assigned: TbSync)
References
Details
Attachments
(3 files)
9.36 KB,
message/rfc822
|
Details | |
9.02 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
corey
:
approval-comm-esr128+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Steps to reproduce:
In an addon I use messageDisplay API function getDisplayedMessage
to retrieve the MessageHeader of the currently displayed message.
Actual results:
For specific mails the returned MessageHeader does not have the author field correctly filled.
The author field then only contains the last name of the sender instead of full name and email address (see screenshot attached).
The error is reproducible. I attached a sample email for testing (TB128_author_bug.eml).
The email is redacted - mail body was deleted and subject changed but the error is still reproducible with this sample.
Expected results:
the author field should always contain a correct MailBoxHeaderString in format "User <user@example.com>"
Updated•2 months ago
|
Further details I forgot to mention.
I call function getDisplayedMessage from the background script when a button in the Message Display section is clicked:
if ("messageDisplayAction" in messenger) {
messenger.messageDisplayAction.onClicked.addListener(async (tab) => {
curMailviewTabId = tab.id;
messenger.messageDisplay.getDisplayedMessage(tab.id).then(msg => {
curMessage = msg;
}).catch(() => {
console.error("messageDisplayAction - messenger.messageDisplay.getDisplayedMessage failed! tab:", tab);
});
});
} else {
console.error("messageDisplayAction not available in Thunderbird! This should not happen!");
}
Assignee | ||
Comment 3•2 months ago
|
||
Confirmed.
Assignee | ||
Comment 4•1 month ago
|
||
Oh wow, mime2DecodedRecipients
and mime2DecodedAuthor
do unexpected things. These are valid headers:
From: =?UTF-8?Q?H=C3=B6rst=2C_Kenny?= <K.Hoerst@invalid>
To: =?UTF-8?Q?H=C3=B6rst=2C_Kenny?= <K.Hoerst@invalid>, postmaster@gmx.de
This is what the msgHdr
has in those fields:
mime2DecodedAuthor
: Hörst, Kenny <K.Hoerst@invalid>
mime2DecodedRecipients
: Hörst, Kenny <K.Hoerst@invalid>, postmaster@gmx.de
After doing RFC 2047 decode, the mailbox strings are invalid, the display name part should be quoted. mime2DecodedAuthor
could be worked around because it is known to be a single mailbox, but mime2DecodedRecipients
is unusable.
I will remove all usage of mime2DecodedAuthor
and mime2DecodedRecipients
from the WebExtension component.
Assignee | ||
Comment 5•1 month ago
|
||
The values in msgHdr.mime2DecodedRecipients
and msgHdr.mime2DecodedAuthor
should no longer be used. They will hold invalid values, if the decoded
value includes a comma, but not the encoded value. Since the encoded
value does not need to be quoted, and the decoded mailbox string is not
auto-quoted, it becomes invalid and unusable.
Assignee | ||
Updated•1 month ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/ca50fb74c817
Remove usage of broken mime2DecodedRecipients and mime2DecodedAuthor. r=mkmelin
Assignee | ||
Comment 7•22 days ago
|
||
Comment on attachment 9426620 [details]
Bug 1919244 - Remove usage of broken mime2DecodedRecipients and mime2DecodedAuthor. r=#thunderbird-reviewers
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: Values in MessageHeader.recipients can have invalid data, which cannot be processed correctly
Testing completed (on c-c, etc.): 14 days on beta
Risk to taking this patch (and alternatives if risky): Moderate. Has a test
Comment 8•22 days ago
|
||
Comment on attachment 9426620 [details]
Bug 1919244 - Remove usage of broken mime2DecodedRecipients and mime2DecodedAuthor. r=#thunderbird-reviewers
[Triage Comment]
Approved for esr128
Comment 9•22 days ago
|
||
bugherder uplift |
Thunderbird 128.3.2esr:
https://hg.mozilla.org/releases/comm-esr128/rev/8821f6968472
Description
•