Name

formail

Synopsis

formail [options]

Filter standard input into mailbox format. Useful for splitting mail digests or passing the contents of a mail file to another program, such as a spam filter, for additional processing. If no sender is apparent, provide the sender foo@bar. By default, escape bogus From lines with >.

Options

+skip

Do not split first skip messages.

-total

Stop after splitting total messages.

-a headerfield

Append headerfield to header, unless it already exists. If header-field is Message-ID or Resent-Message-ID with no contents, generate a unique message ID.

-A headerfield

Append headerfield whether or not it already exists.

-b

Do not escape bogus From lines.

-B

Assume that input is in BABYL rmail format.

-c

When header fields are more than one line long, concatenate the lines.

-d

Do not assume that input must be in strict mailbox format. This option disables recognition of the Content-Length field so you can split digests or use nonstandard mailbox formats.

-D maxlen idcache

Remember old message IDs (in idcache, which will grow no larger than approximately maxlen). When splitting, refuse to output duplicate messages. Otherwise, return true on discovering a duplicate. With -r, look at the sender’s mail address instead of the message ID.

-e

Allow messages to begin one immediately after the other; do not require empty space between them.

-f

Do not edit non-mailbox-format lines. By default, formail prepends From to such lines.

-i headerfield

Like -A, but rename each existing headerfield

Get Linux in a Nutshell, 6th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.