Mailutils 2047

From Mailutils

Jump to: navigation, search

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 <>'
 =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <>

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

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

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 <>'
 =?utf-8?Q?Keld J=C3=B8rn Simonsen <>?=

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

Personal tools