-
Notifications
You must be signed in to change notification settings - Fork 1
/
distribute.1
238 lines (238 loc) · 6.54 KB
/
distribute.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
.\" distribute.1,v 1.3 1993/03/31 08:12:27 shigeya Exp
.\" .TH DISTRIBUTE 1 "26 November 1991"
.TH DISTRIBUTE 1 "31 March 1993"
.SH NAME
distribute \- reforward incoming messages to a mailing list
.SH SYNOPSIS
.B distribute \-l
.I list-name
.B \-h
.I list-host
[
.B \-f
.I senderaddr
]
[
.B \-r
.I replytoaddr
]
[
.B \-a
.I sequence-label
]
[
.B \-I
.I issue-sequence-number-file
]
[
.B \-H
.I headerfile
]
[
.B \-F
.I footerfile
]
[
.B \-m
.I sendmailflags
]
[
.B \-Rsde
]
[
.B \-L
.I recip-addr-file
]
.I recip-1 recip-2 ...
.IX "distribute command" "" "\fLdistribute\fP \(em reforward incoming messages to a mailing list"
.SH DESCRIPTION
.I Distribute
takes as its standard input a mail message, modifies the header (and
optionally the body) of that message, then invokes
.I sendmail
to send the message to the specified recipients.
It is primarily useful for those who run large mailing lists.
.PP
.I Distribute
modifies the header as follows. Any From_, Sender:
Return-Receipt-To:, Errors-To:, Return-Path:, or X-Sequence: header lines
are deleted. A new Sender: line is added. The address given on the
new Sender: line is of the form
.I sender-addr@list-host
(if the
.B \-f
option is used) or
.I list-name-request@list-host
(if no
.B \-f
option is used. If address already contains '@' sign,
.I sender-addr
or
.I list-name-request
is used).
The sender address in the envelope of the mail message will also be set to
the address that appears on the Sender: line.
.PP
If the
.B \-r
option is used, next argument treated as reply-to-address. The
address given on the new Reply-To: line is of the form
.I reply-to-address@list-host
(if address already contains '@' sign,
.I reply-to-address
is used.)
.PP
If the
.B \-I
option is used, next argument is used as a file name for sequence number.
The file contains only a single number for X-Sequence: nnnn. If the file does not exist,
.I distribute
will create new file, and start sequence from one.
If the
.B \-a
option is used, Additional feature for sequenceing is processed. Next argument is treated as a alias-id.
X-Sequence:
.I alias-id nnnn,
and Subject header is changed to
Subject:
.I (alias-id nnnn) Real Subject.
Care of
.B Re:
sequence is also taken.
.PP
If the
.B \-e
option is used, Errors-To: line is added as
.I list-name-request@list-host
form.
.PP
If the
.B \-R
option is used, Received: lines will be deleted from the header. This can
make debugging mailing list problems harder, but can also get messages
delivered in the case where the path the message takes as it comes in and
goes back out is long enough to trigger the
.I sendmail
loop detection ``feature''.
All other
header fields are passed through unmodified.
.PP
If the
.B \-L
option is used, next argument is used as a file name for the list of
recipients. The mail is sent both to the address contained in the
file and to the address recip-1, recip-2, ...
.PP
.I Distribute
checks to be sure that the parens and angle-brackets are matched on
the From:, Cc:, and To: lines.
.I Distribute
also makes sure that none of the lines
composing those fields are over 128 characters long and that none of those
fields are longer than 1024 characters long. This is done to work
around bugs in very old versions of
.I sendmail.
These
errors are of the type that are likely to fill the maintainers mailbox
with at least one message per each address on the list, and thus are worth
taking special pains to avoid. If such a message is detected, it is sent
directly to the list maintainer (rather than to the membership), and flagged
as being broken.
.PP
The
.B \-H
and
.B \-F
options can be used to add new text to the message body before the start of the
original message and to add new text to the end of the original message body.
This feature can be used to remind people about mailing list conventions,
among other things.
.PP
The
.B \-d
option can be used to debug
.I distribute.
In debug mode,
.I distribute
merely prints the
.I sendmail
command it will execute, along with the modified header and body of the
message. No mail is sent in debug mode.
.PP
The
.B \-m
option can be used to pass additional flags to
.I sendmail
on the command line. This can come in handy if one wants to tell
.I sendmail
to queue the message rather than attempt delivery immediately, to tell
.I sendmail
to use an alternate queue directory, and so on. Using an alternate queue
directory can be a big win if you like to keep your big mailing lists from
interfering with normal mail delivery on your system.
.PP
The
.B -s
option turns on the administrivia filter, which attempts to detect messages
that were sent to the list readership rather than to the list maintainers.
Such messages include ``please add me'' and ``please delete me'' messages.
These messages are flagged and sent to the list maintainer.
.PP
To use
.I distribute,
set up the aliases for the list as follows:
.RS .5i
my-list: /homewhere/my-list-dist
.ti 1i
my-list-request: myname
.RE
and set up /homewhere/my-list-dist file as follows:
.RS .5i
| /somewhere/distribute -l my-list -h my-host other-options
-L /somewhere/my-list-recipients-file
.RE
.\" .PP
.\" Note that
.\" .I distribute
.\" must run setuid to the user-id of a
.\" .I sendmail
.\" trusted user. Therefore, its users will have to make their own setuid copy
.\" of this program.
.SH "SEE ALSO"
sendmail(8)
.LP
DARPA Internet Request For Comments RFC822
.LP
DARPA Internet Request For Comments RFC821
.LP
DARPA Internet Request For Comments RFC1211
.SH BUGS
The correctness of the header transformations being performed (or not being
performed) is debatable. It is believed that the header transformations
do nothing wrong; these transformations could be more correct (particularly
in the face of Resent-* lines, which are currently not touched at
all, and which in theory have precedence over their un-resent brethren), but
it seems that most mailers deal with forwarded mail somewhat differently
because the spec is somewhat ambiguous. Someone really should write a
RFC about all this.
.PP
The line and field length checks in the header used to ensure that the From:,
To:, and Cc: fields weren't more than 128 bytes long. The current checks may
be too permissive.
.SH AUTHOR
Originally by Andrew Partan,
Hacked into its current form (and made a bit more RFC822-ish) by Steve
Miller,
Made still more correct with respect to RFC822 by Dave Balenson,
Sequence facility and some hack by Shin Yoshimura (
), Yoshitaka Tokugawa (
), Shigeya Suzuki (
), and Hiroaki Takada (
).