Closed Bug 1780196 Opened 3 years ago Closed 1 year ago

Allow flowed text via MailExtension compose API

Categories

(Thunderbird :: Add-Ons: Extensions API, enhancement, P3)

Thunderbird 91
enhancement

Tracking

(Not tracked)

RESOLVED FIXED
137 Branch

People

(Reporter: frederick888, Assigned: john)

Details

Attachments

(1 file)

Steps to reproduce:

  1. Make sure mailnews.send_plaintext_flowed is set to true
  2. Configure mail account to send plain text emails
  3. Open a new email composing window
  4. Use compose API setComposeDetails() to update its contents. isPlainText = true, plainTextBody has a trailing space at the end of each line

Actual results:

Trailing spaces are removed when the the email is sent, and the text isn't flowed despite having Content-Type: text/plain; charset=UTF-8; format=flowed.

Expected results:

Trailing spaces are preserved as if the text were physically typed into Thunderbird's email editor.

This allows extensions (and their users) to decide if they want flowed format. For example, I have a request at https://github.com/Frederick888/external-editor-revived/issues/48.

Tested on 102.0.3 and got the same result as well.

I made a proposal in https://github.com/Frederick888/external-editor-revived/issues/48#issuecomment-2122520905

Feedback is appreciated (best to keep the discussion on GitHub in this case).

What we will do is to expose mailnews.send_plaintext_flowed in some sort of settings API, so you know if flowed is enabled or not.

As discussed in the github issue, an add-on can then decide if it wants to update the content of the editor with hard line breaks (if flowed is off), or remove all soft line breaks ( \n -> ) and let Thunderbird reflow the content and then apply its own flowed format.

Priority: -- → P3

The API follows the concept of the browserSetting API from Firefox.
The first two exposed preferences allow extensions to check if outgoing
messages will be using flowed format and the max line length.

The file names for the schema and implementation files
of the messengerUtilities API are adjusted to match those from the
messengerSettings API.

Assignee: nobody → john
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → 137 Branch

Pushed by john@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/924f9969cf2b
Introduce messengerSettings API and expose preferences for mailnews.send_plaintext_flowed and mailnews.wraplength. r=mkmelin

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

Attachment

General

Creator:
Created:
Updated:
Size: