TRIVIAL-REWRITE(8)

πŸ“¦
version 3.11.7 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ TRIVIAL-REWRITE(8) ✨

okay bestie, gather round, because we're talking about trivial-rewrite, the Postfix address rewriting and resolving daemon πŸ’… she lives in the System Manager's Manual section of the Unix manual, section 8, and she is so much cooler than her name makes her sound. no cap.


🌸 NAME 🌸

trivial-rewrite β€” the Postfix address rewriting and resolving daemon. she rewrites addresses, she resolves addresses, she does it all. main character energy fr.


πŸ¦‹ SYNOPSIS πŸ¦‹

trivial-rewrite [generic Postfix daemon options]

that's it. that's the whole vibe. you hand her the generic Postfix daemon options and she handles the rest 🫢


πŸ’– DESCRIPTION πŸ’–

so the trivial-rewrite(8) daemon processes three types of client service requests. three. a little trio. iconic honestly:

  • rewrite context address β€” rewrite an address into standard form
  • resolve sender address β€” resolve the address into a quadruple
  • verify sender address β€” resolve the address for address verification purposes

let's break each one down, bestie, because they all hit different:

rewrite context address

Rewrite an address to standard form, according to the address rewriting context. and the contexts are:

  • local β€” Append the domain names specified with $myorigin or $mydomain to incomplete addresses. Also do swap_bangpath and allow_percent_hack processing as described below, and strip source routed addresses (@site,@site:user@domain) down to user@domain form. πŸ’…
  • remote β€” Append the domain name specified with $remote_header_rewrite_domain to incomplete addresses. Otherwise the result is identical to that of the local address rewriting context. The whole point of this one is to prevent Postfix from appending the local domain to spam from poorly written remote clients πŸ™ˆ yes bestie, it's a whole anti-spam moment.

resolve sender address

Resolve the address to a (transport, nexthop, recipient, flags) quadruple. yes, four things. a little quad squad. the meaning of the results goes like this:

  • transport β€” The delivery agent to use. This is the first field of an entry in the master.cf file. πŸ‘‘
  • nexthop β€” The host to send to and optional delivery method information.
  • recipient β€” The envelope recipient address that is passed on to nexthop.
  • flags β€” The address class, whether the address requires relaying, whether the address has problems, and whether the request failed. so basically the whole status report πŸ’€

verify sender address

Resolve the address for address verification purposes. short, sweet, to the point. periodt.


πŸŽ€ SERVER PROCESS MANAGEMENT πŸŽ€

okay so here's how the server side works:

The trivial-rewrite(8) servers run under control by the Postfix master(8) server. Each server can handle multiple simultaneous connections at once β€” she's a multitasker, we love that for her πŸ’–

When all servers are busy while a client connects, the master creates a new server process β€” but only provided that the trivial-rewrite server process limit is not exceeded. there's a limit bestie, don't push her.

Each trivial-rewrite server terminates after serving at least $max_use clients, or after $max_idle seconds of idle time. so she clocks out either way 🌈


⭐ STANDARDS ⭐

None. The command does not interact with the outside world. she's an introvert. she stays home. respect it 🫢


πŸ”’ SECURITY πŸ”’

The trivial-rewrite(8) daemon is not security sensitive. By default, this daemon does not talk to remote or local users. and here's the slay part: it can run at a fixed low privilege in a chrooted environment. safe, contained, unbothered πŸ’…


πŸ’€ DIAGNOSTICS πŸ’€

Problems and transactions are logged to syslogd(8) or postlogd(8). so if something's weird, check the logs, bestie, the receipts are right there.


🧚 CONFIGURATION PARAMETERS 🧚

heads up: on busy mail systems, a long time may pass before a main.cf change affecting trivial-rewrite(8) is picked up. use the command postfix reload to speed up a change. you're welcome. 🫢

The text below provides only a parameter summary. See postconf(5) for more details including examples.


COMPATIBILITY CONTROLS

  • resolve_dequoted_address (yes) β€” Resolve a recipient address safely instead of correctly, by looking inside quotes. yes bestie, "safely instead of correctly" is the actual vibe of this option, I don't make the rules.

Available with Postfix version 2.1 and later:

  • resolve_null_domain (no) β€” Resolve an address that ends in the "@" null domain as if the local hostname were specified, instead of rejecting the address as invalid.

Available with Postfix version 2.3 and later:

  • resolve_numeric_domain (no) β€” Resolve "user@ipaddress" as "user@[ipaddress]", instead of rejecting the address as invalid.

Available with Postfix version 2.5 and later:

  • allow_min_user (no) β€” Allow a sender or recipient address to have - as the first character. yes really, just the hyphen. living dangerously.

ADDRESS REWRITING CONTROLS

  • myorigin ($myhostname) β€” The domain name that locally-posted mail appears to come from, and that locally posted mail is delivered to.
  • allow_percent_hack (yes) β€” Enable the rewriting of the form "user%domain" to "user@domain".
  • append_at_myorigin (yes) β€” With locally submitted mail, append the string "@$myorigin" to mail addresses without domain information.
  • append_dot_mydomain (Postfix >= 3.0: no, Postfix < 3.0: yes) β€” With locally submitted mail, append the string ".$mydomain" to addresses that have no ".domain" information.
  • recipient_delimiter (empty) β€” The set of characters that can separate an email address localpart, user name, or a .forward file name from its extension.
  • swap_bangpath (yes) β€” Enable the rewriting of "site!user" into "user@site".

Available in Postfix 2.2 and later:

  • remote_header_rewrite_domain (empty) β€” Rewrite or add message headers in mail from remote clients if the remote_header_rewrite_domain parameter value is non-empty, updating incomplete addresses with the domain specified in the remote_header_rewrite_domain parameter, and adding missing headers.

ROUTING CONTROLS

The following is applicable to Postfix version 2.0 and later. Earlier versions do not have support for: virtual_transport, relay_transport, virtual_alias_domains, virtual_mailbox_domains or proxy_interfaces. so if you're on something ancient, bestie, this section is not for you 😭

  • local_transport (local:$myhostname) β€” The default mail delivery transport and next-hop destination for final delivery to domains listed with mydestination, and for [ipaddress] destinations that match $inet_interfaces or $proxy_interfaces.
  • virtual_transport (virtual) β€” The default mail delivery transport and next-hop destination for final delivery to domains listed with $virtual_mailbox_domains.
  • relay_transport (relay) β€” The default mail delivery transport and next-hop destination for the relay domain address class: recipient domains that match $relay_domains.
  • default_transport (smtp) β€” The default mail delivery transport and next-hop destination for the default domain class: recipient domains that do not match $mydestination, $inet_interfaces, $proxy_interfaces, $virtual_alias_domains, $virtual_mailbox_domains, or $relay_domains.
  • parent_domain_matches_subdomains (see 'postconf -d' output) β€” A list of Postfix features where the pattern "example.com" also matches subdomains of example.com, instead of requiring an explicit ".example.com" pattern.
  • relayhost (empty) β€” The next-hop destination(s) for non-local mail; takes precedence over non-local domains in recipient addresses.
  • transport_maps (empty) β€” Optional lookup tables with mappings from recipient address to (message delivery transport, next-hop destination).

Available in Postfix version 2.3 and later:

  • sender_dependent_relayhost_maps (empty) β€” A sender-dependent override for the global relayhost parameter setting.

Available in Postfix version 2.5 and later:

  • empty_address_relayhost_maps_lookup_key (<>) β€” The sender_dependent_relayhost_maps search string that will be used instead of the null sender address.

Available in Postfix version 2.7 and later:

  • empty_address_default_transport_maps_lookup_key (<>) β€” The sender_dependent_default_transport_maps search string that will be used instead of the null sender address.
  • sender_dependent_default_transport_maps (empty) β€” A sender-dependent override for the global default_transport parameter setting.

ADDRESS VERIFICATION CONTROLS

Postfix version 2.1 introduces sender and recipient address verification. This feature is implemented by sending probe email messages that are not actually delivered πŸ‘€ (yes, she's sending fake mail to check if the real mail would work, it's giving undercover).

By default, address verification probes use the same route as regular mail. To override specific aspects of message routing for address verification probes, specify one or more of the following:

  • address_verify_local_transport ($local_transport) β€” Overrides the local_transport parameter setting for address verification probes.
  • address_verify_virtual_transport ($virtual_transport) β€” Overrides the virtual_transport parameter setting for address verification probes.
  • address_verify_relay_transport ($relay_transport) β€” Overrides the relay_transport parameter setting for address verification probes.
  • address_verify_default_transport ($default_transport) β€” Overrides the default_transport parameter setting for address verification probes.
  • address_verify_relayhost ($relayhost) β€” Overrides the relayhost parameter setting for address verification probes.
  • address_verify_transport_maps ($transport_maps) β€” Overrides the transport_maps parameter setting for address verification probes.

Available in Postfix version 2.3 and later:

  • address_verify_sender_dependent_relayhost_maps ($sender_dependent_relayhost_maps) β€” Overrides the sender_dependent_relayhost_maps parameter setting for address verification probes.

Available in Postfix version 2.7 and later:

  • address_verify_sender_dependent_default_transport_maps ($sender_dependent_default_transport_maps) β€” Overrides the sender_dependent_default_transport_maps parameter setting for address verification probes.

✨ MISCELLANEOUS CONTROLS ✨

okay bestie, this is the grab-bag section where all the random-but-important knobs live. let's get into it. πŸ’…

  • config_directory (see postconf -d output) β€” the default location of the Postfix main.cf and master.cf configuration files. lowkey essential, fr.
  • daemon_timeout (18000s) β€” how much time a Postfix daemon process may take to handle a request before it is terminated by a built-in watchdog timer. so if it's taking too long, the watchdog says "not today" and ends it. 😀
  • empty_address_recipient (MAILER-DAEMON) β€” the recipient of mail addressed to the null address. yes, even the void gets a forwarding address. πŸ’€
  • ipc_timeout (3600s) β€” the time limit for sending or receiving information over an internal communication channel. basically the patience timer for internal chats. ⏳
  • max_idle (100s) β€” the maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily. it's like, "i'll wait 100 seconds, but then i'm out." πŸšͺ
  • max_use (100) β€” the maximal number of incoming connections that a Postfix daemon process will service before terminating voluntarily. so after 100 connections, it dips. iconic exit strategy. πŸ‘‹
  • relocated_maps (empty) β€” optional lookup tables with new contact information for users or domains that no longer exist. it's the "i moved, here's my new address" table. πŸƒβ€β™€οΈ
  • process_id (read-only) β€” the process ID of a Postfix command or daemon process. you can look but you can't touch. πŸ”’
  • process_name (read-only) β€” the process name of a Postfix command or daemon process. also read-only, so just admire it. ✨
  • queue_directory (see postconf -d output) β€” the location of the Postfix top-level queue directory. where all the mail waits its turn. πŸ“¬
  • show_user_unknown_table_name (yes) β€” display the name of the recipient table in the "User unknown" responses. so when someone doesn't exist, you get the receipts. 🧾
  • syslog_facility (mail) β€” the syslog facility of Postfix logging. it's giving "mail" energy in your syslogs. πŸ“
  • 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". it's like a last name for your process in the logs. 🏷️

Available in Postfix version 2.0 and later:

  • helpful_warnings (yes) β€” log warnings about problematic configuration settings, and provide helpful suggestions. it's like a bestie who tells you your outfit is cute but your config is a mess. πŸ‘€

Available in Postfix 3.3 and later:

  • service_name (read-only) β€” the master.cf service name of a Postfix daemon process. another read-only flex. πŸ’…

πŸ‘€ SEE ALSO πŸ‘€


πŸ“š README FILES πŸ“š

Use "postconf readme_directory" or "postconf html_directory" to locate this information.

  • ADDRESS_CLASS_README, Postfix address classes howto
  • ADDRESS_VERIFICATION_README, Postfix address verification

πŸ“œ LICENSE πŸ“œ

The Secure Mailer license must be distributed with this software. periodt. πŸ’―


πŸ‘‘ 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 a wrap on this page! the footer says it's TRIVIAL-REWRITE(8) from Postfix, with a version and dateβ€”but i'm not copying that line, just giving it a cute lil sign-off. stay iconic, bestie! πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from