Formail is an external utility program (from Procmail) that is nearly always available on systems where Procmail is installed. Its function is to process mail messages and extract information from within the headers of the messages. It acts as a filter that can be used to force mail into a format suitable for storing in a Linux mail system. It can also perform a number of other useful functions such as 'From' escaping, generating auto-replying headers, simple header extracting, or splitting up a mailbox/digest/articles file.
The input data mail/mailbox/article contents need to be provided using the standard input. Therefore, formail
is ideally suited for use in pipeline command chains. Output data is provided on the standard output.
We are not going to go into the subtleties of formail
in this chapter, but as it is a useful tool, we will make reference to some of its functionality in some of our examples. More information can be obtained from the system manual pages.