Upstream qmail 1.01
[qmail] / qmail-command.8
CommitLineData
2117e02e
MW
1.TH qmail-command 8
2.SH NAME
3qmail-command \- user-specified mail delivery program
4.SH SYNOPSIS
5in
6.BR .qmail\fIext :
7.B |\fIcommand
8.SH DESCRIPTION
9.B qmail-local
10will, upon your request,
11feed each incoming mail message through a program of your choice.
12
13When a mail message arrives,
14.B qmail-local
15runs
16.B sh -c \fIcommand
17in your home directory.
18It makes the message available on
19.IR command 's
20standard input.
21
22.B WARNING:
23The mail message does not begin with
24.BR qmail-local 's
25usual
26.B Return-Path
27and
28.B Delivered-To
29lines.
30
31Note that
32.B qmail-local
33uses the same file descriptor for every delivery
34in your
35.B .qmail
36file, so it is not safe for
37.I command
38to fork a child that
39reads the message in the background while the parent exits.
40
41.IR command 's
42exit codes are interpreted as follows:
430 means that the delivery was successful;
4499 means that the delivery was successful,
45but that
46.B qmail-local
47should ignore all further delivery instructions;
48100 means that the delivery failed permanently (hard error);
49111 means that the delivery failed but should be tried again
50in a little while (soft error).
51Currently 64, 65, 70, 76, 77, 78, and 112 are considered hard errors,
52and all other codes are considered soft errors,
53but
54.I command
55should avoid relying on this.
56
57.B qmail-local
58supplies several useful environment variables to
59.IR command .
60.B SENDER
61is the envelope sender address.
62.B NEWSENDER
63is the forwarding envelope sender address,
64as described in
65.BR dot-qmail(5) .
66.B RECIPIENT
67is the envelope recipient address,
68.IR local@domain .
69.B USER
70is
71.IR user .
72.B HOME
73is your home directory,
74.IR homedir .
75.B HOST
76is the
77.I domain
78part of the recipient address.
79.B LOCAL
80is the
81.I local
82part.
83.B EXT
84is the
85.B .qmail
86extension,
87.IR ext .
88.B EXT2
89is the portion of
90.B EXT
91following the first dash;
92.B EXT3
93is the portion
94following the second dash;
95.B EXT4
96is the portion
97following the third dash.
98.B DTLINE
99and
100.B RPLINE
101are the usual
102.B Delivered-To
103and
104.B Return-Path
105lines,
106including newlines.
107.B UFLINE
108is the UUCP-style
109.B From_
110line that
111.B qmail-local
112adds to
113.IR mbox -format
114files.
115
116.B WARNING:
117These environment variables are not quoted.
118They may contain special characters.
119They are under the control of a possibly malicious remote user.
120.SH "SEE ALSO"
121dot-qmail(5),
122envelopes(5),
123qmail-local(8)