Home | History | Annotate | Line # | Download | only in html
      1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
      2         "https://www.w3.org/TR/html4/loose.dtd">
      3 <html> <head>
      4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      5 <link rel='stylesheet' type='text/css' href='postfix-doc.css'>
      6 <title> Postfix manual - aliases(5) </title>
      7 </head> <body> <pre>
      8 ALIASES(5)                                                          ALIASES(5)
      9 
     10 <b><a name="name">NAME</a></b>
     11        aliases - Postfix local alias database format
     12 
     13 <b><a name="synopsis">SYNOPSIS</a></b>
     14        <b>newaliases</b>
     15 
     16        <b>postalias -q</b> <i>name</i> <b>[</b><i>file-type</i><b>]:[</b><i>file-name</i><b>]</b>
     17 
     18 <b><a name="description">DESCRIPTION</a></b>
     19        The  optional  <a href="aliases.5.html"><b>aliases</b>(5)</a>  table  (<a href="postconf.5.html#alias_maps">alias_maps</a>) redirects mail for local
     20        recipients. The redirections are  processed  by  the  Postfix  <a href="local.8.html"><b>local</b>(8)</a>
     21        delivery  agent.  This  table  is always searched with an email address
     22        localpart (no domain portion).
     23 
     24        This is unlike <a href="virtual.5.html"><b>virtual</b>(5)</a> aliasing (<a href="postconf.5.html#virtual_alias_maps">virtual_alias_maps</a>)  which  applies
     25        to  all  recipients: <a href="local.8.html">local(8)</a>, virtual, and remote, and which is imple-
     26        mented by the <a href="cleanup.8.html"><b>cleanup</b>(8)</a> daemon. That table is often  searched  with  a
     27        full email address (including domain).
     28 
     29        Normally,  the <a href="aliases.5.html"><b>aliases</b>(5)</a> table is specified as a text file that serves
     30        as input to the <a href="postalias.1.html"><b>postalias</b>(1)</a> command to create an indexed file for fast
     31        lookup.  The  location of this file is system-dependent. This text will
     32        use <b>/path/to/aliases</b>.
     33 
     34        Execute the command "<b>newaliases</b>  to  rebuild  the  indexed  file  after
     35        changing the text file. Execute "<b>postalias -q</b> <i>name</i> <b>/path/to/aliases</b>" to
     36        query a default-type  indexed  file,  or  execute  "<b>postalias  -q</b>  <i>name</i>
     37        <i>type</i><b>:/path/to/aliases</b>" to specify an explicit type.
     38 
     39        The  default  indexed  file  type  is configured with the <a href="postconf.5.html#default_database_type">default_data</a>-
     40        <a href="postconf.5.html#default_database_type">base_type</a> parameter. Depending on the  platform  this  may  be  one  of
     41        <a href="lmdb_table.5.html">lmdb</a>:, <a href="CDB_README.html">cdb</a>:, <a href="DATABASE_README.html#types">hash</a>:, or <a href="DATABASE_README.html#types">dbm</a>: (without the trailing ':').
     42 
     43        When  the  table  is provided via other means such as NIS, LDAP or SQL,
     44        the same lookups are done as for ordinary indexed files.  Managing such
     45        databases is outside the scope of Postfix.
     46 
     47        Alternatively,  the  table  can be provided as a regular-expression map
     48        where patterns are given as regular  expressions.  In  this  case,  the
     49        lookups  are  done in a slightly different way as described below under
     50        "REGULAR EXPRESSION TABLES".
     51 
     52        Users can control delivery of their own mail  by  setting  up  <b>.forward</b>
     53        files  in  their home directory.  Lines in per-user <b>.forward</b> files have
     54        the same syntax as the right-hand side of <a href="aliases.5.html"><b>aliases</b>(5)</a> entries.
     55 
     56        The format of the alias database input file is as follows:
     57 
     58        <b>o</b>      An alias definition has the form
     59 
     60                    <i>name</i>: <i>value1</i>, <i>value2</i>, <i>...</i>
     61 
     62        <b>o</b>      Empty lines and whitespace-only lines are ignored, as are  lines
     63               whose first non-whitespace character is a `#'.
     64 
     65        <b>o</b>      A  logical  line  starts  with  non-whitespace text. A line that
     66               starts with whitespace continues a logical line.
     67 
     68        The <i>name</i> is a local address (no domain part).  Use double  quotes  when
     69        the  name contains any special characters such as whitespace, `#', `:',
     70        or `@'. The <i>name</i> is folded to lowercase,  in  order  to  make  database
     71        lookups case insensitive.
     72 
     73        In  addition,  when  an alias exists for <b>owner-</b><i>name</i>, this will override
     74        the envelope sender address, so that delivery diagnostics are  directed
     75        to  <b>owner-</b><i>name</i>,  instead of the originator of the message (for details,
     76        see <b><a href="postconf.5.html#owner_request_special">owner_request_special</a></b>, <b><a href="postconf.5.html#expand_owner_alias">expand_owner_alias</a></b>  and  <b><a href="postconf.5.html#reset_owner_alias">reset_owner_alias</a></b>).
     77        This is typically used to direct delivery errors to the maintainer of a
     78        mailing list, who is in a better position to  deal  with  mailing  list
     79        delivery problems than the originator of the undelivered mail.
     80 
     81        The <i>value</i> contains one or more of the following:
     82 
     83        <i>address</i>
     84               Mail  is  forwarded to <i>address</i>, which is compatible with the <a href="https://tools.ietf.org/html/rfc822">RFC</a>
     85               <a href="https://tools.ietf.org/html/rfc822">822</a> standard.
     86 
     87        <i>/file/name</i>
     88               Mail is appended to <i>/file/name</i>. For details on  how  a  file  is
     89               written  see the sections "EXTERNAL FILE DELIVERY" and "DELIVERY
     90               RIGHTS" in the <a href="local.8.html"><b>local</b>(8)</a> documentation.  Delivery is not  limited
     91               to  regular  files.   For  example, to dispose of unwanted mail,
     92               deflect it to <b>/dev/null</b>.
     93 
     94        |<i>command</i>
     95               Mail is piped into <i>command</i>. Commands that contain special  char-
     96               acters,  such  as  whitespace, should be enclosed between double
     97               quotes. For details on how a command is executed  see  "EXTERNAL
     98               COMMAND DELIVERY" and "DELIVERY RIGHTS" in the <a href="local.8.html"><b>local</b>(8)</a> documen-
     99               tation.
    100 
    101               When the command fails, a limited amount of  command  output  is
    102               mailed  back  to  the  sender.  The file <b>/usr/include/sysexits.h</b>
    103               defines the expected exit status codes. For example, use  <b>"|exit</b>
    104               <b>67"</b>  to simulate a "user unknown" error, and <b>"|exit 0"</b> to imple-
    105               ment an expensive black hole.
    106 
    107        <b>:include:</b><i>/file/name</i>
    108               Mail is sent to the  destinations  listed  in  the  named  file.
    109               Lines  in <b>:include:</b> files have the same syntax as the right-hand
    110               side of <a href="aliases.5.html"><b>aliases</b>(5)</a> entries.
    111 
    112               A destination can be any destination that is described  in  this
    113               manual  page.  However, delivery to "|<i>command</i>" and <i>/file/name</i> is
    114               disallowed by default. To enable,  edit  the  <b><a href="postconf.5.html#allow_mail_to_commands">allow_mail_to_com</a>-</b>
    115               <b><a href="postconf.5.html#allow_mail_to_commands">mands</a></b> and <b><a href="postconf.5.html#allow_mail_to_files">allow_mail_to_files</a></b> configuration parameters.
    116 
    117 <b><a name="address_extension">ADDRESS EXTENSION</a></b>
    118        When  alias database search fails, and the recipient localpart contains
    119        the optional  recipient  delimiter  (e.g.,  <i>user+foo</i>),  the  search  is
    120        repeated for the unextended address (e.g., <i>user</i>).
    121 
    122        The   <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b>   parameter  controls  whether  an
    123        unmatched address extension (<i>+foo</i>) is propagated to the result of table
    124        lookup.
    125 
    126 <b><a name="case_folding">CASE FOLDING</a></b>
    127        The <a href="local.8.html">local(8)</a> delivery agent always folds the search string to lowercase
    128        before database lookup.
    129 
    130 <b><a name="regular_expression_tables">REGULAR EXPRESSION TABLES</a></b>
    131        This section describes how the table lookups change when the  table  is
    132        given  in the form of regular expressions. For a description of regular
    133        expression lookup table syntax, see <a href="regexp_table.5.html"><b>regexp_table</b>(5)</a>  or  <a href="pcre_table.5.html"><b>pcre_table</b>(5)</a>.
    134        NOTE: these formats do not use ":" at the end of a pattern.
    135 
    136        Each regular expression is applied to the entire search string. Thus, a
    137        search string <i>user+foo</i> is not broken up into <i>user</i> and <i>foo</i>.
    138 
    139        Regular expressions are applied in the order as specified in the table,
    140        until a regular expression is found that matches the search string.
    141 
    142        Lookup results are the same as with indexed file lookups.  For security
    143        reasons there is no support for <b>$1</b>, <b>$2</b> etc. substring interpolation.
    144 
    145 <b><a name="security">SECURITY</a></b>
    146        The <a href="local.8.html"><b>local</b>(8)</a> delivery agent disallows regular  expression  substitution
    147        of $1 etc. in <b><a href="postconf.5.html#alias_maps">alias_maps</a></b>, because that would open a security hole.
    148 
    149        The  <a href="local.8.html"><b>local</b>(8)</a>  delivery  agent will silently ignore requests to use the
    150        <a href="proxymap.8.html"><b>proxymap</b>(8)</a> server within <b><a href="postconf.5.html#alias_maps">alias_maps</a></b>. Instead it will  open  the  table
    151        directly.  Before Postfix version 2.2, the <a href="local.8.html"><b>local</b>(8)</a> delivery agent will
    152        terminate with a fatal error.
    153 
    154 <b><a name="configuration_parameters">CONFIGURATION PARAMETERS</a></b>
    155        The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are  especially  relevant.   The  text
    156        below  provides  only  a  parameter  summary.  See <a href="postconf.5.html"><b>postconf</b>(5)</a> for more
    157        details including examples.
    158 
    159        <b><a href="postconf.5.html#alias_database">alias_database</a> (see 'postconf -d' output)</b>
    160               The alias databases for <a href="local.8.html"><b>local</b>(8)</a> delivery that are updated  with
    161               "<b>newaliases</b>" or with "<b>sendmail -bi</b>".
    162 
    163        <b><a href="postconf.5.html#alias_maps">alias_maps</a> (see 'postconf -d' output)</b>
    164               Optional  lookup  tables  that  are  searched only with an email
    165               address localpart (no domain) and that apply  only  to  <a href="local.8.html"><b>local</b>(8)</a>
    166               recipients;  this  is  unlike  <a href="postconf.5.html#virtual_alias_maps">virtual_alias_maps</a> that are often
    167               searched with a full email address (including domain)  and  that
    168               apply to all recipients: <a href="local.8.html"><b>local</b>(8)</a>, virtual, and remote.
    169 
    170        <b><a href="postconf.5.html#allow_mail_to_commands">allow_mail_to_commands</a> (alias, forward)</b>
    171               Restrict <a href="local.8.html"><b>local</b>(8)</a> mail delivery to external commands.
    172 
    173        <b><a href="postconf.5.html#allow_mail_to_files">allow_mail_to_files</a> (alias, forward)</b>
    174               Restrict <a href="local.8.html"><b>local</b>(8)</a> mail delivery to external files.
    175 
    176        <b><a href="postconf.5.html#expand_owner_alias">expand_owner_alias</a> (no)</b>
    177               When   delivering   to   an   alias   "<i>aliasname</i>"  that  has  an
    178               "owner-<i>aliasname</i>"  companion  alias,  set  the  envelope  sender
    179               address to the expansion of the "owner-<i>aliasname</i>" alias.
    180 
    181        <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a> (canonical, virtual)</b>
    182               What  address  lookup  tables copy an address extension from the
    183               lookup key to the lookup result.
    184 
    185        <b><a href="postconf.5.html#owner_request_special">owner_request_special</a> (yes)</b>
    186               Enable special  treatment  for  owner-<i>listname</i>  entries  in  the
    187               <a href="aliases.5.html"><b>aliases</b>(5)</a>  file,  and  don't  split  owner-<i>listname</i>  and  <i>list-</i>
    188               <i>name</i>-request address localparts when the <a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a>  is
    189               set to "-".
    190 
    191        <b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> (empty)</b>
    192               The  set of characters that can separate an email address local-
    193               part, user name, or a .forward file name from its extension.
    194 
    195        Available in Postfix version 2.3 and later:
    196 
    197        <b><a href="postconf.5.html#frozen_delivered_to">frozen_delivered_to</a> (yes)</b>
    198               Update the <a href="local.8.html"><b>local</b>(8)</a> delivery agent's idea of  the  Delivered-To:
    199               address  (see  <a href="postconf.5.html#prepend_delivered_header">prepend_delivered_header</a>) only once, at the start
    200               of a delivery attempt; do not update the  Delivered-To:  address
    201               while expanding aliases or .forward files.
    202 
    203 <b><a name="standards">STANDARDS</a></b>
    204        <a href="https://tools.ietf.org/html/rfc822">RFC 822</a> (ARPA Internet Text Messages)
    205 
    206 <b><a name="see_also">SEE ALSO</a></b>
    207        <a href="local.8.html">local(8)</a>, local delivery agent
    208        <a href="newaliases.1.html">newaliases(1)</a>, create/update alias database
    209        <a href="postalias.1.html">postalias(1)</a>, create/update alias database
    210        <a href="postconf.5.html">postconf(5)</a>, configuration parameters
    211 
    212 <b><a name="readme_files">README FILES</a></b>
    213        <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
    214 
    215 <b><a name="license">LICENSE</a></b>
    216        The Secure Mailer license must be distributed with this software.
    217 
    218 <b>AUTHOR(S)</b>
    219        Wietse Venema
    220        IBM T.J. Watson Research
    221        P.O. Box 704
    222        Yorktown Heights, NY 10598, USA
    223 
    224        Wietse Venema
    225        Google, Inc.
    226        111 8th Avenue
    227        New York, NY 10011, USA
    228 
    229                                                                     ALIASES(5)
    230 </pre> </body> </html>
    231