1REFORMAIL(1)                Double Precision, Inc.                REFORMAIL(1)
2
3
4

NAME

6       reformail - E-mail reformatting tool
7

SYNOPSIS

9       reformail -s command [option...]
10
11       reformail -D len filename
12
13       reformail -x header:...
14
15       reformail -X header:...
16
17       reformail [options...]
18
19                 See below for additional options
20

DESCRIPTION

22       The reformail program reads a message on standard input, reformats it
23       in some way, and writes the message to standard output:
24
25   Splitting mailboxes into individual messages
26       The -s option splits the mbox-formatted mailbox file on standard input
27       into individual messages. An external program is executed for each
28       message. The contents of each individual message will be provided to
29       the external program on standard input.
30
31       If the FILENO environment variable is set to a number, reformail will
32       consecutively increment FILENO each time the program is executed for
33       each individual message.
34
35       If FILENO is not set, it's initial value will be "000". If FILENO is
36       set to a non-numeric value, FILENO will remain unchanged.
37
38   Detecting duplicate messages
39       The -D option implements a simple way to delete duplicate messages in
40       incoming mail.  filename is a file that will be approximately 'len'
41       bytes long. This file will be used by reformail to save message IDs
42       seen in recent mail.  reformail reads the message on standard input. If
43       the message has a Message-ID: header that's already in the cache file,
44       reformail terminates with the exit code set to 0. Otherwise, reformail
45       terminates with the exit code set to 1.
46
47           Note
48           Unlike a similar feature in the formail command, reformail takes
49           care of locking the file, so it's not necessary to implement your
50           own locking mechanism for this option.
51
52   Extracting headers
53       The -x and -X options extract the indicated headers from the message,
54       and print them to standard output. Multiple -x and -X options can be
55       specified at the same time, and may be intermixed.
56
57       The -x option extracts and prints the contents of the header. The -X
58       option prints the name of the header as well.
59
60       In all other situations, reformail copies the message on its standard
61       input to its standard output, reformatting the message as follows:
62

OPTIONS

64       -a'header: value'
65           Append a custom header to the message if this header does not
66           already exist. If the header is either Message-ID: or
67           Resent-Message-ID: and the value is empty, reformail generates a
68           (hopefully) unique message ID for you.
69
70       -A'header: value'
71           Append a custom header to the message even if this header already
72           exists. If the header is either Message-ID: or Resent-Message-ID:
73           and the value is empty, reformail generates a (hopefully) unique
74           message ID for you.
75
76       -c
77           Concatenate multi-line headers. Headers split on multiple lines are
78           combined into a single line.
79
80       -dn
81           If n is 1, each line will be terminated with CRLF. If n is 0
82           (default), each line will be terminated with LF.  reformail reads a
83           message with either line terminator, and will force the message to
84           have the specified line termination.
85
86       -f0
87           Any initial blank lines are removed. If the first non-blank line is
88           a "From_" line, it gets converted to a "Return-Path:" header, and
89           any existing "Return-Path:" header gets removed. If the message
90           does not start with a "From_" line, the message remains unchanged.
91
92       -f1
93           Add the "From_" line to the message, if it's not there.  reformail
94           will attempt to generate the "From_" line from any Errors-To:,
95           Return-Path:, or From: headers in the message. "root" will be used
96           if reformail is unable to determine the return address.
97
98       -i'header: value'
99           Appends a custom header to the message. If this header already
100           exists it is renamed by prepending "Old-" to the name of the
101           header.
102
103       -I'header: value'
104           Append a custom header to the message. If this header already
105           exists in the message, the old header is completely removed. If the
106           value is empty, any existing header is completely removed, and
107           nothing gets appended.
108
109       -R oldheader: newheader:
110           Rename the indicated header.
111
112       -u'header:'
113           If this header occurs multiple times in the message, remove all
114           occurrences except the first one.
115
116       -U'header:'
117           If this header occurs multiple times in the message, remove all
118           occurrences except the last one.
119

AUTOREPLIES

121       The autoreply options from earlier versions of mailbot have been moved
122       into mailbot(1)[1].
123

BUGS

125       For the -a, -A, and -I options, a space after the header name and the
126       colon is considered to be a non-empty field.
127
128       Do not provide the same header to more than one family of
129       header-modifying options, such as -u/-U and -a/-A. Doing so yields
130       unpredictable results. It's better to run reformail several times (use
131       a pipe, perhaps).
132

SEE ALSO

134       courier(8)[2], sendmail(8), mailbot(1)[1], maildrop(1)[3].
135

AUTHOR

137       Sam Varshavchik
138           Author
139

NOTES

141        1. mailbot(1)
142           http://www.courier-mta.org/maildrop/mailbot.html
143
144        2. courier(8)
145           http://www.courier-mta.org/maildrop/courier.html
146
147        3. maildrop(1)
148           http://www.courier-mta.org/maildrop/maildrop.html
149
150
151
152Courier Mail Server               06/20/2015                      REFORMAIL(1)
Impressum