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   Extracting headers
48       The -x and -X options extract the indicated headers from the message,
49       and print them to standard output. Multiple -x and -X options can be
50       specified at the same time, and may be intermixed.
51
52       The -x option extracts and prints the contents of the header. The -X
53       option prints the name of the header as well.
54
55       In all other situations, reformail copies the message on its standard
56       input to its standard output, reformatting the message as follows:
57

OPTIONS

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

AUTOREPLIES

113       The autoreply options from earlier versions of mailbot have been moved
114       into mailbot(1)[1].
115

BUGS

117       For the -a, -A, and -I options, a space after the header name and the
118       colon is considered to be a non-empty field.
119
120       Do not provide the same header to more than one family of
121       header-modifying options, such as -u/-U and -a/-A. Doing so yields
122       unpredictable results. It´s better to run reformail several times (use
123       a pipe, perhaps).
124

SEE ALSO

126       courier(8)[2], sendmail(8), mailbot(1)[1], maildrop(1)[3].
127

NOTES

129        1. mailbot(1)
130           [set $man.base.url.for.relative.links]/mailbot.html
131
132        2. courier(8)
133           [set $man.base.url.for.relative.links]/courier.html
134
135        3. maildrop(1)
136           [set $man.base.url.for.relative.links]/maildrop.html
137
138
139
140Double Precision, Inc.            02/19/2010                      REFORMAIL(1)
Impressum