1ALIASES(5) File Formats Manual ALIASES(5)
2
3
4
6 aliases - Postfix local alias database format
7
9 newaliases
10
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. See local(8) for details of de‐
67 livery to file. Delivery is not limited to regular files. For
68 example, to dispose of unwanted mail, deflect it to /dev/null.
69
70 |command
71 Mail is piped into command. Commands that contain special char‐
72 acters, such as whitespace, should be enclosed between double
73 quotes. See local(8) for details of delivery to command.
74
75 When the command fails, a limited amount of command output is
76 mailed back to the sender. The file /usr/include/sysexits.h de‐
77 fines the expected exit status codes. For example, use "|exit
78 67" to simulate a "user unknown" error, and "|exit 0" to imple‐
79 ment an expensive black hole.
80
81 :include:/file/name
82 Mail is sent to the destinations listed in the named file.
83 Lines in :include: files have the same syntax as the right-hand
84 side of alias entries.
85
86 A destination can be any destination that is described in this
87 manual page. However, delivery to "|command" and /file/name is
88 disallowed by default. To enable, edit the allow_mail_to_com‐
89 mands and allow_mail_to_files configuration parameters.
90
92 When alias database search fails, and the recipient localpart contains
93 the optional recipient delimiter (e.g., user+foo), the search is re‐
94 peated for the unextended address (e.g., user).
95
96 The propagate_unmatched_extensions parameter controls whether an un‐
97 matched address extension (+foo) is propagated to the result of table
98 lookup.
99
101 The local(8) delivery agent always folds the search string to lowercase
102 before database lookup.
103
105 This section describes how the table lookups change when the table is
106 given in the form of regular expressions. For a description of regular
107 expression lookup table syntax, see regexp_table(5) or pcre_table(5).
108 NOTE: these formats do not use ":" at the end of a pattern.
109
110 Each regular expression is applied to the entire search string. Thus, a
111 search string user+foo is not broken up into user and foo.
112
113 Regular expressions are applied in the order as specified in the table,
114 until a regular expression is found that matches the search string.
115
116 Lookup results are the same as with indexed file lookups. For security
117 reasons there is no support for $1, $2 etc. substring interpolation.
118
120 The local(8) delivery agent disallows regular expression substitution
121 of $1 etc. in alias_maps, because that would open a security hole.
122
123 The local(8) delivery agent will silently ignore requests to use the
124 proxymap(8) server within alias_maps. Instead it will open the table
125 directly. Before Postfix version 2.2, the local(8) delivery agent will
126 terminate with a fatal error.
127
129 The following main.cf parameters are especially relevant. The text be‐
130 low provides only a parameter summary. See postconf(5) for more details
131 including examples.
132
133 alias_database (see 'postconf -d' output)
134 The alias databases for local(8) delivery that are updated with
135 "newaliases" or with "sendmail -bi".
136
137 alias_maps (see 'postconf -d' output)
138 The alias databases that are used for local(8) delivery.
139
140 allow_mail_to_commands (alias, forward)
141 Restrict local(8) mail delivery to external commands.
142
143 allow_mail_to_files (alias, forward)
144 Restrict local(8) mail delivery to external files.
145
146 expand_owner_alias (no)
147 When delivering to an alias "aliasname" that has an
148 "owner-aliasname" companion alias, set the envelope sender ad‐
149 dress to the expansion of the "owner-aliasname" alias.
150
151 propagate_unmatched_extensions (canonical, virtual)
152 What address lookup tables copy an address extension from the
153 lookup key to the lookup result.
154
155 owner_request_special (yes)
156 Enable special treatment for owner-listname entries in the
157 aliases(5) file, and don't split owner-listname and listname-re‐
158 quest address localparts when the recipient_delimiter is set to
159 "-".
160
161 recipient_delimiter (empty)
162 The set of characters that can separate an email address local‐
163 part, user name, or a .forward file name from its extension.
164
165 Available in Postfix version 2.3 and later:
166
167 frozen_delivered_to (yes)
168 Update the local(8) delivery agent's idea of the Delivered-To:
169 address (see prepend_delivered_header) only once, at the start
170 of a delivery attempt; do not update the Delivered-To: address
171 while expanding aliases or .forward files.
172
174 RFC 822 (ARPA Internet Text Messages)
175
177 local(8), local delivery agent
178 newaliases(1), create/update alias database
179 postalias(1), create/update alias database
180 postconf(5), configuration parameters
181
183 Use "postconf readme_directory" or "postconf html_directory" to locate
184 this information.
185 DATABASE_README, Postfix lookup table overview
186
188 The Secure Mailer license must be distributed with this software.
189
191 Wietse Venema
192 IBM T.J. Watson Research
193 P.O. Box 704
194 Yorktown Heights, NY 10598, USA
195
196 Wietse Venema
197 Google, Inc.
198 111 8th Avenue
199 New York, NY 10011, USA
200
201
202
203 ALIASES(5)