ALIASES(5)
π aliases(5) β the Postfix local alias database format π
okay bestie, welcome to the File Formats Manual section 5, and this one is aliases β the Postfix local alias database format. yes, that alias file. the one you've been editing with your eyes closed. let's actually understand it tho π
β¨ SYNOPSIS β¨
newaliases
postalias -q name [file-type]:[file-name]
πΈ DESCRIPTION πΈ
the optional aliases(5) table β that's alias_maps β redirects mail for local recipients. who processes those redirections? the Postfix local(8) delivery agent, obviously. and here's the thing bestie: this table is always searched with an email address localpart β no domain portion, periodt.
this is not like 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 (domain included). different table, different vibe. iykyk.
normally, the aliases(5) table is specified as a text file that serves as input to the postalias(1) command. the result β an indexed file in dbm or db format β is what the mail system uses for fast lookup. so after you change the Postfix alias database, run the command newaliases to rebuild that indexed file. no cap. π
when the table is provided via other means β think NIS, LDAP or SQL β the same lookups are done as for ordinary indexed files. same energy, different plumbing.
alternatively, the table can be provided as a regular-expression map, where patterns are given as regular expressions. in that case the lookups happen in a slightly different way, described below under "REGULAR EXPRESSION TABLES". π
also: 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. cute, right?
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, and so 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 @. and the name gets folded to lowercase, so that database lookups are case insensitive. slay. β¨
in addition, when an alias exists for owner-name, this will override the envelope sender address, so that delivery diagnostics get 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 send delivery errors to the maintainer of a mailing list, who is in a way better position to deal with mailing list delivery problems than the originator of the undelivered mail. bestie is literally the main character of undelivered mail, the maintainer is the support group π
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. iconic black hole behaviour.|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. every time. no exceptions. lowercase girlie through and through π
π 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. it's one unit, bestie, no splitting.
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. do not do it. not even once.
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. so if you're on something ancient, heads up π
π 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 with"newaliases"or with"sendmail -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)
π«Ά 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
okay that's the whole page, bestie, every single flag and default and warning intact π
and a lil sign-off for you: this was aliases(5) from the File Formats Manual β the Postfix local alias database format page. now go run newaliases and rebuild that indexed file like the main character you are β¨πΈ
π¦ where this page comes from
- fedora 43: postfix 2:3.10.14-1.fc43 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 43: postfix 2:3.10.3-3.fc43 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.14-1.fc44 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.7-2.fc44 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms