.TH MAIL-TRANSCODE 1 2015-05-01 "" "User Commands" .SH NAME mail-transcode \- convert between quoted-printable, base64 and binary .SH SYNOPSIS .B mail-transcode .RB [ -v ] .RB [ -q ] .RB [ -b ] .RI [ file ] .SH DESCRIPTION .B mail-transcode takes as input an e-mail message and outputs the same message with any parts that were encoded as `quoted-printable' or `base64' decoded and re-labeled as `binary' .PP With option -q or -b it does the reverse: encode any `binary' parts as `quoted-printable' or `base64'. .PP In other words, a message (or any part of a message) labeled with the header `Content-Transfer-Encoding: quoted-printable' or `Content-Transfer-Encoding: base64' is turned into a message with `Content-Transfer-Encoding: binary', or vice-versa. .PP .B mail-transcode reads from the given .I file or from standard input. The input must be structured as a single e-mail message (possibly a MIME Multipart message), i.e., it must consist of headers followed by a body. An empty line separates the headers from the body. .PP MIME Multipart messages are handled by decoding/encoding each part separately. Each part may itself be multipart, and so on, recursively. .PP Note that decoding does not yield a valid e-mail message: The content-transfer-encoding `binary' is defined by RFC 2045, but it may not actually be used in messages sent over the Internet. It is only meant for local processing. .PP E.g., .BR mail-transcode can be used to decode an e-mail message before processing it with a local program that cannot handle `quoted-printable' and `base64'. Afterwards, .B "mail-transcode -q" or .B "mail-transcode -b" can be used to re-encode the message to a form that is valid for sending. .SH OPTIONS .TP .B -q Causes .B mail-transcode to encode rather than decode messages. It looks for message parts labeled as `binary' and converts them to `quoted-printable'. .TP .B -b Similar to .BR -q , except that it encodes binary parts as `base64'. .TP .B -v Print version number and exit. .PP If both .B -q and .B -b are given, the last one specified wins. .SH BUGS .B mail-transcode does not fully parse the mail headers and could misinterpret them if future standards add extensions. In particular, it does not check the MIME version (currently `MIME-Version: 1.0'). .SH "EXIT STATUS" .B mail-transcode returns 0 on succes, non-zero if an error occurred. .SH AUTHORS Bert Bos .SH SEE ALSO RFC 2045, .BR formail (1), .BR qprint (1), .BR base64 (1)