logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

newaliases - create a forwarding database from /etc/aliases

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.mil

       Address 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).

       COMPATIBILITYWARNING: 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.

Alias Owners

       If there is an alias for owner-list, any message forwarded through list will have its envelope sender set
       to owner-list, so that bounces go back to owner-list.

       COMPATIBILITYWARNING: When an alias includes the same recipient both inside and outside a mailing list,
       fastforward 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.

Comments

       Any line in /etc/aliases 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.

       COMPATIBILITYWARNING: sendmail does not permit continuations of comment lines.

Description

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.

Include Files

       A  recipient  address  of  the  form  :include:file  means  ``every  address listed in file.''  (Actually
       fastforward reads file.bin; see newinclude(1) for further details.)

       Note that file is read by fastforward, not newaliases, so the system administrator does not have  to  run
       newaliases every time file changes.  file must be world-readable and accessible to fastforward.

       COMPATIBILITYWARNING: If an :include: file is unreadable or nonexistent, sendmail skips it; fastforward
       defers delivery of the message.

       COMPATIBILITYWARNING: sendmail does not permit spaces inside the  literal  text  :include:.   newaliases
       does.

       COMPATIBILITYWARNING: Versions of sendmail before V8 did not strip quotes from :include: filenames.

Instruction Format

newaliases imitates sendmail's handling of /etc/aliases.  For example,

          root: alice, bill

       says that mail for root should be forwarded to alice and bill.

       COMPATIBILITYWARNING:newaliases  does  not  support  file  deliveries.  You can use the file delivery
       mechanism described in dot-qmail(5) instead.

Multiple Recipients

       An instruction may list more than one recipient address:

          alias: recip1, recip2, recip3

       Any 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,
             joe

       COMPATIBILITYWARNING: 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.

       COMPATIBILITYWARNING: 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.

Name

       newaliases - create a forwarding database from /etc/aliases

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.

       COMPATIBILITYWARNING:  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.

       COMPATIBILITYWARNING:newaliases does not allow a vertical bar before double quotes.

See Also

fastforward(1), setforward(1), newinclude(1), printforward(1), dot-qmail(5)

                                                                                                   newaliases(1)

Simple Aliases

       The simplest type of forwarding instruction is a line of the form

          alias: recip

       Any 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.milroot@heaven.af.mil: postmaster@heaven.af.milCOMPATIBILITYWARNING: 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).

       COMPATIBILITYWARNING:  Various  versions  of  sendmail  do  various  strange things with circular alias
       definitions.  See setforward(1) for details on fastforward's behavior.

       COMPATIBILITYWARNING: If there are several forwarding instructions for a  single  alias,  sendmail  will
       complain; fastforward will silently use the first instruction.

Synopsis

newaliases

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.

       COMPATIBILITYWARNING: 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.

See Also