chiark / gitweb /
Merge branches 'idx/verh' and 'idx/qmqpc'
[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.
212b6f5d 40.SH "EXIT CODES"
2117e02e
MW
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).
212b6f5d 51
2117e02e
MW
52Currently 64, 65, 70, 76, 77, 78, and 112 are considered hard errors,
53and all other codes are considered soft errors,
54but
55.I command
56should avoid relying on this.
212b6f5d 57.SH "ENVIRONMENT VARIABLES"
2117e02e
MW
58.B qmail-local
59supplies several useful environment variables to
60.IR command .
212b6f5d
MW
61.B WARNING:
62These environment variables are not quoted.
63They may contain special characters.
64They are under the control of a possibly malicious remote user.
65
2117e02e
MW
66.B SENDER
67is the envelope sender address.
68.B NEWSENDER
69is the forwarding envelope sender address,
70as described in
71.BR dot-qmail(5) .
72.B RECIPIENT
73is the envelope recipient address,
74.IR local@domain .
75.B USER
76is
77.IR user .
78.B HOME
79is your home directory,
80.IR homedir .
81.B HOST
82is the
83.I domain
84part of the recipient address.
85.B LOCAL
86is the
87.I local
88part.
89.B EXT
90is the
212b6f5d 91address extension,
2117e02e 92.IR ext .
212b6f5d
MW
93
94.B HOST2
95is the portion of
96.B HOST
97preceding the last dot;
98.B HOST3
99is the portion of
100.B HOST
101preceding the second-to-last dot;
102.B HOST4
103is the portion of
104.B HOST
105preceding the third-to-last dot.
106
2117e02e
MW
107.B EXT2
108is the portion of
109.B EXT
110following the first dash;
111.B EXT3
112is the portion
113following the second dash;
114.B EXT4
115is the portion
116following the third dash.
212b6f5d
MW
117.B DEFAULT
118is the portion
119corresponding to the
120.B default
121part of the
122.BR .qmail\- ...
123file name;
124.B DEFAULT
125is not set if
126the file name does not end with
127.BR default .
128
2117e02e
MW
129.B DTLINE
130and
131.B RPLINE
132are the usual
133.B Delivered-To
134and
135.B Return-Path
136lines,
137including newlines.
138.B UFLINE
139is the UUCP-style
140.B From_
141line that
142.B qmail-local
143adds to
144.IR mbox -format
145files.
2117e02e
MW
146.SH "SEE ALSO"
147dot-qmail(5),
148envelopes(5),
149qmail-local(8)