Closed Bug 1683548 Opened 5 years ago Closed 5 years ago

Email with embedded image cannot be sent. "too much recursion MsgComposeCommands.js:4683"

Categories

(Thunderbird :: Message Compose Window, defect)

Thunderbird 85
defect

Tracking

(thunderbird_esr78 unaffected, thunderbird85+ affected)

RESOLVED FIXED
86 Branch
Tracking Status
thunderbird_esr78 --- unaffected
thunderbird85 + affected

People

(Reporter: msajner, Assigned: rnons)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 2 external files)

User Agent: Mozilla/5.0 (Linux; Android 9.0; MI 8 SE) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.119 Mobile Safari/537.36

Steps to reproduce:

Create new email message

Image from external editor (Irfanview) copied inline withing the email body

Try to send a massage

Actual results:

When the email is attempted to send, it is pending for about 5-6 seconds (normally is sent immediately), then some msg flashes and email does not get sent. In error console it shows:

GenericSendMessage FAILED: InternalError: too much recursion MsgComposeCommands.js:4683

The message is about 800x600px.

In case the image property "Attach this image to message" is unchecked, the message gets sent.

In case same picture is resized to 700x525px before pasting it inline, the message is also sent properly.

Expected results:

Message with embedded image should get sent regardless its size and whether image is marked as attachment or not.
This has not been observed in earlier releases, possibly relates to recent update to v. 85b1

What did we ship in 85 that would cause this potential regression?

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Email with embedded image cannot be sent → Email with embedded image cannot be sent. "too much recursion MsgComposeCommands.js:4683"

Confirmed on Daily (2020-12-20). The error also happens if you try to save the message as a draft.

GenericSendMessage FAILED: InternalError: too much recursion MsgComposeCommands.js:4689
    CompleteGenericSendMessage chrome://messenger/content/messengercompose/MsgComposeCommands.js:4689
    AsyncFunctionThrow self-hosted:693
    (Async: async)
    GenericSendMessage chrome://messenger/content/messengercompose/MsgComposeCommands.js:4620
    AutoSave chrome://messenger/content/messengercompose/MsgComposeCommands.js:8230
    (Async: setTimeout handler)
    ComposeStartup chrome://messenger/content/messengercompose/MsgComposeCommands.js:3749
    ComposeLoad chrome://messenger/content/messengercompose/MsgComposeCommands.js:3997
    onload chrome://messenger/content/messengercompose/messengercompose.xhtml:1

Would imagine this is from bug 1211292. mailnews.send.jsmodule is now true (that is, use the js sending backend)

This actually happened during the 84 dev cycle. Mozregression identified the push at https://treeherder.mozilla.org/jobs?repo=comm-central&revision=14c6049615f373ea69e325ca1bfc959a0132dad4 as the one introducing the failure.

My money is on: a3f9fbf593ee Bug 1211292 - Enable MessageSend.jsm in nightly builds (mailnews.send.jsmodule

Assignee: nobody → remotenonsense
Status: NEW → ASSIGNED
Regressions: 1211292
Target Milestone: --- → 86 Branch

Will land the current fix. Leaving open for rjl to verify + Ping is also going to add/modify a test so we notice in the future.
Since the error is different on beta/trunk apparently, would have to verify if this works on beta as well or if there's another patch that needs uplifting together with it.

Keywords: leave-open

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/b5137f6b3e0e
Fix sending messages containing inline images. r=mkmelin

No good on beta... are you testing with an image copied and pasted into the email (in my case from Gimp)?

I was able to capture the actual internal error, maybe that will help?

InternalError
​​columnNumber: 31
​​fileName: "resource:///modules/MimePart.jsm"
​​lineNumber: 211
​​message: "too much recursion"
​​stack:
_fetchFile@resource:///modules/MimePart.jsm:211:31
getEncodedBodyString@resource:///modules/MimePart.jsm:158:31
_writePart@resource:///modules/MimeMessage.jsm:470:36
_writePart@resource:///modules/MimeMessage.jsm:510:20
async*_writePart@resource:///modules/MimeMessage.jsm:510:20
async*createMessageFile@resource:///modules/MimeMessage.jsm:88:18
createAndSendMessage@resource:///modules/MessageSend.jsm:116:43
CompleteGenericSendMessage@chrome://messenger/content/messengercompose/MsgComposeCommands.js:4675:23
GenericSendMessage@chrome://messenger/content/messengercompose/MsgComposeCommands.js:4614:29
SendMessage@chrome://messenger/content/messengercompose/MsgComposeCommands.js:4876:21
doCommand@chrome://messenger/content/messengercompose/MsgComposeCommands.js:978:11
doCommand@chrome://messenger/content/messengercompose/MsgComposeCommands.js:1174:9
goDoCommand@chrome://global/content/globalOverlay.js:101:18
oncommand@chrome://messenger/content/messengercompose/messengercompose.xhtml:1:12

Still seeing the problem on this morning's Daily build with this fix too.

Yes, I copied an image from Image Viewer, and pasted into an email.

Rob, can you attach a sample as .eml, one produced with mailnews.send.jsmodule false?

https://hg.mozilla.org/releases/comm-beta/file/tip/mailnews/compose/src/MimePart.jsm#l211

Attached file test.eml —

Here you go.

The JS module seems to be missing the code to generate a filename... The equivalent of:
https://searchfox.org/comm-central/rev/c4336ca990fc2c70be11c7554f24bdaa40936013/mailnews/compose/src/nsMsgCompUtils.cpp#1211-1236

When given a data URL, and no "filename=" is present, it figures out the type of file through some mime magic (to get the extension) and that's where "jficceekmnjikiom.png" comes from in the attached email.

If I change the return ""; line that was added in this patch to return a valid filename for the attachment in question... return "testimage.png"; then I can send.

Thunderbird 85.0b2: (Backout of bug 1680189 enabling mailnews.send.jsmodule)
https://hg.mozilla.org/releases/comm-beta/rev/381addaba05a

Regressed by: 1680189
Regressed by: 1211292
No longer regressions: 1211292
Attachment #9195168 - Attachment description: Bug 1683548: Add test for sending inline image. r=mkmelin,rjl → Bug 1683548: Add test for sending inline image. r=mkmelin

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/b4e0b68fc844
Add test for sending inline image. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: