# aliases(5) - man - phpMan

[ALIASES(5)](https://www.chedong.com/phpMan.php/man/ALIASES/5/markdown)                               File Formats Manual                              [ALIASES(5)](https://www.chedong.com/phpMan.php/man/ALIASES/5/markdown)



## NAME
       aliases - Postfix local alias database format

## SYNOPSIS
### newaliases

## DESCRIPTION
       The  [**aliases**(5)](https://www.chedong.com/phpMan.php/man/aliases/5/markdown) table provides a system-wide mechanism to redirect mail for local recipients.
       The redirections are processed by the Postfix [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) delivery agent.

       Normally, the [**aliases**(5)](https://www.chedong.com/phpMan.php/man/aliases/5/markdown) table is specified as a text  file  that  serves  as  input  to  the
       [**postalias**(1)](https://www.chedong.com/phpMan.php/man/postalias/1/markdown)  command.  The  result,  an  indexed  file in **dbm** or **db** format, is used for fast
       lookup by the mail system. Execute the command **newaliases** in order  to  rebuild  the  indexed
       file after changing the Postfix alias database.

       When  the  table  is  provided via other means such as NIS, LDAP or SQL, the same lookups are
       done as for ordinary indexed files.

       Alternatively, the table can be provided as a regular-expression map where patterns are given
       as regular expressions. In this case, the lookups are done in a slightly different way as de‐
       scribed below under "REGULAR EXPRESSION TABLES".

       Users can control delivery of their own mail by setting up **.forward** files in their  home  di‐
       rectory.   Lines  in  per-user  **.forward** files have the same syntax as the right-hand side of
       [**aliases**(5)](https://www.chedong.com/phpMan.php/man/aliases/5/markdown) entries.

       The format of the alias database input file is as follows:

       •      An alias definition has the form

                   _name_: _value1_, _value2_, _..._

       •      Empty lines and whitespace-only lines are ignored, as are lines whose first non-white‐
              space character is a `#'.

       •      A  logical  line  starts  with non-whitespace text. A line that starts with whitespace
              continues a logical line.

       The _name_ is a local address (no domain part).  Use double quotes when the name  contains  any
       special  characters such as whitespace, `#', `:', or `@'. The _name_ is folded to lowercase, in
       order to make database lookups case insensitive.

       In addition, when an alias exists for **owner-**_name_, this will override the envelope sender  ad‐
       dress,  so that delivery diagnostics are directed to **owner-**_name_, instead of the originator of
       the  message  (for   details,   see   **owner**___**request**___**special**,   **expand**___**owner**___**alias**   and   **re**‐‐
       **set**___**owner**___**alias**).   This  is  typically used to direct delivery errors to the maintainer of a
       mailing list, who is in a better position to deal with mailing list  delivery  problems  than
       the originator of the undelivered mail.

       The _value_ contains one or more of the following:

       _address_
              Mail is forwarded to _address_, which is compatible with the RFC 822 standard.

       _/file/name_
              Mail  is appended to _/file/name_. See [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) for details of delivery to file.  Deliv‐
              ery is not limited to regular files.  For example, to dispose of  unwanted  mail,  de‐
              flect it to **/dev/null**.

       |_command_
              Mail  is  piped into _command_. Commands that contain special characters, such as white‐
              space, should be enclosed between double quotes. See [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) for details of  delivery
              to command.

              When  the  command  fails,  a  limited  amount of command output is mailed back to the
              sender.  The file **/usr/include/sysexits.h** defines the expected exit status codes.  For
              example, use **"|exit** **67"** to simulate a "user unknown" error, and **"|exit** **0"** to implement
              an expensive black hole.

       **:include:**_/file/name_
              Mail is sent to the destinations listed in the named file.  Lines in  **:include:**  files
              have the same syntax as the right-hand side of alias entries.

              A  destination  can be any destination that is described in this manual page. However,
              delivery to "|_command_" and _/file/name_ is disallowed by default. To  enable,  edit  the
              **allow**___**mail**___**to**___**commands** and **allow**___**mail**___**to**___**files** configuration parameters.

## ADDRESS EXTENSION
       When alias database search fails, and the recipient localpart contains the optional recipient
       delimiter (e.g., _user+foo_), the search is repeated for the unextended address (e.g., _user_).

       The **propagate**___**unmatched**___**extensions** parameter controls whether an unmatched address  extension
       (_+foo_) is propagated to the result of table lookup.

## CASE FOLDING
       The  [local(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown)  delivery  agent  always  folds  the search string to lowercase before database
       lookup.

## REGULAR EXPRESSION TABLES
       This section describes how the table lookups change when the table is given in  the  form  of
       regular  expressions.  For  a description of regular expression lookup table syntax, see **reg**‐‐
       **exp**___**[table**(5)](https://www.chedong.com/phpMan.php/man/table/5/markdown) or **pcre**___**[table**(5)](https://www.chedong.com/phpMan.php/man/table/5/markdown). NOTE: these formats do not use ":" at the end of a pattern.

       Each regular expression is applied to  the  entire  search  string.  Thus,  a  search  string
       _user+foo_ is not broken up into _user_ and _foo_.

       Regular  expressions  are applied in the order as specified in the table, until a regular ex‐
       pression is found that matches the search string.

       Lookup results are the same as with indexed file lookups.  For security reasons there  is  no
       support for **$1**, **$2** etc. substring interpolation.

## SECURITY
       The  [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown)  delivery  agent  disallows  regular  expression  substitution  of  $1  etc. in
       **alias**___**maps**, because that would open a security hole.

       The [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) delivery agent will silently ignore  requests  to  use  the  [**proxymap**(8)](https://www.chedong.com/phpMan.php/man/proxymap/8/markdown)  server
       within  **alias**___**maps**. Instead it will open the table directly.  Before Postfix version 2.2, the
       [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) delivery agent will terminate with a fatal error.

## CONFIGURATION PARAMETERS
       The following **main.cf** parameters are especially relevant.  The text below provides only a pa‐
       rameter summary. See [**postconf**(5)](https://www.chedong.com/phpMan.php/man/postconf/5/markdown) for more details including examples.

       **alias**___**database** **(see** **'postconf** **-d'** **output)**
              The  alias  databases for [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) delivery that are updated with "**newaliases**" or with
              "**sendmail** **-bi**".

       **alias**___**maps** **(see** **'postconf** **-d'** **output)**
              The alias databases that are used for [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) delivery.

       **allow**___**mail**___**to**___**commands** **(alias,** **forward)**
              Restrict [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) mail delivery to external commands.

       **allow**___**mail**___**to**___**files** **(alias,** **forward)**
              Restrict [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown) mail delivery to external files.

       **expand**___**owner**___**alias** **(no)**
              When delivering to an alias "_aliasname_" that has an "owner-_aliasname_" companion alias,
              set the envelope sender address to the expansion of the "owner-_aliasname_" alias.

       **propagate**___**unmatched**___**extensions** **(canonical,** **virtual)**
              What address lookup tables copy an address extension from the lookup key to the lookup
              result.

       **owner**___**request**___**special** **(yes)**
              Enable special treatment for owner-_listname_ entries in the [**aliases**(5)](https://www.chedong.com/phpMan.php/man/aliases/5/markdown) file, and  don't
              split owner-_listname_ and _listname_-request address localparts when the recipient_delim‐
              iter is set to "-".

       **recipient**___**delimiter** **(empty)**
              The set of characters that can separate a  user  name  from  its  extension  (example:
              user+foo), or a .forward file name from its extension (example: .forward+foo).

       Available in Postfix version 2.3 and later:

       **frozen**___**delivered**___**to** **(yes)**
              Update   the  [**local**(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown)  delivery  agent's  idea  of  the  Delivered-To:  address  (see
              prepend_delivered_header) only once, at the start of a delivery attempt; do not update
              the Delivered-To: address while expanding aliases or .forward files.

## STANDARDS
       RFC 822 (ARPA Internet Text Messages)

## SEE ALSO
       [local(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown), local delivery agent
       [newaliases(1)](https://www.chedong.com/phpMan.php/man/newaliases/1/markdown), create/update alias database
       [postalias(1)](https://www.chedong.com/phpMan.php/man/postalias/1/markdown), create/update alias database
       [postconf(5)](https://www.chedong.com/phpMan.php/man/postconf/5/markdown), configuration parameters

## README FILES
       Use "**postconf** **readme**___**directory**" or "**postconf** **html**___**directory**" to locate this information.
       DATABASE_README, Postfix lookup table overview

## LICENSE
       The Secure Mailer license must be distributed with this software.

**AUTHOR(S)**
       Wietse Venema
       IBM T.J. Watson Research
       P.O. Box 704
       Yorktown Heights, NY 10598, USA

       Wietse Venema
       Google, Inc.
       111 8th Avenue
       New York, NY 10011, USA



                                                                                          [ALIASES(5)](https://www.chedong.com/phpMan.php/man/ALIASES/5/markdown)
