diff options
author | Robin Jarry <robin@jarry.cc> | 2022-12-06 20:08:49 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-12-07 15:01:33 +0100 |
commit | cbcabfafaab20eaffad642f20151e890161efddc (patch) | |
tree | 987a666459ee6d3402f1b50c520b5f97a946a181 /doc | |
parent | c4df1eea3ef4ac89d52a9d80a8151d3999215a6a (diff) | |
download | aerc-cbcabfafaab20eaffad642f20151e890161efddc.tar.gz |
compose: allow writing multipart/alternative messages
Add a new :multipart command that can be executed on the composer review
screen. This command takes a MIME type as argument which needs to match
a setting in the new [multipart-converters] section of aerc.conf. A part
can be removed by using the -d flag.
The [multipart-converters] section has MIME types associated with
commands. These commands are executed with sh -c every time the main
email body is updated to generate each part content. The commands are
expected to output valid UTF-8 text.
If a command fails, an explicit error will be printed next to the part
MIME type to allow users to debug their issue but the email may still be
sent anyway with an empty alternative part.
This is mostly intended for people who *really* need to send html
messages for their boss or for corporate reasons. For now, it is
a manual and explicit action to convert a message in such a way.
Here is an example configuration:
[multipart-converters]
text/html = pandoc -f markdown -t html
And the associated binding to append an HTML alternative to a message:
[compose::review]
H = :multipart text/html<enter>
hh = :multipart -d text/html<enter>
Link: https://lists.sr.ht/~rjarry/aerc-discuss/%3CCO5KH4W57XNB.2PZLR1CNFK22H%40mashenka%3E
Co-authored-by: Eric McConville <emcconville@emcconville.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/aerc-config.5.scd | 26 | ||||
-rw-r--r-- | doc/aerc.1.scd | 11 |
2 files changed, 37 insertions, 0 deletions
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index 868f6564..4fd04bfa 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -569,6 +569,32 @@ These options are configured in the *[compose]* section of _aerc.conf_. Example: *no-attachment-warning* = _^[^>]\*attach(ed|ment)_ +# MULTIPART CONVERTERS + +Converters allow to generate _multipart/alternative_ messages by converting the +main _text/plain_ body into any other text MIME type with the *:multipart* +command. Only exact MIME types are accepted. The commands are invoked with +_sh -c_ and are expected to output valid UTF-8 text. + +Only _text/<subtype>_ MIME parts can be generated. The _text/plain_ MIME type is +reserved and cannot be generated. You still need to write your emails by hand in +your favorite text editor. + +Converters are configured in the *[multipart-converters]* section of +_aerc.conf_. + +Example: + +``` +[multipart-converters] +text/html=pandoc -f markdown -t html --standalone +``` + +Obviously, this requires that you write your main _text/plain_ body using the +markdown syntax. Also, mind that some mailing lists reject emails that contain +_text/html_ alternative parts. Use this feature carefully and when possible, +avoid using it at all. + # FILTERS Filters are a flexible and powerful way of handling viewing parts of an opened diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd index 5b5add89..b477fbaf 100644 --- a/doc/aerc.1.scd +++ b/doc/aerc.1.scd @@ -524,6 +524,17 @@ message list, the message in the message viewer, etc). *:edit* (Re-)opens your text editor to edit the message in progress. +*:multipart* [*-d*] _<mime/type>_ + Makes the message to multipart/alternative and add the specified + _<mime/type>_ part. Only the MIME types that are configured in the + *[multipart-converters]* section of _aerc.conf_ are supported and their + related commands will be used to generate the alternate part. + + *-d*: + Remove the specified alternative _<mime/type>_ instead of + adding it. If no alternative parts are left, make the message + text/plain (i.e. not multipart/alternative). + *:next-field*++ *:prev-field* Cycles between input fields in the compose window. |