summaryrefslogtreecommitdiff
path: root/qmail-inject.8
blob: 59e11a7019cfdbe5200de7595831cdb338e3a60a (plain)
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
.TH qmail-inject 8
.SH NAME
qmail-inject \- preprocess and send a mail message
.SH SYNOPSIS
.B qmail-inject
[
.B \-nNaAhH
] [
.B \-f\fIsender
] [
.I recip ...
]
.SH DESCRIPTION
.B qmail-inject
reads a mail message from its standard input,
adds appropriate information to the message header,
and invokes
.B qmail-queue
to send the message
to one or more recipients.

See
.B qmail-header(5)
for information on how
.B qmail-inject
rewrites header fields.

.B qmail-inject
normally exits 0.
It exits 100 if it was invoked improperly
or if there is a severe syntax error in the message.
It exits 111 for temporary errors.
.SH "ENVIRONMENT VARIABLES"
For the convenience of users who do not run
.B qmail-inject
directly,
.B qmail-inject
takes many options through environment variables.

The user name in the
.B From
header field is set by
.BR QMAILUSER ,
.BR MAILUSER ,
.BR USER ,
or
.BR LOGNAME ,
whichever comes first.

The host name is normally set by the
.I defaulthost
control
but can be overridden with
.B QMAILHOST
or
.BR MAILHOST .

The personal name is
.BR QMAILNAME ,
.BR MAILNAME ,
or
.BR NAME .

The default envelope sender address is the same as the
default
.B From
address,
but it can be overridden with
.B QMAILSUSER
and
.BR QMAILSHOST .
It may also be modified by the
.B r
and
.B m
letters described below.
Bounces will be sent to this address.

If
.B QMAILMFTFILE
is set,
.B qmail-inject
reads a list of mailing list addresses,
one per line,
from that file.
If To+Cc includes one of those addresses (without regard to case),
.B qmail-inject
adds a Mail-Followup-To field
with all the To+Cc addresses.
.B qmail-inject
does not add Mail-Followup-To
to a message that already has one.

The
.B QMAILINJECT
environment variable
can contain any of the following letters:
.TP
.B c
Use address-comment style for the
.B From
field.
Normally
.B qmail-inject
uses name-address style.
.TP
.B s
Do not look at any incoming
.B Return-Path
field.
Normally, if
.B Return-Path
is supplied, it sets the envelope sender address,
overriding all environment variables.
.B Return-Path
is deleted in any case.
.TP
.B f
Delete any incoming
.B From
field.
Normally, if
.B From
is supplied, it overrides the usual
.B From
field created by
.BR qmail-inject .
.TP
.B i
Delete any incoming
.B Message-ID
field.
Normally, if
.B Message-ID
is supplied, it overrides the usual
.B Message-ID
field created by
.BR qmail-inject .
.TP
.B r
Use a per-recipient VERP.
.B qmail-inject
will append each recipient address to the envelope sender
of the copy going to that recipient.
.TP
.B m
Use a per-message VERP.
.B qmail-inject
will append the current date and process ID to the envelope sender.
.SH OPTIONS
.TP
.B \-a
Send the message to all addresses given as
.I recip
arguments;
do not use header recipient addresses.
.TP
.B \-h
Send the message to all header recipient addresses.
For non-forwarded messages, this means
the addresses listed under
.BR To ,
.BR Cc ,
.BR Bcc ,
.BR Apparently-To .
For forwarded messages, this means
the addresses listed under
.BR Resent-To ,
.BR Resent-Cc ,
.BR Resent-Bcc .
Do not use any
.I recip
arguments.
.TP
.B \-A
(Default.)
Send the message to all addresses given as
.I recip
arguments.
If no
.I recip
arguments are supplied,
send the message to all header recipient addresses.
.TP
.B \-H
Send the message to all header recipient addresses,
and to all addresses given as
.I recip
arguments.
.TP
.B \-f\fIsender
Pass
.I sender
to
.B qmail-queue
as the envelope sender address.
This overrides
.B Return-Path
and all environment variables.
.TP
.B \-N
(Default.)
Feed the resulting message to
.BR qmail-queue .
.TP
.B \-n
Print the message rather than feeding it to
.BR qmail-queue .
.SH "CONTROL FILES"
.TP 5
.I defaultdomain
Default domain name.
Default:
.IR me ,
if that is supplied;
otherwise the literal name
.BR defaultdomain ,
which is probably not what you want.
.B qmail-inject
adds this name to any host name without dots,
including
.I defaulthost
if
.I defaulthost
does not have dots.
(Exception: see
.IR plusdomain .)

The
.B QMAILDEFAULTDOMAIN
environment variable
overrides
.IR defaultdomain .
.TP 5
.I defaulthost
Default host name.
Default:
.IR me ,
if that is supplied;
otherwise the literal name
.BR defaulthost ,
which is probably not what you want.
.B qmail-inject
adds this name to any address without a host name.
.I defaulthost
need not be the current host's name.
For example,
you may prefer that outgoing mail show
just your domain name.

The
.B QMAILDEFAULTHOST
environment variable overrides
.IR defaulthost .
.TP 5
.I idhost
Host name for Message-IDs.
Default:
.IR me ,
if that is supplied;
otherwise the literal name
.BR idhost ,
which is certainly not what you want.
.I idhost
need not be the current host's name.
For example, you may prefer to use fake
host names in Message-IDs.
However,
.I idhost
must be a fully-qualified name within your domain,
and each host in your domain should use a different
.IR idhost .

The
.B QMAILIDHOST
environment variable overrides
.IR idhost .
.TP 5
.I plusdomain
Plus domain name.
Default:
.IR me ,
if that is supplied;
otherwise the literal name
.BR plusdomain ,
which is probably not what you want.
.B qmail-inject
adds this name to any host name that ends with a plus sign,
including
.I defaulthost
if
.I defaulthost
ends with a plus sign.
If a host name does not have dots but ends with a plus sign,
.B qmail-inject
uses
.IR plusdomain ,
not
.IR defaultdomain .

The
.B QMAILPLUSDOMAIN
environment variable overrides
.IR plusdomain .
.SH "SEE ALSO"
addresses(5),
qmail-control(5),
qmail-header(5),
qmail-queue(8)