Home | History | Annotate | Line # | Download | only in conf
generic revision 1.1.1.1.36.1
      1           1.1    tron # GENERIC(5)                                                          GENERIC(5)
      2           1.1    tron # 
      3           1.1    tron # NAME
      4           1.1    tron #        generic - Postfix generic table format
      5           1.1    tron # 
      6           1.1    tron # SYNOPSIS
      7           1.1    tron #        postmap /etc/postfix/generic
      8           1.1    tron # 
      9           1.1    tron #        postmap -q "string" /etc/postfix/generic
     10           1.1    tron # 
     11           1.1    tron #        postmap -q - /etc/postfix/generic <inputfile
     12           1.1    tron # 
     13           1.1    tron # DESCRIPTION
     14           1.1    tron #        The optional generic(5) table specifies an address mapping
     15           1.1    tron #        that applies when mail is delivered. This is the  opposite
     16           1.1    tron #        of  canonical(5)  mapping,  which  applies  when  mail  is
     17           1.1    tron #        received.
     18           1.1    tron # 
     19           1.1    tron #        Typically, one would use the generic(5) table on a  system
     20           1.1    tron #        that  does  not have a valid Internet domain name and that
     21           1.1    tron #        uses  something  like  localdomain.local   instead.    The
     22           1.1    tron #        generic(5)  table  is  then  used by the smtp(8) client to
     23           1.1    tron #        transform local mail addresses into  valid  Internet  mail
     24           1.1    tron #        addresses  when  mail  has to be sent across the Internet.
     25           1.1    tron #        See the EXAMPLE section at the end of this document.
     26           1.1    tron # 
     27           1.1    tron #        The  generic(5)  mapping  affects  both   message   header
     28           1.1    tron #        addresses (i.e. addresses that appear inside messages) and
     29           1.1    tron #        message envelope addresses  (for  example,  the  addresses
     30           1.1    tron #        that are used in SMTP protocol commands).
     31           1.1    tron # 
     32           1.1    tron #        Normally, the generic(5) table is specified as a text file
     33           1.1    tron #        that serves as  input  to  the  postmap(1)  command.   The
     34           1.1    tron #        result,  an  indexed file in dbm or db format, is used for
     35           1.1    tron #        fast searching by the mail  system.  Execute  the  command
     36           1.1    tron #        "postmap  /etc/postfix/generic" to rebuild an indexed file
     37           1.1    tron #        after changing the corresponding text file.
     38           1.1    tron # 
     39           1.1    tron #        When the table is provided via other means  such  as  NIS,
     40           1.1    tron #        LDAP  or  SQL,  the  same lookups are done as for ordinary
     41           1.1    tron #        indexed files.
     42           1.1    tron # 
     43  1.1.1.1.36.1  bouyer #        Alternatively, the  table  can  be  provided  as  a  regu-
     44  1.1.1.1.36.1  bouyer #        lar-expression  map  where  patterns  are given as regular
     45  1.1.1.1.36.1  bouyer #        expressions, or  lookups  can  be  directed  to  TCP-based
     46  1.1.1.1.36.1  bouyer #        server.  In those case, the lookups are done in a slightly
     47  1.1.1.1.36.1  bouyer #        different way as described below under "REGULAR EXPRESSION
     48  1.1.1.1.36.1  bouyer #        TABLES" or "TCP-BASED TABLES".
     49           1.1    tron # 
     50           1.1    tron # CASE FOLDING
     51           1.1    tron #        The  search  string is folded to lowercase before database
     52           1.1    tron #        lookup. As of Postfix 2.3, the search string is  not  case
     53           1.1    tron #        folded  with database types such as regexp: or pcre: whose
     54           1.1    tron #        lookup fields can match both upper and lower case.
     55           1.1    tron # 
     56           1.1    tron # TABLE FORMAT
     57           1.1    tron #        The input format for the postmap(1) command is as follows:
     58           1.1    tron # 
     59           1.1    tron #        pattern result
     60           1.1    tron #               When  pattern matches a mail address, replace it by
     61           1.1    tron #               the corresponding result.
     62           1.1    tron # 
     63           1.1    tron #        blank lines and comments
     64           1.1    tron #               Empty lines and whitespace-only lines are  ignored,
     65           1.1    tron #               as  are  lines whose first non-whitespace character
     66           1.1    tron #               is a `#'.
     67           1.1    tron # 
     68           1.1    tron #        multi-line text
     69           1.1    tron #               A logical line starts with non-whitespace  text.  A
     70           1.1    tron #               line  that starts with whitespace continues a logi-
     71           1.1    tron #               cal line.
     72           1.1    tron # 
     73           1.1    tron # TABLE SEARCH ORDER
     74           1.1    tron #        With lookups from indexed files such as DB or DBM, or from
     75           1.1    tron #        networked  tables  such  as NIS, LDAP or SQL, patterns are
     76           1.1    tron #        tried in the order as listed below:
     77           1.1    tron # 
     78           1.1    tron #        user@domain address
     79           1.1    tron #               Replace user@domain by address. This form  has  the
     80           1.1    tron #               highest precedence.
     81           1.1    tron # 
     82           1.1    tron #        user address
     83           1.1    tron #               Replace  user@site by address when site is equal to
     84           1.1    tron #               $myorigin, when site is listed  in  $mydestination,
     85           1.1    tron #               or   when  it  is  listed  in  $inet_interfaces  or
     86           1.1    tron #               $proxy_interfaces.
     87           1.1    tron # 
     88           1.1    tron #        @domain address
     89           1.1    tron #               Replace other addresses in domain by address.  This
     90           1.1    tron #               form has the lowest precedence.
     91           1.1    tron # 
     92           1.1    tron # RESULT ADDRESS REWRITING
     93           1.1    tron #        The lookup result is subject to address rewriting:
     94           1.1    tron # 
     95           1.1    tron #        o      When  the  result  has  the  form @otherdomain, the
     96           1.1    tron #               result becomes the same user in otherdomain.
     97           1.1    tron # 
     98           1.1    tron #        o      When "append_at_myorigin=yes", append  "@$myorigin"
     99           1.1    tron #               to addresses without "@domain".
    100           1.1    tron # 
    101           1.1    tron #        o      When "append_dot_mydomain=yes", append ".$mydomain"
    102           1.1    tron #               to addresses without ".domain".
    103           1.1    tron # 
    104           1.1    tron # ADDRESS EXTENSION
    105           1.1    tron #        When a mail address localpart contains the optional recip-
    106           1.1    tron #        ient  delimiter  (e.g., user+foo@domain), the lookup order
    107           1.1    tron #        becomes: user+foo@domain, user@domain, user+foo, user, and
    108           1.1    tron #        @domain.
    109           1.1    tron # 
    110           1.1    tron #        The   propagate_unmatched_extensions   parameter  controls
    111           1.1    tron #        whether an unmatched address extension  (+foo)  is  propa-
    112           1.1    tron #        gated to the result of table lookup.
    113           1.1    tron # 
    114           1.1    tron # REGULAR EXPRESSION TABLES
    115           1.1    tron #        This  section  describes how the table lookups change when
    116           1.1    tron #        the table is given in the form of regular expressions. For
    117           1.1    tron #        a  description  of regular expression lookup table syntax,
    118           1.1    tron #        see regexp_table(5) or pcre_table(5).
    119           1.1    tron # 
    120           1.1    tron #        Each pattern is a regular expression that  is  applied  to
    121           1.1    tron #        the entire address being looked up. Thus, user@domain mail
    122           1.1    tron #        addresses are not broken up into their  user  and  @domain
    123           1.1    tron #        constituent parts, nor is user+foo broken up into user and
    124           1.1    tron #        foo.
    125           1.1    tron # 
    126           1.1    tron #        Patterns are applied in the order as specified in the  ta-
    127           1.1    tron #        ble,  until  a  pattern  is  found that matches the search
    128           1.1    tron #        string.
    129           1.1    tron # 
    130           1.1    tron #        Results are the same as with indexed  file  lookups,  with
    131           1.1    tron #        the  additional feature that parenthesized substrings from
    132           1.1    tron #        the pattern can be interpolated as $1, $2 and so on.
    133           1.1    tron # 
    134           1.1    tron # TCP-BASED TABLES
    135           1.1    tron #        This section describes how the table lookups  change  when
    136           1.1    tron #        lookups are directed to a TCP-based server. For a descrip-
    137           1.1    tron #        tion of the TCP client/server lookup protocol, see tcp_ta-
    138           1.1    tron #        ble(5).  This feature is not available up to and including
    139           1.1    tron #        Postfix version 2.4.
    140           1.1    tron # 
    141           1.1    tron #        Each lookup operation uses the entire address once.  Thus,
    142           1.1    tron #        user@domain  mail  addresses  are not broken up into their
    143           1.1    tron #        user and @domain constituent parts, nor is user+foo broken
    144           1.1    tron #        up into user and foo.
    145           1.1    tron # 
    146           1.1    tron #        Results are the same as with indexed file lookups.
    147           1.1    tron # 
    148           1.1    tron # EXAMPLE
    149           1.1    tron #        The  following  shows  a  generic  mapping with an indexed
    150           1.1    tron #        file.  When mail is sent to a remote host via  SMTP,  this
    151           1.1    tron #        replaces  his (a] localdomain.local  by  his ISP mail address,
    152           1.1    tron #        replaces her (a] localdomain.local by her  ISP  mail  address,
    153           1.1    tron #        and  replaces  other  local  addresses by his ISP account,
    154           1.1    tron #        with an address extension of +local (this example  assumes
    155           1.1    tron #        that the ISP supports "+" style address extensions).
    156           1.1    tron # 
    157           1.1    tron #        /etc/postfix/main.cf:
    158           1.1    tron #            smtp_generic_maps = hash:/etc/postfix/generic
    159           1.1    tron # 
    160           1.1    tron #        /etc/postfix/generic:
    161           1.1    tron #            his (a] localdomain.local   hisaccount (a] hisisp.example
    162           1.1    tron #            her (a] localdomain.local   heraccount (a] herisp.example
    163           1.1    tron #            @localdomain.local      hisaccount+local (a] hisisp.example
    164           1.1    tron # 
    165           1.1    tron #        Execute  the  command "postmap /etc/postfix/generic" when-
    166           1.1    tron #        ever the table is changed.  Instead of hash, some  systems
    167           1.1    tron #        use  dbm database files. To find out what tables your sys-
    168           1.1    tron #        tem supports use the command "postconf -m".
    169           1.1    tron # 
    170           1.1    tron # BUGS
    171           1.1    tron #        The table format does not understand quoting  conventions.
    172           1.1    tron # 
    173           1.1    tron # CONFIGURATION PARAMETERS
    174           1.1    tron #        The  following main.cf parameters are especially relevant.
    175           1.1    tron #        The text below provides  only  a  parameter  summary.  See
    176           1.1    tron #        postconf(5) for more details including examples.
    177           1.1    tron # 
    178           1.1    tron #        smtp_generic_maps
    179           1.1    tron #               Address  mapping  lookup  table  for  envelope  and
    180           1.1    tron #               header sender and recipient addresses while  deliv-
    181           1.1    tron #               ering mail via SMTP.
    182           1.1    tron # 
    183           1.1    tron #        propagate_unmatched_extensions
    184           1.1    tron #               A  list  of  address rewriting or forwarding mecha-
    185           1.1    tron #               nisms that propagate an address extension from  the
    186           1.1    tron #               original  address  to  the result.  Specify zero or
    187           1.1    tron #               more  of  canonical,   virtual,   alias,   forward,
    188           1.1    tron #               include, or generic.
    189           1.1    tron # 
    190           1.1    tron #        Other parameters of interest:
    191           1.1    tron # 
    192           1.1    tron #        inet_interfaces
    193           1.1    tron #               The  network  interface  addresses that this system
    194           1.1    tron #               receives mail on.  You need to stop and start Post-
    195           1.1    tron #               fix when this parameter changes.
    196           1.1    tron # 
    197           1.1    tron #        proxy_interfaces
    198           1.1    tron #               Other interfaces that this machine receives mail on
    199           1.1    tron #               by way of a proxy agent or network address transla-
    200           1.1    tron #               tor.
    201           1.1    tron # 
    202           1.1    tron #        mydestination
    203           1.1    tron #               List  of  domains  that  this mail system considers
    204           1.1    tron #               local.
    205           1.1    tron # 
    206           1.1    tron #        myorigin
    207           1.1    tron #               The domain that is appended to locally-posted mail.
    208           1.1    tron # 
    209           1.1    tron #        owner_request_special
    210           1.1    tron #               Give special treatment to owner-xxx and xxx-request
    211           1.1    tron #               addresses.
    212           1.1    tron # 
    213           1.1    tron # SEE ALSO
    214           1.1    tron #        postmap(1), Postfix lookup table manager
    215           1.1    tron #        postconf(5), configuration parameters
    216           1.1    tron #        smtp(8), Postfix SMTP client
    217           1.1    tron # 
    218           1.1    tron # README FILES
    219           1.1    tron #        Use "postconf readme_directory" or  "postconf  html_direc-
    220           1.1    tron #        tory" to locate this information.
    221           1.1    tron #        ADDRESS_REWRITING_README, address rewriting guide
    222           1.1    tron #        DATABASE_README, Postfix lookup table overview
    223           1.1    tron #        STANDARD_CONFIGURATION_README, configuration examples
    224           1.1    tron # 
    225           1.1    tron # LICENSE
    226           1.1    tron #        The  Secure  Mailer  license must be distributed with this
    227           1.1    tron #        software.
    228           1.1    tron # 
    229           1.1    tron # HISTORY
    230           1.1    tron #        A genericstable feature appears in the Sendmail MTA.
    231           1.1    tron # 
    232           1.1    tron #        This feature is available in Postfix 2.2 and later.
    233           1.1    tron # 
    234           1.1    tron # AUTHOR(S)
    235           1.1    tron #        Wietse Venema
    236           1.1    tron #        IBM T.J. Watson Research
    237           1.1    tron #        P.O. Box 704
    238           1.1    tron #        Yorktown Heights, NY 10598, USA
    239           1.1    tron # 
    240  1.1.1.1.36.1  bouyer #        Wietse Venema
    241  1.1.1.1.36.1  bouyer #        Google, Inc.
    242  1.1.1.1.36.1  bouyer #        111 8th Avenue
    243  1.1.1.1.36.1  bouyer #        New York, NY 10011, USA
    244  1.1.1.1.36.1  bouyer # 
    245           1.1    tron #                                                                     GENERIC(5)
    246