Upstream qmail 1.01
[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
79The
80.B QMAILINJECT
81environment variable
82can contain any of the following letters:
83.TP
84.B c
85Use address-comment style for the
86.B From
87field.
88Normally
89.B qmail-inject
90uses name-address style.
91.TP
92.B s
93Do not look at any incoming
94.B Return-Path
95field.
96Normally, if
97.B Return-Path
98is supplied, it sets the envelope sender address,
99overriding all environment variables.
100.B Return-Path
101is deleted in any case.
102.TP
103.B f
104Delete any incoming
105.B From
106field.
107Normally, if
108.B From
109is supplied, it overrides the usual
110.B From
111field created by
112.BR qmail-inject .
113.TP
114.B i
115Delete any incoming
116.B Message-ID
117field.
118Normally, if
119.B Message-ID
120is supplied, it overrides the usual
121.B Message-ID
122field created by
123.BR qmail-inject .
124.TP
125.B r
126Use a per-recipient VERP.
127.B qmail-inject
128will append each recipient address to the envelope sender
129of the copy going to that recipient.
130.TP
131.B m
132Use a per-message VERP.
133.B qmail-inject
134will append the current date and process ID to the envelope sender.
135.SH OPTIONS
136.TP
137.B \-a
138Send the message to all addresses given as
139.I recip
140arguments;
141do not use header recipient addresses.
142.TP
143.B \-h
144Send the message to all header recipient addresses.
145For non-forwarded messages, this means
146the addresses listed under
147.BR To ,
148.BR Cc ,
149.BR Bcc ,
150.BR Apparently-To .
151For forwarded messages, this means
152the addresses listed under
153.BR Resent-To ,
154.BR Resent-Cc ,
155.BR Resent-Bcc .
156Do not use any
157.I recip
158arguments.
159.TP
160.B \-A
161(Default.)
162Send the message to all addresses given as
163.I recip
164arguments.
165If no
166.I recip
167arguments are supplied,
168send the message to all header recipient addresses.
169.TP
170.B \-H
171Send the message to all header recipient addresses,
172and to all addresses given as
173.I recip
174arguments.
175.TP
176.B \-f\fIsender
177Pass
178.I sender
179to
180.B qmail-queue
181as the envelope sender address.
182This overrides
183.B Return-Path
184and all environment variables.
185.TP
186.B \-N
187(Default.)
188Feed the resulting message to
189.BR qmail-queue .
190.TP
191.B \-n
192Print the message rather than feeding it to
193.BR qmail-queue .
194.SH "CONTROL FILES"
195.TP 5
196.I defaultdomain
197Default domain name.
198Default:
199.IR me ,
200if that is supplied;
201otherwise the literal name
202.BR defaultdomain ,
203which is probably not what you want.
204.B qmail-inject
205adds this name to any host name without dots,
206including
207.I defaulthost
208if
209.I defaulthost
210does not have dots.
211(Exception: see
212.IR plusdomain .)
213
214The
215.B QMAILDEFAULTDOMAIN
216environment variable
217overrides
218.IR defaultdomain .
219.TP 5
220.I defaulthost
221Default host name.
222Default:
223.IR me ,
224if that is supplied;
225otherwise the literal name
226.BR defaulthost ,
227which is probably not what you want.
228.B qmail-inject
229adds this name to any address without a host name.
230.I defaulthost
231need not be the current host's name.
232For example,
233you may prefer that outgoing mail show
234just your domain name.
235
236The
237.B QMAILDEFAULTHOST
238environment variable overrides
239.IR defaulthost .
240.TP 5
241.I idhost
242Host name for Message-IDs.
243Default:
244.IR me ,
245if that is supplied;
246otherwise the literal name
247.BR idhost ,
248which is certainly not what you want.
249.I idhost
250need not be the current host's name.
251For example, you may prefer to use fake
252host names in Message-IDs.
253However,
254.I idhost
255must be a fully-qualified name within your domain,
256and each host in your domain should use a different
257.IR idhost .
258
259The
260.B QMAILIDHOST
261environment variable overrides
262.IR idhost .
263.TP 5
264.I plusdomain
265Plus domain name.
266Default:
267.IR me ,
268if that is supplied;
269otherwise the literal name
270.BR plusdomain ,
271which is probably not what you want.
272.B qmail-inject
273adds this name to any host name that ends with a plus sign,
274including
275.I defaulthost
276if
277.I defaulthost
278ends with a plus sign.
279If a host name does not have dots but ends with a plus sign,
280.B qmail-inject
281uses
282.IR plusdomain ,
283not
284.IR defaultdomain .
285
286The
287.B QMAILPLUSDOMAIN
288environment variable overrides
289.IR plusdomain .
290.SH "SEE ALSO"
291addresses(5),
292qmail-control(5),
293qmail-header(5),
294qmail-queue(8)