other sections
conflicting packages
newaliases(1) | General Commands Manual | newaliases(1) |
NAME¶
newaliases - create a forwarding database from /etc/aliasesSYNOPSIS¶
newaliasesDESCRIPTION¶
newaliases reads a table of sendmail-style forwarding instructions from /etc/aliases and converts them into a forwarding database in /etc/aliases.cdb. The forwarding database can be used by fastforward. For safety, newaliases writes the forwarding database to /etc/aliases.tmp and then moves /etc/aliases.tmp to /etc/aliases.cdb. If there is a problem creating /etc/aliases.tmp, newaliases complains and leaves /etc/aliases.cdb alone. Deliveries can continue using /etc/aliases.cdb in the meantime. newaliases always creates /etc/aliases.cdb world-readable. newaliases makes no attempt to protect against simultaneous updates of /etc/aliases.cdb.INSTRUCTION FORMAT¶
newaliases imitates sendmail's handling of /etc/aliases. For example,root: alice, billsays that mail for root should be forwarded to alice and bill. COMPATIBILITY WARNING: newaliases does not support file deliveries. You can use the file delivery mechanism described in dot-qmail(5) instead.
SIMPLE ALIASES¶
The simplest type of forwarding instruction is a line of the formalias: recipAny message sent to alias will be forwarded to the recipient address recip. Addresses are compared to alias without regard to case. Forwarding instructions are cumulative. If recip is itself an alias, messages to alias will be forwarded the same way as messages to recip. For example, with the following instructions, messages to postmaster@heaven.af.mil or root@heaven.af.mil will be delivered to Bob:
postmaster@heaven.af.mil: bob@heaven.af.mil
root@heaven.af.mil: postmaster@heaven.af.milCOMPATIBILITY WARNING: With sendmail, entries in /etc/aliases can override usernames. With qmail, if you install fastforward in ~alias/.qmail-default, it will not see addresses that are controlled by other users. See qmail-getpw(8). To change this, see qmail-users(5). COMPATIBILITY WARNING: Various versions of sendmail do various strange things with circular alias definitions. See setforward(1) for details on fastforward's behavior. COMPATIBILITY WARNING: If there are several forwarding instructions for a single alias, sendmail will complain; fastforward will silently use the first instruction.
WILDCARDS¶
alias can have the form user@host.dom for one user at one host, @host.dom for all users at one host, or user for one user at all hosts. COMPATIBILITY WARNING: sendmail supports only user; it does not support per-host aliases. It accepts user@host.dom if host.dom is a local host, but it then treats it the same way as user, applying to all local hosts and virtual domains.ADDRESS FORMATS¶
Addresses in /etc/aliases are parsed the same way as addresses in RFC 822 message headers. Parenthesized comments and bracketed addresses are permitted:root: bob (Bob, the postmaster) joe: Joe Shmoe <shmoe@heaven.af.mil>Addresses with special characters must be quoted:
fred: "spaced out mailbox"@heaven.af.milAddress groups are not permitted, since colons have a different use in /etc/aliases. Any recipient address without a fully qualified domain name is fed through the defaulthost, defaultdomain, and plusdomain mechanisms described in qmail-header(5). COMPATIBILITY WARNING: sendmail's handling of quotes and backslashes violates RFC 821 and RFC 822, and is not supported by newaliases. The qmail-local delivery mechanism lets each user manage several addresses, so there is no need for a special syntax to get around forwarding.
MULTIPLE RECIPIENTS¶
An instruction may list more than one recipient address:alias: recip1, recip2, recip3Any message sent to alias will be forwarded to all of the addresses. A forwarding instruction may be split across several lines. Each line past the first must either (1) begin with space or tab or (2) be empty:
hostmaster:
fred,
joeCOMPATIBILITY WARNING: sendmail requires the colon to be on the first line of a multi-line forwarding instruction. newaliases doesn't care whether the colon is present at all. COMPATIBILITY WARNING: sendmail does not permit blank lines in the middle of continuations. This has the undesirable effect that a blank line behaves differently from a line containing a single space.
COMMENTS¶
Any line in /etc/aliases that begins with # is ignored:# this is a commentA comment may be split across several lines. Each line past the first must either (1) begin with space or tab or (2) be empty. COMPATIBILITY WARNING: sendmail does not permit continuations of comment lines.
PROGRAMS¶
If a recipient address does not contain a domain name, and begins with a vertical bar, newaliases takes the rest of the address as a program to run:weather: "|weather-server"fastforward will run weather-server when a message arrives for weather. COMPATIBILITY WARNING: Internet addresses can legitimately start with a slash or vertical bar. newaliases treats anything with an unquoted @ as an address. sendmail appears to have various problems coping with these addresses, and with commands that contain @ signs. COMPATIBILITY WARNING: newaliases does not allow a vertical bar before double quotes.