Mailutils 2047

From Mailutils
Revision as of 10:57, 11 July 2015 by Gray (talk | contribs) (Created page with "The <tt>mailutils 2047</tt> command is a filter for decoding or encoding email message headers formatted in accordance with [http://www.faqs.org/rfcs/rfc2047.html RFC 2047...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The mailutils 2047 command is a filter for decoding or encoding email message headers formatted in accordance with RFC 2047. By default, it operates in encode mode and assumes the iso-8859-1 encoding. If arguments are supplied in the command line, they are treated as the text to operate upon. Otherwise the command acts as a UNIX filter, reading lines from the standard input and printing results on the standard output.

For example:

 $ mailutils 2047 'Keld Jørn Simonsen <keld@dkuug.dk>'
 =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>

The decode mode can be requested via the --decode (-d) option:

 $ mailutils 2047 --decode '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>'
 Keld Jørn Simonsen <keld@dkuug.dk>

The --charset (-c) option changes the default character set. It is meaningful both in decode and in encode modes. In decode mode it instructs the utility to convert the output to the given character set. In encode mode it indicates the encoding of the input data, which will be reflected in the resulting string:

 $ mailutils 2047 --charset=utf-8 'Keld Jørn Simonsen <keld@dkuug.dk>'
 =?utf-8?Q?Keld J=C3=B8rn Simonsen <keld@dkuug.dk>?=

The --encoding (-E) option can be used in encode mode to change the output encoding. Valid arguments for this option are: quoted-printable (the default) or base64.

The --newline (-n) option prints an additional newline character after each line of output.

See also