ALIASES(5)
๐ ALIASES(5) โ Postfix local alias database format โจ
omg hiii bestie ๐ซถ welcome to ALIASES(5), live from the File Formats Manual ๐. This is the Postfix local alias database format, and it's lowkey iconic. No cap, we're gonna go through every flag, file, parameter, and warning together. Periodt. ๐
๐ธ NAME ๐ธ
aliases โ Postfix local alias database format. That's the whole vibe: alias database, but make it Postfix local. ๐
โจ SYNOPSIS โจ
newaliases
postalias -q name [file-type]:[file-name]
๐ DESCRIPTION ๐
The optional aliases(5) table (alias_maps) redirects mail for local recipients. The redirections are processed by the Postfix local(8) delivery agent. This table is always searched with an email address localpart (no domain portion). ๐
This is unlike virtual(5) aliasing (virtual_alias_maps) which applies to all recipients: local(8), virtual, and remote, and which is implemented by the cleanup(8) daemon. That table is often searched with a full email address (including domain). ๐
Normally, the aliases(5) table is specified as a text file that serves as input to the postalias(1) command to create an indexed file for fast lookup. The location of this file is system-dependent. This text will use /path/to/aliases. ๐
Execute the command newaliases to rebuild the indexed file after changing the text file. Execute postalias -q name /path/to/aliases to query a default-type indexed file, or execute postalias -q name type:/path/to/aliases to specify an explicit type. ๐ ๏ธ
The default indexed file type is configured with the default_database_type parameter. Depending on the platform this may be one of lmdb:, cdb:, hash:, or dbm: (without the trailing :). ๐พ
When the table is provided via other means such as NIS, LDAP or SQL, the same lookups are done as for ordinary indexed files. Managing such databases is outside the scope of Postfix. ๐๏ธ
Alternatively, the table can be provided as a regular-expression map where patterns are given as regular expressions. In this case, the lookups are done in a slightly different way as described below under "REGULAR EXPRESSION TABLES". ๐ง
Users can control delivery of their own mail by setting up .forward files in their home directory. Lines in per-user .forward files have the same syntax as the right-hand side of aliases(5) entries. ๐
The format of the alias database input file is as follows:
- An alias definition has the form:
name: value1, value2, ...
- Empty lines and whitespace-only lines are ignored, as are lines whose first non-whitespace character is a
#. - A logical line starts with non-whitespace text. A line that starts with whitespace continues a logical line.
The name is a local address (no domain part). Use double quotes when the name contains any special characters such as whitespace, #, :, or @. The name is folded to lowercase, in order to make database lookups case insensitive. ๐ก
In addition, when an alias exists for owner-name, this will override the envelope sender address, so that delivery diagnostics are directed to owner-name, instead of the originator of the message (for details, see owner_request_special, expand_owner_alias and reset_owner_alias). This is typically used to direct delivery errors to the maintainer of a mailing list, who is in a better position to deal with mailing list delivery problems than the originator of the undelivered mail. ๐ฌ
The value contains one or more of the following:
addressโ Mail is forwarded toaddress, which is compatible with the RFC 822 standard. ๐จ/file/nameโ Mail is appended to/file/name. For details on how a file is written see the sections "EXTERNAL FILE DELIVERY" and "DELIVERY RIGHTS" in thelocal(8)documentation. Delivery is not limited to regular files. For example, to dispose of unwanted mail, deflect it to/dev/null. ๐๏ธ|commandโ Mail is piped intocommand. Commands that contain special characters, such as whitespace, should be enclosed between double quotes. For details on how a command is executed see "EXTERNAL COMMAND DELIVERY" and "DELIVERY RIGHTS" in thelocal(8)documentation. โก
When the command fails, a limited amount of command output is mailed back to the sender. The file /usr/include/sysexits.h defines the expected exit status codes. For example, use "|exit 67" to simulate a "user unknown" error, and "|exit 0" to implement an expensive black hole. ๐ณ๏ธ
:include:/file/nameโ Mail is sent to the destinations listed in the named file. Lines in:include:files have the same syntax as the right-hand side ofaliases(5)entries. ๐
A destination can be any destination that is described in this manual page. However, delivery to "|command" and /file/name is disallowed by default. To enable, edit the allow_mail_to_commands and allow_mail_to_files configuration parameters. ๐
๐ฆ ADDRESS EXTENSION ๐ฆ
When alias database search fails, and the recipient localpart contains the optional recipient delimiter (e.g., user+foo), the search is repeated for the unextended address (e.g., user). ๐
The propagate_unmatched_extensions parameter controls whether an unmatched address extension (+foo) is propagated to the result of table lookup. ๐ช
๐ CASE FOLDING ๐
The local(8) delivery agent always folds the search string to lowercase before database lookup. lowercase era, honestly. ๐
๐ง REGULAR EXPRESSION TABLES ๐ง
This section describes how the table lookups change when the table is given in the form of regular expressions. For a description of regular expression lookup table syntax, see regexp_table(5) or pcre_table(5). NOTE: these formats do not use : at the end of a pattern. ๐งฉ
Each regular expression is applied to the entire search string. Thus, a search string user+foo is not broken up into user and foo. ๐ฏ
Regular expressions are applied in the order as specified in the table, until a regular expression is found that matches the search string. ๐
Lookup results are the same as with indexed file lookups. For security reasons there is no support for $1, $2 etc. substring interpolation. ๐
๐ก๏ธ SECURITY ๐ก๏ธ
The local(8) delivery agent disallows regular expression substitution of $1 etc. in alias_maps, because that would open a security hole. ๐จ
The local(8) delivery agent will silently ignore requests to use the proxymap(8) server within alias_maps. Instead it will open the table directly. Before Postfix version 2.2, the local(8) delivery agent will terminate with a fatal error. ๐
โ๏ธ CONFIGURATION PARAMETERS โ๏ธ
The following main.cf parameters are especially relevant. The text below provides only a parameter summary. See postconf(5) for more details including examples. ๐ ๏ธ
alias_database(see 'postconf -d' output) โ The alias databases forlocal(8)delivery that are updated withnewaliasesor withsendmail -bi. ๐๏ธalias_maps(see 'postconf -d' output) โ Optional lookup tables that are searched only with an email address localpart (no domain) and that apply only tolocal(8)recipients; this is unlikevirtual_alias_mapsthat are often searched with a full email address (including domain) and that apply to all recipients:local(8), virtual, and remote. ๐ฌallow_mail_to_commands(alias, forward) โ Restrictlocal(8)mail delivery to external commands. ๐ฆallow_mail_to_files(alias, forward) โ Restrictlocal(8)mail delivery to external files. ๐expand_owner_alias(no) โ When delivering to an alias"aliasname"that has an"owner-aliasname"companion alias, set the envelope sender address to the expansion of the"owner-aliasname"alias. ๐propagate_unmatched_extensions(canonical, virtual) โ What address lookup tables copy an address extension from the lookup key to the lookup result. ๐ชowner_request_special(yes) โ Enable special treatment forowner-listnameentries in thealiases(5)file, and don't splitowner-listnameandlistname-requestaddress localparts when therecipient_delimiteris set to-. ๐recipient_delimiter(empty) โ The set of characters that can separate an email address localpart, user name, or a.forwardfile name from its extension. โ๏ธ
Available in Postfix version 2.3 and later:
frozen_delivered_to(yes) โ Update thelocal(8)delivery agent's idea of theDelivered-To:address (seeprepend_delivered_header) only once, at the start of a delivery attempt; do not update theDelivered-To:address while expanding aliases or.forwardfiles. ๐ง
๐ STANDARDS ๐
RFC 822 (ARPA Internet Text Messages) โ that's the standard, bestie. ๐ฌ
๐ SEE ALSO ๐
local(8), local delivery agentnewaliases(1), create/update alias databasepostalias(1), create/update alias databasepostconf(5), configuration parameters
๐ README FILES ๐
Use postconf readme_directory or postconf html_directory to locate this information. ๐๏ธ
DATABASE_README, Postfix lookup table overview
๐ชช LICENSE ๐ชช
The Secure Mailer license must be distributed with this software. ๐
๐ AUTHOR(S) ๐
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA
Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA
xoxo, ALIASES(5) from the File Formats Manual ๐๐
๐ซถ
๐ฆ where this page comes from
- alpine 3.24: postfix-doc 3.11.7-r0 ยท IPL-1.0 EPL-2.0
- arch rolling: postfix 3.11.7-1 ยท EPL-2.0 OR IPL-1.0 AND BSD-4-Clause-UC
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- ubuntu stonking: postfix 3.11.7-1ubuntu2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms