chiark / gitweb /
qmail-smtpd: Oops. I want 550, not 553, for unknown mailboxes.
[qmail] / qmail-inject.8
CommitLineData
2117e02e
MW
1.TH qmail-inject 8
2.SH NAME
3qmail-inject \- preprocess and send a mail message
4.SH SYNOPSIS
5.B qmail-inject
6[
7.B \-nNaAhH
8] [
9.B \-f\fIsender
10] [
11.I recip ...
12]
13.SH DESCRIPTION
14.B qmail-inject
15reads a mail message from its standard input,
16adds appropriate information to the message header,
17and invokes
18.B qmail-queue
19to send the message
20to one or more recipients.
21
22See
23.B qmail-header(5)
24for information on how
25.B qmail-inject
26rewrites header fields.
27
28.B qmail-inject
29normally exits 0.
30It exits 100 if it was invoked improperly
31or if there is a severe syntax error in the message.
32It exits 111 for temporary errors.
33.SH "ENVIRONMENT VARIABLES"
34For the convenience of users who do not run
35.B qmail-inject
36directly,
37.B qmail-inject
38takes many options through environment variables.
39
40The user name in the
41.B From
42header field is set by
43.BR QMAILUSER ,
44.BR MAILUSER ,
45.BR USER ,
46or
47.BR LOGNAME ,
48whichever comes first.
49
50The host name is normally set by the
51.I defaulthost
52control
53but can be overridden with
54.B QMAILHOST
55or
56.BR MAILHOST .
57
58The personal name is
59.BR QMAILNAME ,
60.BR MAILNAME ,
61or
62.BR NAME .
63
64The default envelope sender address is the same as the
65default
66.B From
67address,
68but it can be overridden with
69.B QMAILSUSER
70and
71.BR QMAILSHOST .
72It may also be modified by the
73.B r
74and
75.B m
76letters described below.
77Bounces will be sent to this address.
78
212b6f5d
MW
79If
80.B QMAILMFTFILE
81is set,
82.B qmail-inject
83reads a list of mailing list addresses,
84one per line,
85from that file.
86If To+Cc includes one of those addresses (without regard to case),
87.B qmail-inject
88adds a Mail-Followup-To field
89with all the To+Cc addresses.
90.B qmail-inject
91does not add Mail-Followup-To
92to a message that already has one.
93
2117e02e
MW
94The
95.B QMAILINJECT
96environment variable
97can contain any of the following letters:
98.TP
99.B c
100Use address-comment style for the
101.B From
102field.
103Normally
104.B qmail-inject
105uses name-address style.
106.TP
107.B s
108Do not look at any incoming
109.B Return-Path
110field.
111Normally, if
112.B Return-Path
113is supplied, it sets the envelope sender address,
114overriding all environment variables.
115.B Return-Path
116is deleted in any case.
117.TP
118.B f
119Delete any incoming
120.B From
121field.
122Normally, if
123.B From
124is supplied, it overrides the usual
125.B From
126field created by
127.BR qmail-inject .
128.TP
129.B i
130Delete any incoming
131.B Message-ID
132field.
133Normally, if
134.B Message-ID
135is supplied, it overrides the usual
136.B Message-ID
137field created by
138.BR qmail-inject .
139.TP
140.B r
141Use a per-recipient VERP.
142.B qmail-inject
143will append each recipient address to the envelope sender
144of the copy going to that recipient.
145.TP
146.B m
147Use a per-message VERP.
148.B qmail-inject
149will append the current date and process ID to the envelope sender.
150.SH OPTIONS
151.TP
152.B \-a
153Send the message to all addresses given as
154.I recip
155arguments;
156do not use header recipient addresses.
157.TP
158.B \-h
159Send the message to all header recipient addresses.
160For non-forwarded messages, this means
161the addresses listed under
162.BR To ,
163.BR Cc ,
164.BR Bcc ,
165.BR Apparently-To .
166For forwarded messages, this means
167the addresses listed under
168.BR Resent-To ,
169.BR Resent-Cc ,
170.BR Resent-Bcc .
171Do not use any
172.I recip
173arguments.
174.TP
175.B \-A
176(Default.)
177Send the message to all addresses given as
178.I recip
179arguments.
180If no
181.I recip
182arguments are supplied,
183send the message to all header recipient addresses.
184.TP
185.B \-H
186Send the message to all header recipient addresses,
187and to all addresses given as
188.I recip
189arguments.
190.TP
191.B \-f\fIsender
192Pass
193.I sender
194to
195.B qmail-queue
196as the envelope sender address.
197This overrides
198.B Return-Path
199and all environment variables.
200.TP
201.B \-N
202(Default.)
203Feed the resulting message to
204.BR qmail-queue .
205.TP
206.B \-n
207Print the message rather than feeding it to
208.BR qmail-queue .
209.SH "CONTROL FILES"
210.TP 5
211.I defaultdomain
212Default domain name.
213Default:
214.IR me ,
215if that is supplied;
216otherwise the literal name
217.BR defaultdomain ,
218which is probably not what you want.
219.B qmail-inject
220adds this name to any host name without dots,
221including
222.I defaulthost
223if
224.I defaulthost
225does not have dots.
226(Exception: see
227.IR plusdomain .)
228
229The
230.B QMAILDEFAULTDOMAIN
231environment variable
232overrides
233.IR defaultdomain .
234.TP 5
235.I defaulthost
236Default host name.
237Default:
238.IR me ,
239if that is supplied;
240otherwise the literal name
241.BR defaulthost ,
242which is probably not what you want.
243.B qmail-inject
244adds this name to any address without a host name.
245.I defaulthost
246need not be the current host's name.
247For example,
248you may prefer that outgoing mail show
249just your domain name.
250
251The
252.B QMAILDEFAULTHOST
253environment variable overrides
254.IR defaulthost .
255.TP 5
256.I idhost
257Host name for Message-IDs.
258Default:
259.IR me ,
260if that is supplied;
261otherwise the literal name
262.BR idhost ,
263which is certainly not what you want.
264.I idhost
265need not be the current host's name.
266For example, you may prefer to use fake
267host names in Message-IDs.
268However,
269.I idhost
270must be a fully-qualified name within your domain,
271and each host in your domain should use a different
272.IR idhost .
273
274The
275.B QMAILIDHOST
276environment variable overrides
277.IR idhost .
278.TP 5
279.I plusdomain
280Plus domain name.
281Default:
282.IR me ,
283if that is supplied;
284otherwise the literal name
285.BR plusdomain ,
286which is probably not what you want.
287.B qmail-inject
288adds this name to any host name that ends with a plus sign,
289including
290.I defaulthost
291if
292.I defaulthost
293ends with a plus sign.
294If a host name does not have dots but ends with a plus sign,
295.B qmail-inject
296uses
297.IR plusdomain ,
298not
299.IR defaultdomain .
300
301The
302.B QMAILPLUSDOMAIN
303environment variable overrides
304.IR plusdomain .
305.SH "SEE ALSO"
306addresses(5),
307qmail-control(5),
308qmail-header(5),
309qmail-queue(8)