1ALIASES(5)                    File Formats Manual                   ALIASES(5)
2
3
4

NAME

6       aliases - Postfix local alias database format
7

SYNOPSIS

9       newaliases
10

DESCRIPTION

12       The  aliases(5) table provides a system-wide mechanism to redirect mail
13       for local recipients. The redirections are processed by the Postfix lo‐
14       cal(8) delivery agent.
15
16       Normally,  the aliases(5) table is specified as a text file that serves
17       as input to the postalias(1) command. The result, an  indexed  file  in
18       dbm  or  db format, is used for fast lookup by the mail system. Execute
19       the command newaliases in order  to  rebuild  the  indexed  file  after
20       changing the Postfix alias database.
21
22       When  the  table  is provided via other means such as NIS, LDAP or SQL,
23       the same lookups are done as for ordinary indexed files.
24
25       Alternatively, the table can be provided as  a  regular-expression  map
26       where  patterns  are  given  as  regular expressions. In this case, the
27       lookups are done in a slightly different way as described  below  under
28       "REGULAR EXPRESSION TABLES".
29
30       Users  can  control  delivery  of their own mail by setting up .forward
31       files in their home directory.  Lines in per-user .forward  files  have
32       the same syntax as the right-hand side of aliases(5) entries.
33
34       The format of the alias database input file is as follows:
35
36       •      An alias definition has the form
37
38                   name: value1, value2, ...
39
40       •      Empty  lines and whitespace-only lines are ignored, as are lines
41              whose first non-whitespace character is a `#'.
42
43       •      A logical line starts with  non-whitespace  text.  A  line  that
44              starts with whitespace continues a logical line.
45
46       The  name  is a local address (no domain part).  Use double quotes when
47       the name contains any special characters such as whitespace, `#',  `:',
48       or  `@'.  The  name  is  folded to lowercase, in order to make database
49       lookups case insensitive.
50
51       In addition, when an alias exists for owner-name,  this  will  override
52       the  envelope sender address, so that delivery diagnostics are directed
53       to owner-name, instead of the originator of the message  (for  details,
54       see  owner_request_special,  expand_owner_alias and reset_owner_alias).
55       This is typically used to direct delivery errors to the maintainer of a
56       mailing list, who is in a better position to deal with mailing list de‐
57       livery problems than the originator of the undelivered mail.
58
59       The value contains one or more of the following:
60
61       address
62              Mail is forwarded to address, which is compatible with  the  RFC
63              822 standard.
64
65       /file/name
66              Mail  is  appended  to  /file/name. For details on how a file is
67              written see the sections "EXTERNAL FILE DELIVERY" and  "DELIVERY
68              RIGHTS"  in the local(8) documentation.  Delivery is not limited
69              to regular files.  For example, to dispose of unwanted mail, de‐
70              flect it to /dev/null.
71
72       |command
73              Mail  is piped into command. Commands that contain special char‐
74              acters, such as whitespace, should be  enclosed  between  double
75              quotes.  For  details on how a command is executed see "EXTERNAL
76              COMMAND DELIVERY" and "DELIVERY RIGHTS" in the local(8) documen‐
77              tation.
78
79              When  the  command  fails, a limited amount of command output is
80              mailed back to the sender.  The file /usr/include/sysexits.h de‐
81              fines  the  expected  exit status codes. For example, use "|exit
82              67" to simulate a "user unknown" error, and "|exit 0" to  imple‐
83              ment an expensive black hole.
84
85       :include:/file/name
86              Mail  is  sent  to  the  destinations  listed in the named file.
87              Lines in :include: files have the same syntax as the  right-hand
88              side of alias entries.
89
90              A  destination  can be any destination that is described in this
91              manual page. However, delivery to "|command" and  /file/name  is
92              disallowed  by  default.  To enable, edit the allow_mail_to_com‐
93              mands and allow_mail_to_files configuration parameters.
94

ADDRESS EXTENSION

96       When alias database search fails, and the recipient localpart  contains
97       the  optional  recipient  delimiter (e.g., user+foo), the search is re‐
98       peated for the unextended address (e.g., user).
99
100       The propagate_unmatched_extensions parameter controls  whether  an  un‐
101       matched  address  extension (+foo) is propagated to the result of table
102       lookup.
103

CASE FOLDING

105       The local(8) delivery agent always folds the search string to lowercase
106       before database lookup.
107

REGULAR EXPRESSION TABLES

109       This  section  describes how the table lookups change when the table is
110       given in the form of regular expressions. For a description of  regular
111       expression  lookup  table syntax, see regexp_table(5) or pcre_table(5).
112       NOTE: these formats do not use ":" at the end of a pattern.
113
114       Each regular expression is applied to the entire search string. Thus, a
115       search string user+foo is not broken up into user and foo.
116
117       Regular expressions are applied in the order as specified in the table,
118       until a regular expression is found that matches the search string.
119
120       Lookup results are the same as with indexed file lookups.  For security
121       reasons there is no support for $1, $2 etc. substring interpolation.
122

SECURITY

124       The  local(8)  delivery agent disallows regular expression substitution
125       of $1 etc. in alias_maps, because that would open a security hole.
126
127       The local(8) delivery agent will silently ignore requests  to  use  the
128       proxymap(8)  server  within  alias_maps. Instead it will open the table
129       directly.  Before Postfix version 2.2, the local(8) delivery agent will
130       terminate with a fatal error.
131

CONFIGURATION PARAMETERS

133       The following main.cf parameters are especially relevant.  The text be‐
134       low provides only a parameter summary. See postconf(5) for more details
135       including examples.
136
137       alias_database (see 'postconf -d' output)
138              The  alias databases for local(8) delivery that are updated with
139              "newaliases" or with "sendmail -bi".
140
141       alias_maps (see 'postconf -d' output)
142              The alias databases that are used for local(8) delivery.
143
144       allow_mail_to_commands (alias, forward)
145              Restrict local(8) mail delivery to external commands.
146
147       allow_mail_to_files (alias, forward)
148              Restrict local(8) mail delivery to external files.
149
150       expand_owner_alias (no)
151              When  delivering  to  an   alias   "aliasname"   that   has   an
152              "owner-aliasname"  companion  alias, set the envelope sender ad‐
153              dress to the expansion of the "owner-aliasname" alias.
154
155       propagate_unmatched_extensions (canonical, virtual)
156              What address lookup tables copy an address  extension  from  the
157              lookup key to the lookup result.
158
159       owner_request_special (yes)
160              Enable  special  treatment  for  owner-listname  entries  in the
161              aliases(5) file, and don't split owner-listname and listname-re‐
162              quest  address localparts when the recipient_delimiter is set to
163              "-".
164
165       recipient_delimiter (empty)
166              The set of characters that can separate an email address  local‐
167              part, user name, or a .forward file name from its extension.
168
169       Available in Postfix version 2.3 and later:
170
171       frozen_delivered_to (yes)
172              Update  the  local(8) delivery agent's idea of the Delivered-To:
173              address (see prepend_delivered_header) only once, at  the  start
174              of  a  delivery attempt; do not update the Delivered-To: address
175              while expanding aliases or .forward files.
176

STANDARDS

178       RFC 822 (ARPA Internet Text Messages)
179

SEE ALSO

181       local(8), local delivery agent
182       newaliases(1), create/update alias database
183       postalias(1), create/update alias database
184       postconf(5), configuration parameters
185

README FILES

187       Use "postconf readme_directory" or "postconf html_directory" to  locate
188       this information.
189       DATABASE_README, Postfix lookup table overview
190

LICENSE

192       The Secure Mailer license must be distributed with this software.
193

AUTHOR(S)

195       Wietse Venema
196       IBM T.J. Watson Research
197       P.O. Box 704
198       Yorktown Heights, NY 10598, USA
199
200       Wietse Venema
201       Google, Inc.
202       111 8th Avenue
203       New York, NY 10011, USA
204
205
206
207                                                                    ALIASES(5)
Impressum