GNU Mailutils Manual (split by node):   Section:   Chapter:FastBack: Programs   Up: decodemail   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index

3.9.1 Invocation of decodemail.

Usually, the utility is invoked as:

decodemail inbox outbox

where inbox and outbox are file names or URLs of the input and output mailboxes, correspondingly. The input mailbox is opened read-only and will not be modified in any way. In particular, the status of the processed messages will not change. If the output mailbox does not exist, it will be created. If it exists, the messages will be appended to it, preserving any original messages that are already in it. This behavior can be changed using the -t (--truncate) option, described below.

The two mailboxes can be of different types. For example you can read input from an imap server and store it in local ‘maildir’ box using the following command:

decodemail imap://user@example.com maildir:///var/mail/user

Both arguments can be omitted. If outbox is not supplied, the resulting mailbox will be printed on the standard output in Unix ‘mbox’ format. If inbox is not supplied, the utility will open the system inbox for the current user and use it for input.

A consequence of these rules is that there is no simple way to read the input mailbox from standard input (the input must be seekable). If you need to do this, the normal procedure would be to save what would be standard input in a temporary file and then give that file as decodemail’s input.

The following command line options modify the decodemail behavior:

-c, --charset=charset

Convert all textual parts from their original character set to the specified charset.

-R, --recode

Convert all textual parts from their original character set to the current character set, as specified by the LC_ALL or LANG environment variable.

--no-recode

Do not convert character sets. This is the default.

-t, --truncate

If the output mailbox exists, truncate it before appending new messages.

--no-truncate

Keep the existing messages in the output mailbox intact. This is the default.

Additionally, the Common Options are also understood.

GNU Mailutils Manual (split by node):   Section:   Chapter:FastBack: Programs   Up: decodemail   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index