POSTALIAS(1)
π POSTALIAS β the Postfix alias database glow-up π
okay bestie, so this is postalias(1), a General Commands Manual page (section 1, we love a classic), and it's genuinely the tool you need when you want to make, poke at, or refresh your Postfix alias databases. strap in, we're doing this together π«Ά
β¨ NAME β¨
postalias β Postfix alias database maintenance. that's it, that's the whole vibe. maintenance era π
πΈ SYNOPSIS πΈ
postalias [-Nfijnoprsuvw] [-c config_dir] [-d key] [-q key]
[file_type:]file_name ...
π¦ DESCRIPTION π¦
so like. the postalias(1) command creates or queries one or more Postfix alias databases, or it updates an existing one. that's the whole job and she does it well β¨
the input and output file formats are expected to be compatible with Sendmail version 8, and are also expected to be suitable for use as NIS alias maps. yes, both. iconic of her.
if the result files don't exist yet, they'll be created with the same group and other read permissions as their source file. matching energy, no notes.
while a database update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on the entire database, all so you don't get surprises in spectator processes. very "don't text the group chat while i'm mid-update" of her π
the format of Postfix alias input files is described in aliases(5). go read it, i'll wait π
by default the lookup key is mapped to lowercase to make the lookups case insensitive. but as of Postfix 2.3 this case folding happens only with tables whose lookup keys are fixed-case strings such as btree:, dbm: or hash:. with earlier versions, the lookup key is folded even with tables where a lookup field can match both upper and lower case text, such as regexp: and pcre:. and that β that right there β resulted in loss of information with $number substitutions. so. history lesson over, be glad you're on a modern version bestie.
Options:
π OPTIONS π
-c config_dirβ read themain.cfconfiguration file in the named directory instead of the default configuration directory. basically "you don't live at the default address, i'll come to yours" π-d keyβ search the specified maps for key and remove one entry per map. the exit status is zero when the requested information was found. found it, deleted it, done βοΈ
if a key value of - is specified, the program reads key values from the standard input stream. the exit status is zero when at least one of the requested keys was found.
-fβ do not fold the lookup key to lower case while creating or querying a table. she said preserve the casing, she said periodt π―
with Postfix version 2.3 and later, this option has no effect for regular expression tables. there, case folding is controlled by appending a flag to a pattern. so yeah, different rulebook for those π
-iβ incremental mode. read entries from standard input and do not truncate an existing database. by default,postalias(1)creates a new database from the entries in file_name. so-iis the "add to cart" mode and default is the "start fresh" mode π-jβ JSON output. format the output from-qand-sas one{"key": "value"}object per line. so clean, so structured, so slay β¨
this feature is available in Postfix version 3.11 and later. don't come for her if you're on an old build π
-Nβ include the terminating null character that terminates lookup keys and values. by default,postalias(1)does whatever is the default for the host operating system. yes, host OS gets to decide, main character behavior honestly π-nβ don't include the terminating null character that terminates lookup keys and values. by default,postalias(1)does whatever is the default for the host operating system. (the opposite twin of-N, they're both valid, we don't pick favorites) π«Ά-oβ do not release root privileges when processing a non-root input file. by default,postalias(1)drops root privileges and runs as the source file owner instead. safety queen π-pβ do not inherit the file access permissions from the input file when creating a new file. instead, create a new file with default access permissions (mode0644). fresh start, fresh permissions π§-q keyβ search the specified maps for key and write the first value found to the standard output stream. the exit status is zero when the requested information was found. no cap, just answers π
note: this performs a single query with the key as specified, and does not make iterative queries with substrings of the key as described in the aliases(5) manual page. so don't expect her to go digging recursively, that's not what she signed up for π«
if a key value of - is specified, the program reads key values from the standard input stream and writes one line of key: value output for each key that was found. the exit status is zero when at least one of the requested keys was found.
-rβ when updating a table, do not complain about attempts to update existing entries, and make those updates anyway. bold. decisive. she's doing it regardless πͺ-sβ retrieve all database elements, and write one line ofkey: valueoutput for each element. the elements are printed in database order, which is not necessarily the same as the original input order. so if you're like "wait why is this shuffled"β that's why bestie π
this feature is available in Postfix version 2.2 and later, and is not available for all database types. check your table type before you get your hopes up π
-uβ disable UTF-8 support. UTF-8 support is enabled by default when"smtputf8_enable = yes". it requires that keys and values are valid UTF-8 strings. valid strings only, no chaos allowed β¨-vβ enable verbose logging for debugging purposes. multiple-voptions make the software increasingly verbose. stack them like it's a combo and watch her spill β¨β¨β¨-wβ when updating a table, do not complain about attempts to update existing entries, and ignore those attempts. the chill, unbothered sibling of-rπ§
π ARGUMENTS π
file_type
the database type. to find out what types are supported, use the "postconf -m" command. that's your menu, go order π
when no file_type is specified, the software uses the database type specified via the default_database_type configuration parameter. the default value for this parameter depends on the host environment.
the postalias(1) command can query any supported file type, but it can create only the following file types. so querying is "anyone can come to the party" and creating is "VIP list only" ποΈ
btreeβ the output is a btree file, namedfile_name.db. this is available on systems with support for db databases. π³cdbβ the output is one file namedfile_name.cdb. this is available on systems with support for cdb databases. πdbmβ the output consists of two files, namedfile_name.pagandfile_name.dir. this is available on systems with support for dbm databases. two files, a duo, a dynamic duo π«failβ a table that reliably fails all requests. the lookup table name is used for logging only. this table exists to simplify Postfix error tests. she fails on purpose and she's so good at it πhashβ the output is a hashed file, namedfile_name.db. this is available on systems with support for db databases. #οΈβ£lmdbβ the output is a btree-based file, namedfile_name.lmdb. lmdb supports concurrent writes and reads from different processes, unlike other supported file-based tables. this is available on systems with support for lmdb databases. multi-process, no gatekeeping, we stan π₯sdbmβ the output consists of two files, namedfile_name.pagandfile_name.dir. this is available on systems with support for sdbm databases. another duo besties π
file_name
the name of the alias database source file when creating a database. that's your input, name her well π
π DIAGNOSTICS π
problems are logged to the standard error stream and to syslogd(8) or postlogd(8). no output means that no problems were detected. silence is golden, silence is a good sign β¨
duplicate entries are skipped and are flagged with a warning. not deleted, not merged, just skipped with a warning, that's the whole protocol π
postalias(1) terminates with zero exit status in case of success (including successful "postalias -q" lookup) and terminates with non-zero exit status in case of failure. zero = slay, non-zero = something's up π
π§ ENVIRONMENT π§
MAIL_CONFIGβ directory with Postfix configuration files. tell her where the files live π‘MAIL_VERBOSEβ enable verbose logging for debugging purposes. the env var version of screaming-vinto the void π£
π CONFIGURATION PARAMETERS π
the following main.cf parameters are especially relevant to this program. yes, especially. she has favorites and we respect it π
the text below provides only a parameter summary. see postconf(5) for more details including examples. summary girlies, go read the full version if you want the lore π
alias_database(see'postconf -d'output) β the alias databases forlocal(8)delivery that are updated with"newaliases"or with"sendmail -bi". ποΈconfig_directory(see'postconf -d'output) β the default location of the Postfixmain.cfandmaster.cfconfiguration files. πberkeley_db_create_buffer_size(16777216) β the per-table I/O buffer size for programs that create Berkeley DB hash or btree tables. big number, big energy π’berkeley_db_read_buffer_size(131072) β the per-table I/O buffer size for programs that read Berkeley DB hash or btree tables. smaller number, still doing her thing πdefault_database_type(see'postconf -d'output) β the default database type for use innewaliases(1),postalias(1)andpostmap(1)commands. the fallback bestie πimport_environment(see'postconf -d'output) β the list of environment variables that a privileged Postfix process will import from a non-Postfix parent process, orname=valueenvironment overrides. πͺsmtputf8_enable(yes) β enable preliminary SMTPUTF8 support for the protocols described in RFC 6531, RFC 6532, and RFC 6533. πsyslog_facility(mail) β the syslog facility of Postfix logging. πsyslog_name(see'postconf -d'output) β a prefix that is prepended to the process name in syslog records, so that, for example,"smtpd"becomes"prefix/smtpd". name tag energy π·οΈ
available in Postfix 2.11 and later:
lmdb_map_size(16777216) β the initial OpenLDAP LMDB database size limit in bytes. π
β STANDARDS β
- RFC 822 (ARPA Internet Text Messages)
π SEE ALSO π
aliases(5), format of alias database input file.local(8), Postfix local delivery agent.postconf(1), supported database typespostconf(5), configuration parameterspostmap(1), create/update/query lookup tablesnewaliases(1), Sendmail compatibility interface.postlogd(8), Postfix loggingsyslogd(8), system logging
π 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. non-negotiable, she said it herself π
π«Ά 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
and that's the whole page bestie π it lives in the General Commands Manual, section 1, under the name postalias(1) β shoutout to the legend Wietse Venema for writing her, we're obsessed, bye πβ¨π¦
π¦ 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 on : a language model's rewrite of the original, under its terms