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
14 local(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, delivery diagnostics
52 are directed to that address, instead of to the originator of the mes‐
53 sage. This is typically used to direct delivery errors to the main‐
54 tainer of a mailing list, who is in a better position to deal with
55 mailing list delivery problems than the originator of the undelivered
56 mail.
57
58 The value contains one or more of the following:
59
60 address
61 Mail is forwarded to address, which is compatible with the RFC
62 822 standard.
63
64 /file/name
65 Mail is appended to /file/name. See local(8) for details of
66 delivery to file. Delivery is not limited to regular files.
67 For example, to dispose of unwanted mail, deflect it to
68 /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
77 defines 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
94 repeated for the unextended address (e.g., user).
95
96 The propagate_unmatched_extensions parameter controls whether an
97 unmatched 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
130 below provides only a parameter summary. See postconf(5) for more
131 details including examples.
132
133 alias_database
134 List of alias databases that are updated by the newaliases(1)
135 command.
136
137 alias_maps
138 List of alias databases queried by the local(8) delivery agent.
139
140 allow_mail_to_commands
141 Restrict the usage of mail delivery to external command.
142
143 allow_mail_to_files
144 Restrict the usage of mail delivery to external file.
145
146 expand_owner_alias
147 When delivering to an alias that has an owner- companion alias,
148 set the envelope sender address to the right-hand side of the
149 owner alias, instead using of the left-hand side address.
150
151 propagate_unmatched_extensions
152 A list of address rewriting or forwarding mechanisms that propa‐
153 gate an address extension from the original address to the
154 result. Specify zero or more of canonical, virtual, alias, for‐
155 ward, include, or generic.
156
157 owner_request_special
158 Give special treatment to owner-listname and listname-request
159 addresses.
160
161 recipient_delimiter
162 Delimiter that separates recipients from address extensions.
163
164 Available in Postfix version 2.3 and later:
165
166 frozen_delivered_to
167 Update the local(8) delivery agent's Delivered-To: address (see
168 prepend_delivered_header) only once, at the start of a delivery;
169 do not update the Delivered-To: address while expanding aliases
170 or .forward files.
171
173 RFC 822 (ARPA Internet Text Messages)
174
176 local(8), local delivery agent
177 newaliases(1), create/update alias database
178 postalias(1), create/update alias database
179 postconf(5), configuration parameters
180
182 Use "postconf readme_directory" or "postconf html_directory" to locate
183 this information.
184 DATABASE_README, Postfix lookup table overview
185
187 The Secure Mailer license must be distributed with this software.
188
190 Wietse Venema
191 IBM T.J. Watson Research
192 P.O. Box 704
193 Yorktown Heights, NY 10598, USA
194
195
196
197 ALIASES(5)