Debian Codegraph @

upstream/debian-trixie/man1/reformail.1

raw
1 '\" t
2 .\"<!-- Copyright 1998 - 2007 Double Precision, Inc. See COPYING for -->
3 .\"<!-- distribution information. -->
4 .\" Title: reformail
5 .\" Author: Sam Varshavchik
6 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Date: 11/04/2020
8 .\" Manual: Double Precision, Inc.
9 .\" Source: Courier Mail Server
10 .\" Language: English
11 .\"
12 .TH "REFORMAIL" "1" "11/04/2020" "Courier Mail Server" "Double Precision, Inc\&."
13 .\" -----------------------------------------------------------------
14 .\" * Define some portability stuff
15 .\" -----------------------------------------------------------------
16 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 .\" http://bugs.debian.org/507673
18 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
19 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .ie \n(.g .ds Aq \(aq
21 .el .ds Aq '
22 .\" -----------------------------------------------------------------
23 .\" * set default formatting
24 .\" -----------------------------------------------------------------
25 .\" disable hyphenation
26 .nh
27 .\" disable justification (adjust text to left margin only)
28 .ad l
29 .\" -----------------------------------------------------------------
30 .\" * MAIN CONTENT STARTS HERE *
31 .\" -----------------------------------------------------------------
32 .SH "NAME"
33 reformail \- E\-mail reformatting tool
34 .SH "SYNOPSIS"
35 .HP \w'\fBreformail\fR\ 'u
36 \fBreformail\fR \-s command [option...]
37 .HP \w'\fBreformail\fR\ 'u
38 \fBreformail\fR \-D len \fIfilename\fR
39 .HP \w'\fBreformail\fR\ 'u
40 \fBreformail\fR \-x\ \fIheader:\fR...
41 .HP \w'\fBreformail\fR\ 'u
42 \fBreformail\fR \-X\ \fIheader:\fR...
43 .HP \w'\fBreformail\fR\ 'u
44 \fBreformail\fR [\fIoptions\fR...]
45 .sp
46 See below for additional options
47 .SH "DESCRIPTION"
48 .PP
49 The
50 \fBreformail\fR
51 program reads a message on standard input, reformats it in some way, and writes the message to standard output:
52 .SS "Splitting mailboxes into individual messages"
53 .PP
54 The
55 \fB\-s\fR
56 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\&.
57 .PP
58 If the
59 \fBFILENO\fR
60 environment variable is set to a number,
61 \fBreformail\fR
62 will consecutively increment
63 \fBFILENO\fR
64 each time the program is executed for each individual message\&.
65 .PP
66 If
67 \fBFILENO\fR
68 is not set, it\*(Aqs initial value will be "000"\&. If
69 \fBFILENO\fR
70 is set to a non\-numeric value,
71 \fBFILENO\fR
72 will remain unchanged\&.
73 .SS "Detecting duplicate messages"
74 .PP
75 The
76 \fB\-D\fR
77 option implements a simple way to delete duplicate messages in incoming mail\&.
78 \fIfilename\fR
79 is a file that will be approximately \*(Aq\fIlen\fR\*(Aq bytes long\&. This file will be used by
80 \fBreformail\fR
81 to save message IDs seen in recent mail\&.
82 \fBreformail\fR
83 reads the message on standard input\&. If the message has a
84 Message\-ID:
85 header that\*(Aqs already in the cache file,
86 \fBreformail\fR
87 terminates with the exit code set to 0\&. Otherwise,
88 \fBreformail\fR
89 terminates with the exit code set to 1\&.
90 .if n \{\
91 .sp
92 .\}
93 .RS 4
94 .it 1 an-trap
95 .nr an-no-space-flag 1
96 .nr an-break-flag 1
97 .br
98 .ps +1
99 \fBNote\fR
100 .ps -1
101 .br
102 .PP
103 Unlike a similar feature in the
104 \fBformail\fR
105 command,
106 \fBreformail\fR
107 takes care of locking the file, so it\*(Aqs not necessary to implement your own locking mechanism for this option\&.
108 .sp .5v
109 .RE
110 .SS "Extracting headers"
111 .PP
112 The
113 \fB\-x\fR
114 and
115 \fB\-X\fR
116 options extract the indicated headers from the message, and print them to standard output\&. Multiple
117 \fB\-x\fR
118 and
119 \fB\-X\fR
120 options can be specified at the same time, and may be intermixed\&.
121 .PP
122 The
123 \fB\-x\fR
124 option extracts and prints the contents of the header\&. The
125 \fB\-X\fR
126 option prints the name of the header as well\&.
127 .PP
128 In all other situations,
129 \fBreformail\fR
130 copies the message on its standard input to its standard output, reformatting the message as follows:
131 .SH "OPTIONS"
132 .PP
133 \-a\*(Aqheader: value\*(Aq
134 .RS 4
135 Append a custom header to the message if this header does not already exist\&. If the header is either
136 Message\-ID:
137 or
138 Resent\-Message\-ID:
139 and the value is empty,
140 \fBreformail\fR
141 generates a (hopefully) unique message ID for you\&.
142 .RE
143 .PP
144 \-A\*(Aqheader: value\*(Aq
145 .RS 4
146 Append a custom header to the message even if this header already exists\&. If the header is either
147 Message\-ID:
148 or
149 Resent\-Message\-ID:
150 and the value is empty,
151 \fBreformail\fR
152 generates a (hopefully) unique message ID for you\&.
153 .RE
154 .PP
155 \-c
156 .RS 4
157 Concatenate multi\-line headers\&. Headers split on multiple lines are combined into a single line\&.
158 .RE
159 .PP
160 \-d\fIn\fR
161 .RS 4
162 If n is
163 1, each line will be terminated with CRLF\&. If n is
164 0
165 (default), each line will be terminated with LF\&.
166 \fBreformail\fR
167 reads a message with either line terminator, and will force the message to have the specified line termination\&.
168 .RE
169 .PP
170 \-f0
171 .RS 4
172 Any initial blank lines are removed\&. If the first non\-blank line is a "From_" line, it gets converted to a "Return\-Path:" header, and any existing "Return\-Path:" header gets removed\&. If the message does not start with a "From_" line, the message remains unchanged\&.
173 .RE
174 .PP
175 \-f1
176 .RS 4
177 Add the "From_" line to the message, if it\*(Aqs not there\&.
178 \fBreformail\fR
179 will attempt to generate the "From_" line from any
180 Errors\-To:,
181 Return\-Path:, or
182 From:
183 headers in the message\&. "root" will be used if
184 \fBreformail\fR
185 is unable to determine the return address\&.
186 .RE
187 .PP
188 \-i\*(Aq\fIheader: value\fR\*(Aq
189 .RS 4
190 Appends a custom header to the message\&. If this header already exists it is renamed by prepending "Old\-" to the name of the header\&.
191 .RE
192 .PP
193 \-I\*(Aq\fIheader: value\fR\*(Aq
194 .RS 4
195 Append a custom header to the message\&. If this header already exists in the message, the old header is completely removed\&. If the value is empty, any existing header is completely removed, and nothing gets appended\&.
196 .RE
197 .PP
198 \-R oldheader: newheader:
199 .RS 4
200 Rename the indicated header\&.
201 .RE
202 .PP
203 \-u\*(Aqheader:\*(Aq
204 .RS 4
205 If this header occurs multiple times in the message, remove all occurrences except the first one\&.
206 .RE
207 .PP
208 \-U\*(Aqheader:\*(Aq
209 .RS 4
210 If this header occurs multiple times in the message, remove all occurrences except the last one\&.
211 .RE
212 .SH "AUTOREPLIES"
213 .PP
214 The autoreply options from earlier versions of
215 \fBmailbot\fR
216 have been moved into
217 \m[blue]\fB\fBmailbot\fR(1)\fR\m[]\&\s-2\u[1]\d\s+2\&.
218 .SH "BUGS"
219 .PP
220 For the
221 \fB\-a\fR,
222 \fB\-A\fR, and
223 \fB\-I\fR
224 options, a space after the header name and the colon is considered to be a non\-empty field\&.
225 .PP
226 Do not provide the same header to more than one family of header\-modifying options, such as
227 \fB\-u\fR/\fB\-U\fR
228 and
229 \fB\-a\fR/\fB\-A\fR\&. Doing so yields unpredictable results\&. It\*(Aqs better to run
230 \fBreformail\fR
231 several times (use a pipe, perhaps)\&.
232 .SH "SEE ALSO"
233 .PP
234 \m[blue]\fB\fBcourier\fR(8)\fR\m[]\&\s-2\u[2]\d\s+2,
235 \fBsendmail\fR(8),
236 \m[blue]\fB\fBmailbot\fR(1)\fR\m[]\&\s-2\u[1]\d\s+2,
237 \m[blue]\fB\fBmaildrop\fR(1)\fR\m[]\&\s-2\u[3]\d\s+2\&.
238 .SH "AUTHOR"
239 .PP
240 \fBSam Varshavchik\fR
241 .RS 4
242 Author
243 .RE
244 .SH "NOTES"
245 .IP " 1." 4
246 \fBmailbot\fR(1)
247 .RS 4
248 \%http://www.courier-mta.org/maildrop/mailbot.html
249 .RE
250 .IP " 2." 4
251 \fBcourier\fR(8)
252 .RS 4
253 \%http://www.courier-mta.org/maildrop/courier.html
254 .RE
255 .IP " 3." 4
256 \fBmaildrop\fR(1)
257 .RS 4
258 \%http://www.courier-mta.org/maildrop/maildrop.html
259 .RE