REFORMAIL(1) | Double Precision, Inc. | REFORMAIL(1) |
reformail - E-mail reformatting tool
reformail -s command [option...]
reformail -D len filename
reformail -x header:...
reformail -X header:...
reformail [options...]
See below for additional options
The reformail program reads a message on standard input, reformats it in some way, and writes the message to standard output:
The -s option splits the mbox-formatted mailbox file on standard input into individual messages. An external program is executed for each message. The contents of each individual message will be provided to the external program on standard input.
If the FILENO environment variable is set to a number, reformail will consecutively increment FILENO each time the program is executed for each individual message.
If FILENO is not set, it's initial value will be "000". If FILENO is set to a non-numeric value, FILENO will remain unchanged.
The -D option implements a simple way to delete duplicate messages in incoming mail. filename is a file that will be approximately 'len' bytes long. This file will be used by reformail to save message IDs seen in recent mail. reformail reads the message on standard input. If the message has a Message-ID: header that's already in the cache file, reformail terminates with the exit code set to 0. Otherwise, reformail terminates with the exit code set to 1.
Unlike a similar feature in the formail command, reformail takes care of locking the file, so it's not necessary to implement your own locking mechanism for this option.
The -x and -X options extract the indicated headers from the message, and print them to standard output. Multiple -x and -X options can be specified at the same time, and may be intermixed.
The -x option extracts and prints the contents of the header. The -X option prints the name of the header as well.
In all other situations, reformail copies the message on its standard input to its standard output, reformatting the message as follows:
-a'header: value'
-A'header: value'
-c
-dn
-f0
-f1
-i'header: value'
-I'header: value'
-R oldheader: newheader:
-u'header:'
-U'header:'
The autoreply options from earlier versions of mailbot have been moved into mailbot(1)[1].
For the -a, -A, and -I options, a space after the header name and the colon is considered to be a non-empty field.
Do not provide the same header to more than one family of header-modifying options, such as -u/-U and -a/-A. Doing so yields unpredictable results. It's better to run reformail several times (use a pipe, perhaps).
courier(8)[2], sendmail(8), mailbot(1)[1], maildrop(1)[3].
Sam Varshavchik
06/20/2015 | Courier Mail Server |