Debianization, and minor fixes.
[fastforward] / setforward.1
CommitLineData
8d5530c4
MW
1.TH setforward 1
2.SH NAME
3setforward \- create a forwarding database
4.SH SYNOPSIS
5.B setforward
6.I cdb
7.I tmp
8.SH DESCRIPTION
9.B setforward
10reads a table of forwarding instructions from its standard input.
11It converts the table into a forwarding database.
12The forwarding database can be used by
13.BR fastforward .
14
15.B setforward
16writes the forwarding database to
17.IR tmp ;
18it then moves
19.I tmp
20to
21.IR cdb .
22.I tmp
23and
24.I cdb
25must be on the same filesystem.
26
27If there is a problem creating
28.IR tmp ,
29.B setforward
30complains and leaves
31.I cdb
32alone.
33
34The forwarding database format is portable across machines.
35.SH "INSTRUCTION FORMAT"
36A forwarding instruction contains a
37.I target\fR,
38a colon, a series of commands, and a semicolon.
39Each command is a
40.I recipient address\fR,
41.I owner address\fR,
42.I external mailing list\fR,
43or
44.I program\fR.
45Commands are separated by commas.
46
47For example,
48
49.EX
50 root@yp.to: god@heaven.af.mil, staff@af.mil;
51.EE
52
53says that mail for
54.B root@yp.to
55should be forwarded to the recipient addresses
56.B god@heaven.af.mil
57and
58.BR staff@af.mil .
59
60When
61.B setforward
62sees # it ignores all text from # to the end of the line:
63
64.EX
65 # this is a comment
66.EE
67
68.B setforward
69ignores all other line endings,
70so you can split a forwarding instruction across lines.
71It also ignores spaces and tabs.
72Exception:
73you can put a space (or tab or comma or whatever)
74into a target or command by putting a backslash in front of it.
75(However, NUL bytes are not permitted anywhere.)
76.SH "TARGETS"
77When
78.B fastforward
79sees the incoming address
80.IR user@host.dom ,
81it tries three targets:
82.IR user@host.dom ,
83.IR @host.dom ,
84and
85.IR user@ .
86It obeys the commands for the first target that it finds.
87Target names are interpreted without regard to case.
88
89All the commands for a single target must be listed in a single instruction.
90Exception: an owner address can be listed in a separate instruction.
91.SH "RECIPIENT ADDRESSES"
92If a command begins with an ampersand,
93.B setforward
94takes the remaining bytes in the command as a recipient address:
95
96.EX
97 boss@yp.to: &god@heaven.af.mil;
98.EE
99
100.B fastforward
101sends each incoming mail message
102to the recipient address.
103The recipient address must include a fully qualified domain name.
104It cannot be longer than 800 bytes.
105
106If a recipient address is itself a target in the forwarding table,
107.B fastforward
108will recursively handle the instructions for that target.
109Note that
110.I @host.dom
111and
112.I user@
113wildcards do not apply here;
114they apply only to the incoming address.
115
116If a command begins with a letter or number,
117.B setforward
118takes the entire command as a recipient address:
119
120.EX
121 boss@yp.to: god@heaven.af.mil;
122.EE
123.SH "OWNER ADDRESSES"
124If a command begins with a question mark,
125.B setforward
126takes the remaining bytes in the command as an owner address:
127
128.EX
129 sos@heaven.af.mil: ?owner-sos@heaven.af.mil;
130.EE
131
132.B fastforward
133uses that address as the envelope sender for forwarded mail,
134so bounces will go back to that address.
135(Normally, if a message is forwarded to a bad address,
136it will bounce back to the original envelope sender.)
137.SH "EXTERNAL MAILING LISTS"
138If a command begins with a dot or slash,
139.B setforward
140takes the entire command as the name of a binary mailing list file created by
141.BR setmaillist :
142
143.EX
144 sos@heaven.af.mil: /etc/lists/sos.bin;
145.EE
146
147.B fastforward
148will read and obey the commands in that file.
149The file must be world-readable
150and accessible to
151.BR fastforward .
152.SH "PROGRAMS"
153If a command begins with a vertical bar or exclamation point,
154.B setforward
155takes the rest of the command as the name of a program to run:
156
157.EX
158 dew@: |dew-monitor;
159.EE
160
161For a vertical bar,
162.B fastforward
163feeds the message
164to that program.
165An exclamation point works the same way except that
166.B fastforward
167inserts
168.BR $UFLINE ,
169.BR $RPLINE ,
170and
171.B $DTLINE
172in front of the message.
173.SH "DUPLICATES"
174When
175.B fastforward
176is building the recipient list for a message,
177it keeps track of the recipient addresses and external mailing lists
178it has used.
179If the same command shows up again, it skips it.
180For example:
181
182.EX
183 everybody@yp.to: programmers@yp.to, testers@yp.to;
184 programmers@yp.to: joe@yp.to, bob@yp.to;
185 testers@yp.to: joe@yp.to, fred@yp.to;
186.EE
187
188A message to
189.B everybody@yp.to
190will be sent to
191.B joe@yp.to
192only once.
193(This also means that addresses in an internal forwarding loop
194are discarded.)
195
196Exception:
197If a target has an owner address,
198commands for that target are considered different
199from commands for ``outside'' targets.
200.SH "SEE ALSO"
201newaliases(1),
202preline(1),
203printforward(1),
204setmaillist(1)