1REFORMAIL(1) Double Precision, Inc. REFORMAIL(1)
2
3
4
6 reformail - E-mail reformatting tool
7
9 reformail {-D} {len} {filename}
10
11 reformail {-x header:...}
12
13 reformail {-X header:...}
14
15 reformail [options...]
16
18 The reformail program reads a message on standard input, reformats it
19 in some way, and writes the message to standard output:
20
21 Splitting mailboxes into individual messages
22 The -s option splits the mbox-formatted mailbox file on standard input
23 into individual messages. An external program is executed for each
24 message. The contents of each individual message will be provided to
25 the external program on standard input.
26
27 If the FILENO environment variable is set to a number, reformail will
28 consecutively increment FILENO each time the program is executed for
29 each individual message.
30
31 If FILENO is not set, it's initial value will be "000". If FILENO is
32 set to a non-numeric value, FILENO will remain unchanged.
33
34 Detecting duplicate messages
35 The -D option implements a simple way to delete duplicate messages in
36 incoming mail. filename is a file that will be approximately 'len'
37 bytes long. This file will be used by reformail to save message IDs
38 seen in recent mail. reformail reads the message on standard input. If
39 the message has a Message-ID: header that's already in the cache file,
40 reformail terminates with the exit code set to 0. Otherwise, reformail
41 terminates with the exit code set to 1.
42
43 Extracting headers
44 The -x and -X options extract the indicated headers from the message,
45 and print them to standard output. Multiple -x and -X options can be
46 specified at the same time, and may be intermixed.
47
48 The -x option extracts and prints the contents of the header. The -X
49 option prints the name of the header as well.
50
51 In all other situations, reformail copies the message on its standard
52 input to its standard output, reformatting the message as follows:
53
55 -a'header: value'
56 Append a custom header to the message if this header does not
57 already exist. If the header is either Message-ID: or
58 Resent-Message-ID: and the value is empty, reformail generates a
59 (hopefully) unique message ID for you.
60
61 -A'header: value'
62 Append a custom header to the message even if this header already
63 exists. If the header is either Message-ID: or Resent-Message-ID:
64 and the value is empty, reformail generates a (hopefully) unique
65 message ID for you.
66
67 -c
68 Concatenate multi-line headers. Headers split on multiple lines are
69 combined into a single line.
70
71 -dn
72 If n is 1, each line will be terminated with CRLF. If n is 0
73 (default), each line will be terminated with LF. reformail reads a
74 message with either line terminator, and will force the message to
75 have the specified line termination.
76
77 -f0
78 Remove the "From_" line from the message, if it's there.
79
80 -f1
81 Add the "From_" line to the message, if it's not there. reformail
82 will attempt to generate the "From_" line from any Errors-To:,
83 Return-Path:, or From: headers in the message. "root" will be used
84 if reformail is unable to determine the return address.
85
86 -i'header: value'
87 Appends a custom header to the message. If this header already
88 exists it is renamed by prepending "Old-" to the name of the
89 header.
90
91 -I'header: value'
92 Append a custom header to the message. If this header already
93 exists in the message, the old header is completely removed. If the
94 value is empty, any existing header is completely removed, and
95 nothing gets appended.
96
97 -k
98 After generating an auto-reply header using the -r option, keep the
99 contents of the message itself in the auto-reply.
100
101 -p'prefix'
102 When both -r and -k options are used, the -p option can be used to
103 change the quoting prefix for each line from its default value of
104 ">".
105
106 -P'salutation'
107 When both -r and -k options are used, the -p option is used to
108 specify the salutation that begins the contents of the message. See
109 AUTOREPLIES[1] below.
110
111 -r
112 Generates headers for an auto-reply to this message. This option
113 can be used to create replies to both E-mail and Usenet messages
114 (reformail created both the In-Reply-To: and References: headers).
115 When generating replies to Usenet messages, you'll probably have to
116 always use the -t option also.
117
118 -t
119 Use user-generated headers in order to determine the return address
120 for the -r option. Otherwise, reformail uses machine generated
121 headers.
122
123 -R oldheader: newheader:
124 Rename the indicated header.
125
126 -u'header:'
127 If this header occurs multiple times in the message, remove all
128 occurrences except the first one.
129
130 -U'header:'
131 If this header occurs multiple times in the message, remove all
132 occurrences except the last one.
133
135 The -r option generates a set of headers for an automatic reply to the
136 message, instead of producing just a reformatted copy of the message.
137 As an enhancement, the -r option is smart enough to be able to properly
138 generate an auto-reply to either an E-mail message, or a Usenet message
139 ( reformail creates both a In-Reply-To: and References: header).
140
141 The To: header is set to the apparent sender of the message. To
142 determine the sender of the message, reformail prefers to look at
143 machine-generated headers, such a Errors-To:and Return-Path:, instead
144 of user-generated headers, such as From: or Reply-To:.
145
146 The -t option makes reformail use user-generated headers instead of
147 machine-generated headers.
148
149 The -ra option copies To: headers from the original message into the
150 auto-reply. The -rA option copies To: and Cc: headers.
151
152 Normally, the contents of the original message are removed. The -k
153 option copies the contents of the original message, which each line
154 prefixed by ">". Use the -p option to specify a different prefix.
155
156 The contents of the message are preceded by a salutation specified by
157 the -P option. If not specified, the salutation defaults to "%F
158 writes:%n". Within the salutation, each occurrence of % followed by
159 another character is replaced by some information from the original
160 message, as follows:
161
162 %C
163 Replaced by the contents of the X-Newsgroup: header in the original
164 message.
165
166 %d
167 Replaced by the contents of the Date: header in the original
168 message.
169
170 %f
171 Replaced by the E-mail address of the sender of the original
172 message.
173
174 %F
175 Replaced by the name of the sender of the original message. If no
176 name was given, the E-mail address is used.
177
178 %i
179 Replaced by the contents of the Message-ID: header in the original
180 message.
181
182 %n
183 %n will cause reformail to insert a line break here.
184
185 %N
186 Replaced by the contents of the Newsgroups: header in the original
187 message.
188
189 %s
190 Replaced by the contents of any Subject: header in the original
191 message.
192
194 For the -a, -A, and -I options, a space after the header name and the
195 colon is considered to be a non-empty field.
196
197 Do not provide the same header to more than one family of
198 header-modifying options, such as -u/-U and -a/-A. Doing so yields
199 unpredictable results. It's better to run reformail several times (use
200 a pipe, perhaps).
201
203 courier(8)[2], sendmail(8), mailbot(1)[3], maildrop(1)[4].
204
206 1. AUTOREPLIES
207 #autoreplies
208
209 2. courier(8)
210 courier.html
211
212 3. mailbot(1)
213 mailbot.html
214
215 4. maildrop(1)
216 maildrop.html
217
218
219
220Double Precision, Inc. 04/22/2007 REFORMAIL(1)