From: Yubin Ruan Date: Mon, 30 Apr 2018 02:36:01 +0000 (+0800) Subject: add doc for multipart/{alternative,multilingual} X-Git-Tag: neomutt-20180512~16^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F734%2Fhead;p=neomutt add doc for multipart/{alternative,multilingual} --- diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 987816cc8..bfff7166d 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -9079,22 +9079,6 @@ echo "Sourcing muttrc file" unset confirmappend macro index ,a "<save-message See table for all available functions. - - Mutt includes some primitive ability to compose multipart/alternative - parts. In the Compose menu, attach the two (or more) alternatives as - usual. For example, attach "invitation.html" and then - "invitation.txt". (You can reorder them using the <move-up> (-) - and <move-down> (+) bindings.) Edit the descriptions, if you - wish. Then tag the attachments that are alternatives, and press the - <group-alternatives> (&) binding to group them together. The - separate parts will be replaced by a single new part with the - multipart/alternative type. From this point on, the alternatives must - be manipulated or deleted as a group. - - - Beware that such messages cannot be postponed. Once two attachments - are grouped as alternatives, they must be sent or lost. - @@ -9895,54 +9879,225 @@ application/postscript; ps2ascii %s; copiousoutput MIME Multipart/Alternative + - The multipart/alternative container type only has - child MIME parts which represent the same content in an alternative - way. This is often used to send HTML messages which contain an - alternative plain text representation. - - - NeoMutt has some heuristics for determining which attachment of - a multipart/alternative type to display: + A multipart/alternative email has several + parts that represent the same content in different formats, such as + text/plain and text/html. This + kind of email is heavily used by many modern mail user agents to send + HTML messages which contain an alternative plain text representation. + You can read and write multipart/alternative emails + in NeoMutt. - - - - First, NeoMutt will check the alternative_order - list to determine if one of the available types is preferred. It - consists of a number of MIME types in order, including support for - implicit and explicit wildcards. For example: - + + + Reading Multipart/Alternative Emails + + NeoMutt has some heuristics for determining which attachment of + a multipart/alternative type to display: + + + + + First, NeoMutt will check the alternative_order + list to determine if one of the available types is preferred. It + consists of a number of MIME types in order, including support for + implicit and explicit wildcards. For example: + -alternative_order text/enriched text/plain text \ - application/postscript image/* +alternative_order text/enriched text/plain text application/postscript image/* - - - - Next, NeoMutt will check if any of the types have a defined - auto_view, and - use that. - - - - - Failing that, NeoMutt will look for any text type. - - - - - As a last attempt, NeoMutt will look for any type it knows how to - handle. - - - + + + + Next, NeoMutt will check if any of the types have a defined + auto_view, and + use that. + + + + + Failing that, NeoMutt will look for any text type. + + + + + As a last attempt, NeoMutt will look for any type it knows how to + handle. + + + + + To remove a MIME type from the alternative_order + list, use the unalternative_order command. + + + + + Composing Multipart/Alternative Emails + + + Noemutt includes some primitive ability to compose multipart/alternative + emails: + + + + + In the Compose menu, attach the two (or more) alternatives as + usual. For example, attach "invitation.html" and then "invitation.txt". + (You can reorder them using the <move-up> (-) + and <move-down> (+) bindings, and edit the + descriptions). + + + + + Tag the attachments that are alternatives, and press the + <group-alternatives> (&) binding to group + them together. After this, the separate parts will be replaced by a single + new part with the multipart/alternative type and the + alternatives must be manipulated or deleted as a group. + + + + + Send the email as usual. + + + + + If all the attachments have been grouped and form a single + multipart/alternative, part then this message will be sent + as a multipart/alternative email, otherwise it will be sent + as a multipart/mixed email. + + + Note that after grouping, you can't view, edit or break the + multipart/alternative bundle, because it is in a temporary + form. But you can view and edit its primitive part using the + <edit> command. When postponing emails or on error + (e.g., no recipients address when sending emails) this + multipart/alternative will be broken apart and need to + be tagged and group together again as described above. + + + + Be aware that when sending a multipart/alternative email, + you have to manually prepare the alternative parts and attach them. However, + you can use Neomutt's macro to perform all the operations needed, such that + you can compose a plain text email as usual and turn that into a + multipart/alternative email in one single command, with + one part being text/plain and the other + text/html. An example macro will be the following: + + +macro compose K "| pandoc -o /tmp/neomutt-alternative.html<enter> \ + <attach-file>/tmp/neomutt-alternative.html<enter> \ + <tag-entry><previous-entry><tag-entry><group-alternatives>" + + + + + + + MIME Multipart/Multilingual + - To remove a MIME type from the alternative_order - list, use the unalternative_order command. + Neomutt includes supports for reading and writing multipart/multilingual + emails. A multipart/multilingual email is like a + multipart/alternative email, except that it comes with parts of + different versions of languages instead of appearances. Its format is described by + RFC8255. + + + Reading Multipart/Multilingual Emails + + Neomutt uses the $preferred_languages variable to determine which + languages to display when displaying a multipart/multilingual email. + You can have several preferred languages, separated by , + +set preferred_languages="fr,en,de" + + Neomutt will try to match these strings again the multilingual header in the received + emails "by prefix", e.g., en will match both en + and en_US. + + + + If $preferred_languages is not set, it default to None, and the + first part of the received multipart/multilingual email will be + displayed. + + + + + Composing Multipart/Multilingual Emails + + The procedures of composing a multipart/multilingual email is similar + to those in Composing Multipart/Alternative. + You have to prepare every part manually or using some scripts, and then tag and group them + together into a multipart/multilingual bundle before sending it: + + + + + + Prepare parts of the multilingual emails. + + + + + + Attach them as attachments. + + + + + + Tag them with <tag-entry> + + + + + + Edit the Content-Language header of every attachment with command + <edit-language> (default to Ctrl-L). This + is important, otherwise the recipient of this email will not know the corresponding + languages. You can set arbitrary string as Content-Language, but it + is recommended to set it as some common prefixes such as "en", "zh" and "fr". + + + + + Group all the tag messages together by <group-multilingual> + (default to ^). + + + + + Send the email as usual. + + + + + + + As in Composing Multipart/Alternative, you can + also use Neomutt's macro and some external scripts to combine these procedure into one. + + + + Note that after grouping, you can't view, edit or break the + multipart/multilingual email bundle, because it is in a temporary form. + But you can view and edit its primitive part using the <edit> + command. When postponing emails or on error (e.g., no recipients address when sending + emails) this multipart/multilingual will be broken apart and need to + be tagged and group together again as described above. + +