Closed Bug 1536477 Opened 5 years ago Closed 5 years ago

When creating a new mail from an external program (e.g. Libreoffice), then the global preference of only text editing is overridden

Categories

(Thunderbird :: Message Compose Window, defect)

defect
Not set
normal

Tracking

(thunderbird_esr6869+ fixed, thunderbird70 fixed, thunderbird71 fixed)

VERIFIED FIXED
Thunderbird 71.0
Tracking Status
thunderbird_esr68 69+ fixed
thunderbird70 --- fixed
thunderbird71 --- fixed

People

(Reporter: oliver.brendel, Assigned: jorgk-bmo)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

I used "send by mail" menu point in libreoffice writer to send a document by email. This opens a new mail message compose window in Thunderbird. I have the option "writing mails in HTML" unchecked, as I want to only send text emails.

Actual results:

However when the new mail window is opened from an external program, as described above, then the HTML mode is on and the email is send as HTML.

Expected results:

Also when opening a new email from an external program, the global option about how to write emails (HTML or text) should be conserved, text in my case.

I can see this behaviour in TB 68 as well. Relevant code around:
https://searchfox.org/comm-central/search?q=GetForcePlainText&case=false&regexp=false&path=
https://searchfox.org/comm-central/search?q=SetForcePlainText&redirect=false

That's been looked at in bug 1095629 and bug 1366196 and it's still not right :-(

I thought the right decision is taken here:
https://searchfox.org/comm-central/rev/7b9c1cbd595fe0ddc6c5f11c8394ea32036cfaba/mailnews/mapi/mapihook/src/msgMapiHook.cpp#902

The funny thing is, and that was tested back then, that in Windows "Send to > Mail recipient" does obey the format setting. I wonder why it doesn't work when received from LibreOffice.

Needs more debugging.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → jorgk

This needed a rainy Sunday afternoon/evening ... and it's pouring. Turns out that LibreOffice doesn't send a body so our HTML detection isn't triggered and we don't use the default composition format, that's HTML or plaintext, but always HMTL. Patch coming.

Hi Aceman, I know you're not on Windows, so you can't test this. However, you very successfully reviewed bug 1366196. All you need to know is that we want to "force plaintext" if no HTML is found in the message body. Sadly the case where there was no body was overlooked. So if there's no body, we also want to "force plaintext".

The trick is that "plaintext" is later turned into the default compose format here:
https://searchfox.org/comm-central/rev/25ea1af1ce1311e386eacd554299517e4cf84709/mailnews/mapi/mapihook/src/msgMapiHook.cpp#904
And that's exactly what we need.

This code as worked correctly since bug 1366196 for sending a file from Windows via a context menu "Send to > Mail recipient". In this case we get a plaintext body:
Your message is ready to be sent with the following file or link attachments: ...

I tested with sending a document from LibreOffice. It now works find an honours the default compose format.

Attachment #9094473 - Flags: review?(acelists)
Comment on attachment 9094473 [details] [diff] [review]
1536477-no-body.patch

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

OK, if this then uses the user's default format (HTML or plain text), not force plain text for the composition.
Attachment #9094473 - Flags: review?(acelists) → review+
Attachment #9094473 - Flags: approval-comm-esr68+
Attachment #9094473 - Flags: approval-comm-beta+

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/f3f61fcc001a
When no body is supplied via MAPI, honour default compose format. r=aceman

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 71.0

Working in TB 68.1.1.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: