formail - mail (re)formatter [ ] [ ] [ ]
[ ] [ ]
[ ] [ ]
[ ... ]

DESCRIPTION
is a filter that can be used to force mail into mailbox format, perform real rigorous `From ' escaping, generate auto-replying headers, do simple header munging/extracting or split up a mailbox/digest/articles file. The mail/mailbox/article contents will be expected on stdin. If formail is supposed to determine the sender of the mail, but is unable to find any, it will substitute `foo@bar'. If formail is started without any command line options, it will force any mail coming from stdin into mailbox format and will escape bogus `From ' lines with a `>'.

OPTIONS
Don't escape any bogus mailbox headers (i.e. lines starting with `From '). Force formail to simply pass along any non-mailbox format (i.e. don't generate a `From ' line as the first line). Generate an auto-reply header. When generating the auto-reply header, keep the body as well. If used together with the option then the body will not be escaped. Trust the sender to have used a valid return address in his header. This option will be most useful when generating auto-reply headers from news articles. If this option is not turned on, formail tries to digest the most probable valid return address itself. The input will be split up into seperate mail messages, and piped into a program one by one (a new program is started for every part). has to be the last option specified, the first argument following it is expected to be the name of a program, any other arguments will be passed along to it. Tell formail not to wait for every program to finish before starting the next. Consider every line starting with `From ' to be the start of a new mail message (this is normally not the case). Enables formail to split up digests/articles into their original parts. Tells formail to ignore any write errors on stdout. Extract this from the header, display it as a single line. Append a custom onto the header; but only if a similar field does not exist yet. Same as except that any existing similar fields are renamed by prepending an ``Old-'' prefix. If consists only of a field-name, it will not be appended. Same as except that any existing similar fields are simply removed. Skip the first messages while splitting. Output at most messages while splitting.

EXAMPLES
To use it as a general formatter in front of procmail include the following procmail recipe at the top of your .procmailrc file: :0 wf | formail To split up a digest one usually uses: formail +1 -ds cat >>the_mailbox_of_your_choice or formail +1 -ds procmail To supersede the Reply-To: field in a header you could use: formail -i "Reply-To: foo@bar"

MISCELLANEOUS
The regular expression that is used to find `real' postmarks is: "\n\nFrom +[^\t\n ]+ +[^\n\t ]"

SEE ALSO

DIAGNOSTICS
Can't fork Too many processes on this machine. Couldn't write to stdout The program that formail was trying to pipe into didn't accept all the data formail sent to it; this diagnostic can be disabled by the option. Failed to execute "x" Program not in path, or not executable. File table full Too many open files on this machine. Invalid field-name: "x" The specified field-name "x" does not contain a colon.

WARNINGS
You can save yourself and others a lot of mischief if you try to avoid using this autoreply feature on mails coming through mailinglists. Depending on the format of the incoming mail (which in turn depends on both the original sender's mail agent and the mailinglist setup) formail could decide to generate an autoreply header that replies to the list (if the original sender was careful enough though, formail will be able to pick his/her address, instead of the list's). Now if the list is not intelligent enough (most aren't) this autoreply will be widely distributed.

BUGS
formail does not do full RFC 822 parsing while generating a `From ' or a `To: ' line, hence it can be fooled by some real tricky escaped/quoted strings with `<', `>' or `(' characters in them.

AUTHOR
Stephen R. van den Berg at RWTH-Aachen, Germany berg@messua.informatik.rwth-aachen.de berg@physik.tu-muenchen.de