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 the main.cf configuration 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 -i is the "add to cart" mode and default is the "start fresh" mode πŸ›’
  • -j β€” JSON output. format the output from -q and -s as 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 (mode 0644). 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 of key: value output 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 -v options 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, named file_name.db. this is available on systems with support for db databases. 🌳
  • cdb β€” the output is one file named file_name.cdb. this is available on systems with support for cdb databases. πŸ“
  • dbm β€” the output consists of two files, named file_name.pag and file_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, named file_name.db. this is available on systems with support for db databases. #️⃣
  • lmdb β€” the output is a btree-based file, named file_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, named file_name.pag and file_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 -v into 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 for local(8) delivery that are updated with "newaliases" or with "sendmail -bi". πŸ—‚οΈ
  • config_directory (see 'postconf -d' output) β€” the default location of the Postfix main.cf and master.cf configuration 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 in newaliases(1), postalias(1) and postmap(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, or name=value environment 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 πŸŽ€


πŸ“š 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