newaliases(1) newaliases(1) NNAAMMEE newaliases - create a forwarding database from /etc/aliases SSYYNNOOPPSSIISS nneewwaalliiaasseess DDEESSCCRRIIPPTTIIOONN nneewwaalliiaasseess reads a table of sendmail-style forwarding instructions from //eettcc//aalliiaasseess and converts them into a forwarding database in //eettcc//aalliiaasseess..ccddbb. The forwarding database can be used by ffaassttffoorrwwaarrdd. For safety, nneewwaalliiaasseess writes the forwarding database to //eettcc//aalliiaasseess..ttmmpp and then moves //eettcc//aalliiaasseess..ttmmpp to //eettcc//aalliiaasseess..ccddbb. If there is a problem creating //eettcc//aalliiaasseess..ttmmpp, nneewwaalliiaasseess complains and leaves //eettcc//aalliiaasseess..ccddbb alone. Deliveries can continue using //eettcc//aalliiaasseess..ccddbb in the meantime. nneewwaalliiaasseess always creates //eettcc//aalliiaasseess..ccddbb world-readable. nneewwaalliiaasseess makes no attempt to protect against simultaneous updates of //eettcc//aalliiaasseess..ccddbb. IINNSSTTRRUUCCTTIIOONN FFOORRMMAATT nneewwaalliiaasseess imitates sendmail's handling of //eettcc//aalliiaasseess. For example, root: alice, bill says that mail for rroooott should be forwarded to aalliiccee and bbiillll. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: nneewwaalliiaasseess does not support file deliveries. You can use the file delivery mechanism described in ddoott--qqmmaaiill((55)) instead. SSIIMMPPLLEE AALLIIAASSEESS The simplest type of forwarding instruction is a line of the form alias: recip Any message sent to _a_l_i_a_s will be forwarded to the recipient address _r_e_c_i_p. Addresses are compared to _a_l_i_a_s without regard to case. Forwarding instructions are cumulative. If _r_e_c_i_p is itself an alias, messages to _a_l_i_a_s will be forwarded the same way as messages to _r_e_c_i_p. For example, with the following instructions, messages to ppoossttmmaass-- tteerr@@hheeaavveenn..aaff..mmiill or rroooott@@hheeaavveenn..aaff..mmiill will be delivered to Bob: postmaster@heaven.af.mil: bob@heaven.af.mil root@heaven.af.mil: postmaster@heaven.af.mil CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: With sendmail, entries in //eettcc//aalliiaasseess can over- ride usernames. With qqmmaaiill, if you install ffaassttffoorrwwaarrdd in ~~aalliiaass//..qqmmaaiill--ddeeffaauulltt, it will not see addresses that are controlled by other users. See qqmmaaiill--ggeettppww(8). To change this, see qqmmaaiill--uusseerrss(5). CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: Various versions of sendmail do various strange things with circular alias definitions. See sseettffoorrwwaarrdd(1) for details on ffaassttffoorrwwaarrdd's behavior. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: If there are several forwarding instructions for a single _a_l_i_a_s, sendmail will complain; ffaassttffoorrwwaarrdd will silently use the first instruction. WWIILLDDCCAARRDDSS _a_l_i_a_s can have the form _u_s_e_r_@_h_o_s_t_._d_o_m for one user at one host, _@_h_o_s_t_._d_o_m for all users at one host, or _u_s_e_r for one user at all hosts. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: sendmail supports only _u_s_e_r; it does not support per-host aliases. It accepts _u_s_e_r_@_h_o_s_t_._d_o_m if _h_o_s_t_._d_o_m is a local host, but it then treats it the same way as _u_s_e_r, applying to all local hosts and virtual domains. AADDDDRREESSSS FFOORRMMAATTSS Addresses in //eettcc//aalliiaasseess 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 Addresses with special characters must be quoted: fred: "spaced out mailbox"@heaven.af.mil Address groups are not permitted, since colons have a different use in //eettcc//aalliiaasseess. Any recipient address without a fully qualified domain name is fed through the ddeeffaauulltthhoosstt, ddeeffaauullttddoommaaiinn, and pplluussddoommaaiinn mechanisms described in qqmmaaiill--hheeaaddeerr(5). CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: sendmail's handling of quotes and backslashes violates RFC 821 and RFC 822, and is not supported by nneewwaalliiaasseess. The qqmmaaiill--llooccaall delivery mechanism lets each user manage several addresses, so there is no need for a special syntax to get around forwarding. MMUULLTTIIPPLLEE RREECCIIPPIIEENNTTSS An instruction may list more than one recipient address: alias: recip1, recip2, recip3 Any message sent to _a_l_i_a_s 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, joe CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: sendmail requires the colon to be on the first line of a multi-line forwarding instruction. nneewwaalliiaasseess doesn't care whether the colon is present at all. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: sendmail does not permit blank lines in the mid- dle of continuations. This has the undesirable effect that a blank line behaves differently from a line containing a single space. CCOOMMMMEENNTTSS Any line in //eettcc//aalliiaasseess that begins with # is ignored: # this is a comment A comment may be split across several lines. Each line past the first must either (1) begin with space or tab or (2) be empty. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: sendmail does not permit continuations of com- ment lines. PPRROOGGRRAAMMSS If a recipient address does not contain a domain name, and begins with a vertical bar, nneewwaalliiaasseess takes the rest of the address as a program to run: weather: "|weather-server" ffaassttffoorrwwaarrdd will run wweeaatthheerr--sseerrvveerr when a message arrives for wweeaatthheerr. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: Internet addresses can legitimately start with a slash or vertical bar. nneewwaalliiaasseess treats anything with an unquoted @ as an address. sendmail appears to have various problems coping with these addresses, and with commands that contain @ signs. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: nneewwaalliiaasseess does not allow a vertical bar before double quotes. IINNCCLLUUDDEE FFIILLEESS A recipient address of the form ::iinncclluuddee::_f_i_l_e means ``every address listed in _f_i_l_e.'' (Actually ffaassttffoorrwwaarrdd reads _f_i_l_e..bbiinn; see nneewwiinn-- cclluuddee(1) for further details.) Note that _f_i_l_e is read by ffaassttffoorrwwaarrdd, not nneewwaalliiaasseess, so the system administrator does not have to run nneewwaalliiaasseess every time _f_i_l_e changes. _f_i_l_e must be world-readable and accessible to ffaassttffoorrwwaarrdd. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: If an ::iinncclluuddee:: file is unreadable or nonexis- tent, sendmail skips it; ffaassttffoorrwwaarrdd defers delivery of the message. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: sendmail does not permit spaces inside the lit- eral text ::iinncclluuddee::. nneewwaalliiaasseess does. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: Versions of sendmail before V8 did not strip quotes from ::iinncclluuddee:: filenames. AALLIIAASS OOWWNNEERRSS If there is an alias for oowwnneerr--_l_i_s_t, any message forwarded through _l_i_s_t will have its envelope sender set to oowwnneerr--_l_i_s_t, so that bounces go back to oowwnneerr--_l_i_s_t. CCOOMMPPAATTIIBBIILLIITTYY WWAARRNNIINNGG:: When an alias includes the same recipient both inside and outside a mailing list, ffaassttffoorrwwaarrdd sends the message twice, once with each envelope sender. sendmail sends the message only once; its choice of envelope sender for that recipient depends on the phase of the moon. SSEEEE AALLSSOO fastforward(1), setforward(1), newinclude(1), printforward(1), dot- qmail(5) newaliases(1)