When parsing mbox format files, mailexec unescapes "From " lines. If a line begins with one or more ">" characters followed by "From ", mailexec deletes one of the ">" characters. If you do not want this unescaping behavior, see the formail(1) utility, which has a -s flag that performs a similar function to mailexec.
mailexec -n dir head -1 mailexec -n dir sed -ne 1p
To convert an mbox-format file mbox into a maildir directory dir, you can run:
mailexec mbox deliver dir/
Conversely, to convert maildir dir into an mbox-format file mbox, run:
mailexec dir deliver mbox
To train the spamassassin filter on a mail folder called spam containing unwanted messages, run:
mailexec spam sa-learn --spam
Note that this works whether spam is an mbox format file or a maildir directory.
If you have an old mbox file or maildir directory box and wish to ``import'' the old mail into your web mail account, say firstname.lastname@example.org, you can run:
mailexec -F box sendmail email@example.com
Note again that this works whether box is an mbox format file or a maildir directory.
The Mail Avenger home page: <http://www.mailavenger.org/>.
mailexec generates the time for the "From " line in the local time zone, as is customary on Unix. This could lead to loss of information when transferring mailboxes across time zones or combining mailboxes created in different timezones. Moreover, this practice is incompatible with qmail, which uses GMT in the "From " line.
mailexec expects that if there is a "Return-Path:" header field, it will be the first header field in the message (possibly after the initial "From " line, which is not itself a header field).
There are many different variants of the mbox message format. mailexec expects the ``mboxrd'' variant, in which each message is delimited by a "From " line at the beginning and a blank line at the end, and every line beginning with either "From " or one or more ">" characters followed by "From " is escaped by adding another ">" character. In particular, this means mailexec will incorrectly parse System V ``mboxcl2'' files, which use "Content-Length:" header fields to determine message boundaries rather than "From " lines.
mailexec attempts to lock mbox format files, but will execute anyway even if it cannot obtain the lock. This allows it to work on read-only files, but if you are highly unlucky could result in the last message being truncated.
There is no locking for maildir files. If a maildir is modified while mailexec is running over it, mailexec could miss messages. If you are concurrently manipulating the maildir with a mail reader, maildir could even miss old messages that just happen to have been moved from the new to the cur directory. mailexec will issue a warning if it fails to open a file that it had previously seen when scanning the directory.