Allow External App to Send Email - Version 91.3.0 (64-bit)
Categories
(Thunderbird :: OS Integration, defect)
Tracking
(thunderbird_esr91 fixed, thunderbird95 fixed)
People
(Reporter: simon, Assigned: rnons)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files, 1 obsolete file)
(deleted),
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
|
Details |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
I allow external apps to send email using MAPI.
This stopped working after the update on the 14-11-21 to Thunderbird 91.3.1 (64-bit).
Rolling back to version 91.3.0 (64-bit) has allowed me to send the email.
Actual results:
I set Thunderbird offline. The external app generated the PDF attachments for the emails, and went through the process of creating the emails. But the emails never appeared in the Thunderbird outbox.
Expected results:
The external app generated emails should appear in the Thunderbird outbox.
Comment 1•3 years ago
|
||
Here's what we put in 91.3.1
Comment 2•3 years ago
|
||
simon, do you use the sendlater add-on? Or are you just running thunderbird offline? Also, exactly what application are you sending from?
This might a regression caused by Bug 1735601 - Mapi attachments disappear from moz-mapi folder before email sent, causing "Sending of the message failed." after update to 91.2.0
Comment 3•3 years ago
|
||
FWIW, Rob found an oldie Bug 298126 - In Offline mode, message sent via MAPISendMail will not save the unsent mail in Outbox (Unsent Messages)
(In reply to Wayne Mery (:wsmwk) from comment #2)
simon, do you use the sendlater add-on? Or are you just running thunderbird offline? Also, exactly what application are you sending from?
This might a regression caused by Bug 1735601 - Mapi attachments disappear from moz-mapi folder before email sent, causing "Sending of the message failed." after update to 91.2.0
Hi Wayne.
No I do not use the sendlater add-on. As the external app sends batches of emails, I go offline so they all collect up in the outbox and then go online to send them.
The application is Pegasus Opera3 - www.pegasus.co.uk - it is a business program for Purchase Ordering, Payroll, Sales, etc.
Thank you.
Comment 5•3 years ago
|
||
So what are the steps for someone without pegasus to reproduce this?
Does this way of handing over a complete message to Thunderbird end up in a Thunderbird command line?
Is the complete message first stored somewhere and then goes to TB via Windows MAPI handlers? What's the MAPI call/procedure?
Hi Thomas
I've had a look through the Pegasus user manual (I don't have access to their code/specs) and it states:
"MAPI-compliant e-mail software like Microsoft Outlook installed."
So, I'm guessing that any MAPI software, or MAPI test script, should give the same results?!? Dirk had a test program in this report that may be helpful: https://bugzilla.mozilla.org/show_bug.cgi?id=298126
I'm happy to help with testing if needed.
Thank you.
Assignee | ||
Comment 7•3 years ago
|
||
I don't know about Pegasus, can you try with a local file first
- go to the Settings page, find Config Editor, set
mailnews.send.loglevel
toAll
- set TB to offline (and open DevTools, clear all output in the Console tab)
- right click a local file
- select 'Send to > Mail recipient'
- fill the To address
- click the 'Send Later' button
Does the mail appear in your Outbox? If not, please paste the logs here. If yes, clear the Console tab again, and try sending from Pegasus, and get the logs.
Hi Ping
In the first test the email did appear in the outbox.
In the second test the 2 emails did not appear in the outbox.
The PDF email attachments did appear and very rapidly disappear in this folder: C:\Users\USERNAME\AppData\Local\Temp\moz_mapi
Log:
---------- Test 2 --------------
mailnews.send: Creating message file MessageSend.jsm:116:25
mailnews.send: Fetching file:///C:/Users/USERNAME/AppData/Local/Temp/moz_mapi/Carters%20Limited18112021.PDF MimePart.jsm:255:25
mailnews.send: Failed to fetch attachment; name=Carters Limited18112021.PDF, url=file:///C:/Users/USERNAME/AppData/Local/Temp/moz_mapi/Carters%20Limited18112021.PDF, error=asyncFetch failed with status=2152857618 MimePart.jsm:159:29
mailnews.send:
Exception { name: "", message: "Failed to fetch attachment", result: 2153066778, filename: "resource:///modules/MimePart.jsm", lineNumber: 162, columnNumber: 0, data: XPCWrappedNative_NoHelper, stack: "getEncodedBodyString@resource:///modules/MimePart.jsm:162:26\n", location: XPCWrappedNative_NoHelper }
MessageSend.jsm:122:27
mailnews.send: Sending failed; There was an error attaching Carters Limited18112021.PDF. Please check that you have access to the file., exitCode=2153066778, originalMsgURI= MessageSend.jsm:321:27
mailnews.send: Clean up temporary files MessageSend.jsm:1000:25
mailnews.send: notifyListenerOnStopSending; status=2153066778 MessageSend.jsm:486:25
NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIWindowWatcher.openWindow] PromptParent.jsm:161
mailnews.send: Creating message file MessageSend.jsm:116:25
mailnews.send: Fetching file:///C:/Users/USERNAME/AppData/Local/Temp/moz_mapi/Richardson%20Auto%20Services%20Ltd.PDF MimePart.jsm:255:25
mailnews.send: Failed to fetch attachment; name=Richardson Auto Services Ltd.PDF, url=file:///C:/Users/USERNAME/AppData/Local/Temp/moz_mapi/Richardson%20Auto%20Services%20Ltd.PDF, error=asyncFetch failed with status=2152857618 MimePart.jsm:159:29
mailnews.send:
Exception { name: "", message: "Failed to fetch attachment", result: 2153066778, filename: "resource:///modules/MimePart.jsm", lineNumber: 162, columnNumber: 0, data: XPCWrappedNative_NoHelper, stack: "getEncodedBodyString@resource:///modules/MimePart.jsm:162:26\n", location: XPCWrappedNative_NoHelper }
MessageSend.jsm:122:27
mailnews.send: Sending failed; There was an error attaching Richardson Auto Services Ltd.PDF. Please check that you have access to the file., exitCode=2153066778, originalMsgURI= MessageSend.jsm:321:27
mailnews.send: Clean up temporary files MessageSend.jsm:1000:25
mailnews.send: notifyListenerOnStopSending; status=2153066778 MessageSend.jsm:486:25
NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIWindowWatcher.openWindow] PromptParent.jsm:161
---------- Test 2 End ----------
Thank you for your help.
Assignee | ||
Comment 9•3 years ago
|
||
To prevent ~nsMsgComposed being called before sending finishes.
Updated•3 years ago
|
Assignee | ||
Comment 10•3 years ago
|
||
Can you help me test by downloading an artifact build from https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/H_41HevWSaSiIZXbeEcmPQ/runs/0/artifacts/public/build/target.zip, it's built on https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=2da75fcf20923503ea45dc06a3ff19876a643804. Thanks.
Assignee | ||
Updated•3 years ago
|
Reporter | ||
Comment 11•3 years ago
|
||
Hi
I downloaded the artifact build, extracted it and copied it to Program Files (x86). Just to confirm it is Daily Version 96.0a1 (2021-11-19) (64-bit).
I repeated your tests from comment 7. Both tests now fail.
Test 1. When I right click a file select 'Send to > Mail recipient' I get a MS Office Outlook error:
"Either there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Microsoft Outlook and set it as the default mail client."
The console didn't show an error for 5 to 10 seconds, and then this appeared:
Content Security Policy: Ignoring “'unsafe-inline'” within script-src: ‘strict-dynamic’ specified
Content Security Policy: Ignoring “https:” within script-src: ‘strict-dynamic’ specified
Content Security Policy: Ignoring “http:” within script-src: ‘strict-dynamic’ specified
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://play.google.com/log?format=json&hasfast=true&authuser=0. (Reason: CORS request did not succeed). Status code: (null). 2
Test 2. When I try and send the emails from Pegasus I get the error: "Unable to send email at present"
Again the console didn't show an error for 5 to 10 seconds, and then this appeared:
Content Security Policy: Ignoring “'unsafe-inline'” within script-src: ‘strict-dynamic’ specified
Content Security Policy: Ignoring “https:” within script-src: ‘strict-dynamic’ specified
Content Security Policy: Ignoring “http:” within script-src: ‘strict-dynamic’ specified
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://signaler-pa.clients6.google.com/punctual/v1/chooseServer?key=AIzaSyCkokF7ksaXeZWuLoDCuE1JGr7Ktzg2mXM. (Reason: CORS request did not succeed). Status code: (null). 2
Just to confirm that Windows does show TB as the default mail client. I also went in to TB General Settings and under System Integration used the check now button to make sure that TB was the default mail client - and then repeated the tests, and got the same results.
Thank you.
Comment 12•3 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/b3a061695184
Wait for SendMsg in msgMapiHook.cpp to prevent ~nsMsgComposed being called before sending finishes. r=mkmelin
Assignee | ||
Comment 13•3 years ago
|
||
I tested just now and got the same error. Seems daily build doesn't work with MAPI, I guess the installer handles the MAPI registration. Please wait a few days for this to get into beta, and then esr91.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 14•3 years ago
|
||
Comment on attachment 9251499 [details]
Bug 1741596 - Wait for SendMsg in msgMapiHook.cpp. r=mkmelin
[Approval Request Comment]
Regression caused by (bug #): bug 1735601
User impact if declined: nsMapiHook::BlindSendMail doesn't work for attachments, BlindSendMail means compose window is not brought up when sending
Testing completed (on c-c, etc.): didn't find a way to test on daily build (see comment 11, comment 13)
Risk to taking this patch (and alternatives if risky): only affects nsMapiHook::BlindSendMail
Comment 15•3 years ago
|
||
Comment on attachment 9251499 [details]
Bug 1741596 - Wait for SendMsg in msgMapiHook.cpp. r=mkmelin
[Triage Comment]
Approved for beta
Comment 16•3 years ago
|
||
bugherder uplift |
Thunderbird 95.0b4:
https://hg.mozilla.org/releases/comm-beta/rev/af5bec3ce919
Comment 17•3 years ago
|
||
Comment on attachment 9251499 [details]
Bug 1741596 - Wait for SendMsg in msgMapiHook.cpp. r=mkmelin
[Triage Comment]
Approved for ers91
Comment 18•3 years ago
|
||
bugherder uplift |
Thunderbird 91.4.0:
https://hg.mozilla.org/releases/comm-esr91/rev/34ce6ca9221a
Comment 19•3 years ago
|
||
Comment on attachment 9251499 [details]
Bug 1741596 - Wait for SendMsg in msgMapiHook.cpp. r=mkmelin
I have to backout this patch from comm-esr91 as it caused Windows build failures.
https://treeherder.mozilla.org/jobs?repo=comm-esr91&selectedTaskRun=P8mC5HVpSju2QxZpXT-TZw.0
Ping, can you take a look? 91.4.0 doesn't ship until next week, this fix can still be included.
Comment 20•3 years ago
|
||
backout bugherder uplift |
Backout - Thunderbird 91.4.0:
https://hg.mozilla.org/releases/comm-esr91/rev/365a7cce3762
Comment 21•3 years ago
|
||
(In reply to Ping Chen (:rnons) from comment #14)
Testing completed (on c-c, etc.): didn't find a way to test on daily build (see comment 11, comment 13)
You can build an installer for Daily with mach package
. Then you can install Daily and test MAPI things. MAPI is usually directed to the last installed instance of TB. BTW, why did you remove the offline check?
Comment 22•3 years ago
|
||
Looks like the snippet now needs to be
RefPtr<DomPromiseListener> listener = new DomPromiseListener(
promise,
[&](JSContext*, JS::Handle<JS::Value>) { sendMsgFinished = true; },
[&](nsresult) { sendMsgFinished = true; });
mozilla::SpinEventLoopUntil([=]() { return sendMsgFinished; });
https://searchfox.org/mozilla-central/diff/1662a8faa67cbc597e40ffce754a54cf10c5b712/toolkit/components/extensions/webidl-api/ExtensionEventListener.cpp#61
https://searchfox.org/mozilla-esr91/rev/b03b34bae68d74650ad719958462a56900f3298a/xpcom/threads/SpinEventLoopUntil.h#81
Assignee | ||
Comment 23•3 years ago
|
||
- OnStopSending is not called when saving to Outbox
- test_mapisendmail.js still fails on TreeHerder, but useful for local testing
Assignee | ||
Comment 24•3 years ago
|
||
Thanks, I will make a patch for esr91 tomorrow.
Comment 25•3 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/9502064d884f
Fix nsMapiHook::BlindSendMail for offline mode and add tests. r=mkmelin
Assignee | ||
Comment 26•3 years ago
|
||
[Approval Request Comment]
Merged the two patches and fixed for esr91. Since this only affects nsMapiHook::BlindSendMail, I suggest we skip beta this time.
Comment 27•3 years ago
|
||
Is promise->AppendNativeHandler(listener);
still required? Here it was added after removing the promise parameter:
https://searchfox.org/mozilla-central/diff/1662a8faa67cbc597e40ffce754a54cf10c5b712/toolkit/components/extensions/webidl-api/ExtensionEventListener.cpp#61 (already quoted in comment #22). Also the use of [&]
and [=]
is inconsistent, have you looked what that syntax does?
Assignee | ||
Comment 28•3 years ago
|
||
Thanks, you're right, AppendNativeHandler
is not needed for 91. I tend to use =
(use by value) when &
(use by ref) is not needed.
[Approval Request Comment]
Merged the two patches and fixed for esr91. Since this only affects nsMapiHook::BlindSendMail, I suggest we skip beta this time.
Assignee | ||
Comment 29•3 years ago
|
||
Comment on attachment 9253183 [details] [diff] [review]
1741596-esr91.patch
This seems unneeded. I will make a new patch for bug 1741805 later today, which will also fix this bug.
Reporter | ||
Comment 30•3 years ago
|
||
Upgraded to 91.4.0 and can confirm that this issue has been resolved.
Thank you :-)
Description
•