Import fastforward 0.51
[fastforward] / newaliases.1
CommitLineData
8d5530c4
MW
1.TH newaliases 1
2.SH NAME
3newaliases \- create a forwarding database from /etc/aliases
4.SH SYNOPSIS
5.B newaliases
6.SH DESCRIPTION
7.B newaliases
8reads a table of
9sendmail-style
10forwarding instructions from
11.B /etc/aliases
12and converts them into a forwarding database in
13.BR /etc/aliases.cdb .
14The forwarding database can be used by
15.BR fastforward .
16
17For safety,
18.B newaliases
19writes the forwarding database to
20.B /etc/aliases.tmp
21and then moves
22.B /etc/aliases.tmp
23to
24.BR /etc/aliases.cdb .
25If there is a problem creating
26.BR /etc/aliases.tmp ,
27.B newaliases
28complains and leaves
29.B /etc/aliases.cdb
30alone.
31Deliveries can continue using
32.B /etc/aliases.cdb
33in the meantime.
34
35.B newaliases
36always creates
37.B /etc/aliases.cdb
38world-readable.
39
40.B newaliases
41makes no attempt to protect against
42simultaneous updates of
43.BR /etc/aliases.cdb .
44.SH "INSTRUCTION FORMAT"
45.B newaliases
46imitates
47sendmail's
48handling of
49.BR /etc/aliases .
50For example,
51
52.EX
53 root: alice, bill
54.EE
55
56says that mail for
57.B root
58should be forwarded to
59.B alice
60and
61.BR bill .
62
63.B COMPATIBILITY WARNING:
64.B newaliases
65does not support file deliveries.
66You can use the file delivery mechanism described in
67.B dot-qmail(5)
68instead.
69.SH "SIMPLE ALIASES"
70The simplest type of forwarding instruction
71is a line of the form
72
73.EX
74 alias: recip
75.EE
76
77Any message sent to
78.I alias
79will be forwarded to the recipient address
80.IR recip .
81Addresses are compared to
82.I alias
83without regard to case.
84
85Forwarding instructions are cumulative.
86If
87.I recip
88is itself an alias,
89messages to
90.I alias
91will be forwarded the same way as
92messages to
93.IR recip .
94For example, with the following instructions,
95messages to
96.B postmaster@heaven.af.mil
97or
98.B root@heaven.af.mil
99will be delivered to Bob:
100
101.EX
102 postmaster@heaven.af.mil: bob@heaven.af.mil
103.EE
104.br
105.EX
106 root@heaven.af.mil: postmaster@heaven.af.mil
107.EE
108
109.B COMPATIBILITY WARNING:
110With
111sendmail,
112entries in
113.B /etc/aliases
114can override usernames.
115With
116.BR qmail ,
117if you install
118.B fastforward
119in
120.BR ~alias/.qmail-default ,
121it will not see addresses that are controlled by other users.
122See
123.BR qmail-getpw (8).
124To change this, see
125.BR qmail-users (5).
126
127.B COMPATIBILITY WARNING:
128Various versions of
129sendmail
130do various strange things with circular alias definitions.
131See
132.BR setforward (1)
133for details on
134.BR fastforward 's
135behavior.
136
137.B COMPATIBILITY WARNING:
138If there are several forwarding instructions for a single
139.IR alias ,
140sendmail
141will complain;
142.B fastforward
143will silently use the first instruction.
144.SH "WILDCARDS"
145.I alias
146can have the form
147.I user@host.dom
148for one user at one host,
149.I @host.dom
150for all users at one host, or
151.I user
152for one user at all hosts.
153
154.B COMPATIBILITY WARNING:
155sendmail
156supports only
157.IR user ;
158it does not support per-host aliases.
159It accepts
160.I user@host.dom
161if
162.I host.dom
163is a local host,
164but it then treats it the same way as
165.IR user ,
166applying to all local hosts and virtual domains.
167.SH "ADDRESS FORMATS"
168Addresses in
169.B /etc/aliases
170are parsed the same way as addresses in RFC 822 message headers.
171Parenthesized comments and bracketed addresses are permitted:
172
173.EX
174 root: bob (Bob, the postmaster)
175 joe: Joe Shmoe <shmoe@heaven.af.mil>
176.EE
177
178Addresses with special characters must be quoted:
179
180.EX
181 fred: "spaced out mailbox"@heaven.af.mil
182.EE
183
184Address groups are not permitted,
185since colons have a different use in
186.BR /etc/aliases .
187
188Any recipient address without a fully qualified domain name is
189fed through the
190.BR defaulthost ,
191.BR defaultdomain ,
192and
193.B plusdomain
194mechanisms described in
195.BR qmail-header (5).
196
197.B COMPATIBILITY WARNING:
198sendmail's
199handling of quotes and backslashes violates RFC 821 and RFC 822,
200and is not supported by
201.BR newaliases .
202The
203.B qmail-local
204delivery mechanism
205lets each user manage several addresses,
206so there is no need for a special syntax to get around forwarding.
207.SH "MULTIPLE RECIPIENTS"
208An instruction may list more than one recipient address:
209
210.EX
211 alias: recip1, recip2, recip3
212.EE
213
214Any message sent to
215.I alias
216will be forwarded to all of the addresses.
217
218A forwarding instruction may be split across several lines.
219Each line past the first must either (1) begin with space or tab
220or (2) be empty:
221
222.EX
223 hostmaster:
224.EE
225.br
226.EX
227 fred,
228.EE
229.br
230.EX
231 joe
232.EE
233
234.B COMPATIBILITY WARNING:
235sendmail
236requires the colon to be on the first line
237of a multi-line forwarding instruction.
238.B newaliases
239doesn't care whether the colon is present at all.
240
241.B COMPATIBILITY WARNING:
242sendmail
243does not permit blank lines in the middle of continuations.
244This has the undesirable effect that a blank line behaves differently
245from a line containing a single space.
246.SH "COMMENTS"
247Any line in
248.B /etc/aliases
249that begins with # is ignored:
250
251.EX
252 # this is a comment
253.EE
254
255A comment may be split across several lines.
256Each line past the first must either (1) begin with space or tab
257or (2) be empty.
258
259.B COMPATIBILITY WARNING:
260sendmail
261does not permit continuations of comment lines.
262.SH "PROGRAMS"
263If a recipient address does not contain a domain name,
264and begins with a vertical bar,
265.B newaliases
266takes the rest of the address as a program to run:
267
268.EX
269 weather: "|weather-server"
270.EE
271
272.B fastforward
273will run
274.B weather-server
275when a message arrives for
276.BR weather .
277
278.B COMPATIBILITY WARNING:
279Internet addresses can legitimately start with
280a slash or vertical bar.
281.B newaliases
282treats anything with an unquoted @ as an address.
283sendmail appears to have various problems
284coping with these addresses,
285and with commands that contain @ signs.
286
287.B COMPATIBILITY WARNING:
288.B newaliases
289does not allow a vertical bar before double quotes.
290.SH "INCLUDE FILES"
291A recipient address of the form
292.B :include:\fIfile
293means ``every address listed in
294.IR file .''
295(Actually
296.B fastforward
297reads
298.IR file\fB.bin ;
299see
300.BR newinclude (1)
301for further details.)
302
303Note that
304.I file
305is read by
306.BR fastforward ,
307not
308.BR newaliases ,
309so the system administrator does not have to run
310.B newaliases
311every time
312.I file
313changes.
314.I file
315must be world-readable
316and accessible to
317.BR fastforward .
318
319.B COMPATIBILITY WARNING:
320If an
321.B :include:
322file is unreadable or nonexistent,
323sendmail
324skips it;
325.B fastforward
326defers delivery of the message.
327
328.B COMPATIBILITY WARNING:
329sendmail
330does not permit spaces inside the literal text
331.BR :include: .
332.B newaliases
333does.
334
335.B COMPATIBILITY WARNING:
336Versions of
337sendmail
338before V8 did not strip quotes from
339.B :include:
340filenames.
341.SH "ALIAS OWNERS"
342If there is an alias for
343.BR owner-\fIlist ,
344any message forwarded through
345.I list
346will have its envelope sender set to
347.BR owner-\fIlist ,
348so that bounces go back to
349.BR owner-\fIlist .
350
351.B COMPATIBILITY WARNING:
352When an alias includes the same recipient both inside and outside
353a mailing list,
354.B fastforward
355sends the message twice,
356once with each envelope sender.
357sendmail
358sends the message only once;
359its choice of envelope sender for that recipient
360depends on the phase of the moon.
361.SH "SEE ALSO"
362fastforward(1),
363setforward(1),
364newinclude(1),
365printforward(1),
366dot-qmail(5)