Closed Bug 1584822 Opened 5 months ago Closed 5 months ago

Uncaught exception trying to get a charset alias + not able to save message

Categories

(Thunderbird :: Mail Window Front End, defect)

x86_64
Linux
defect
Not set

Tracking

(thunderbird_esr6870+ fixed, thunderbird70 fixed, thunderbird71 fixed)

RESOLVED FIXED
Thunderbird 71.0
Tracking Status
thunderbird_esr68 70+ fixed
thunderbird70 --- fixed
thunderbird71 --- fixed

People

(Reporter: eyalroz, Assigned: jorgk-bmo)

Details

Attachments

(2 files)

Consider the soon-to-be-attached folder.

When I view this folder, with TB 68.1.1 and no extensions, I get the following in the console:

NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICharsetConverterManager.getCharsetAlias] jsmime.jsm:49

Also, if I try to save the message as an .eml file - it fails silently, i.e. I select the menu entry, it does nothing, and nothing is added to the log.

This is somewhat related to bug 1555471.

Attachment #9097206 - Attachment mime type: application/octet-stream → text/plain

Let me correct my earlier message: The no-log-entry is with TB 60.9.0.With TB 68.1.1 I do get an error:

NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICharsetConverterManager.getCharsetAlias] jsmime.jsm:54
MimeTextDecoder resource:///modules/jsmime.jsm:54
convert8BitHeader resource:///modules/jsmime/jsmime.js:690
parseHeaderField resource:///modules/mimeParser.jsm:238
decodeMimeHeader jar:file:///opt/versions/thunderbird-68.1.1/omni.ja!/components/mimeJSComponents.js:536
SaveAsFile chrome://messenger/content/mailCommands.js:359
MsgSaveAsFile chrome://messenger/content/mailWindowOverlay.js:2258
oncommand chrome://messenger/content/messenger.xul:1

Thanks for the report. The charset of the message is invalid, no such thing as iso-8859-I with the uppercase letter I as in Ibiza. I doubt there is an issue when just viewing the message, but I will try when I'm back at my desk. I'll see what can be done about saving the message, it's likely impossible since the charset is invalid and hence unknown. The message looks like UTF-8, so displaying it will likely work since UTF-8 may be assumed or detected. More later.

Yes, I know about the invalid charset header. The message actually looks like cp1255 or ISO-8859-8-I. My BiDiMailUI extension "fixes" it charset for display.

I should stop commenting on bugs from my phone ;-) - the message looked OK on the phone so I assumed UTF-8.

I think what happens is this. The subject header contains raw iso-8859-8-i which is also invalid. TB first tries UTF-8 and then the invalid fallback iso-8859-I. We can fix the console error but I guess the message will look garbled until someone sets the correct charset in the UI or programmatically.

I'm only complaining about the console error here. Fixing the garbling is what my BiDI Mail UI extension is for.

Your complaint is fully justified ;-) - Here's the fix, still garbled, but noiseless. Looks like some part of the system tries to interpret the subject as ANSI/windows-1252 whereas the Mozilla platform assumes UTF-8 for the body. So you get:

Subject: Message 20 - äú÷áìä úâåáä ìðåùà
Body:

But at least the subject is now the same in the tread pane and the header pane, before it was blank in the tread pane.

Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Attachment #9097224 - Flags: review?(acelists)

BTW, saving works, too, only the filename is derived from the ugly subject.

@JorgK: I should have noticed this regression a long while ago - it's not that recent, present already in v38.8.0 . I was a bit careless with the regression tests on my extension.

Comment on attachment 9097224 [details] [diff] [review]
1584822-try-catch.patch

Review of attachment 9097224 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, works for me on the attached test message.

The error prevented the message subject to display in the thread pane, prevented saving of the message to a file. Also moving the mouse over the subject caused this error to log into the console hundreds of times (we probably re-decode the boxes text content at each redraw).
So the error wasn't as harmless as it looked :)
Attachment #9097224 - Flags: review?(acelists) → review+

@aceman: In that case, please also try to get this committed this onto the 68.x branch.

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/1b282633191d
add try/catch around MimeTextDecoder() in convert8BitHeader(). r=aceman

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 71.0
Attachment #9097224 - Flags: approval-comm-esr68+
Attachment #9097224 - Flags: approval-comm-beta+
You need to log in before you can comment on or make changes to this bug.