RELOCATED(5)

๐Ÿ’– RELOCATED(5) โ€” the Postfix relocated table format, but make it make sense ๐Ÿ’–

okay bestie, gather round, because we're doing the relocated(5) page from the File Formats Manual and it's genuinely lowkey iconic. this is the table that tells the world "she's not here anymore, she MOVED" ๐Ÿฆ‹


โœจ NAME โœจ

relocated โ€” Postfix relocated table format


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

postmap /etc/postfix/relocated

๐Ÿ’… DESCRIPTION ๐Ÿ’…

The optional relocated(5) table holds the info that gets used in "user has moved to new_location" bounce messages. that's the whole vibe. ๐Ÿ“ฌ

Normally, the relocated(5) table is specified as a text file that serves as input to the postmap(1) command, which then creates an indexed file so lookups are fast. speed demon behaviour fr fr โœจ

Run this command to rebuild a default-type indexed file after you change the text file:

postmap /etc/postfix/relocated

or run this one if you want to specify an explicit type:

postmap type:/etc/postfix/relocated

The default indexed file type is configured with the default_database_type parameter. depending on your platform, that might be one of lmdb:, cdb:, hash:, or dbm: โ€” and heads up, no trailing ':' on those ๐Ÿ‘‘

When the table is provided via other means like NIS, LDAP or SQL, the same lookups happen as for ordinary indexed files. But managing those databases? not Postfix's problem, that's outside the scope. ๐Ÿ™ˆ

Alternatively, the table can be provided as a regular-expression map where patterns are given as regular expressions, or lookups can be directed to a TCP-based server. In those cases the lookups are done in a slightly different way, and that's all spelled out below under "REGULAR EXPRESSION TABLES" or "TCP-BASED TABLES". okay so go read those sections, I'm not repeating myself ๐Ÿ’œ

Table lookups are case insensitive. โœจ


๐ŸŒธ CASE FOLDING ๐ŸŒธ

The search string gets folded to lowercase before the database lookup. periodt.

BUT โ€” as of Postfix 2.3, the search string is not case folded with database types like regexp: or pcre:, because those lookup fields can match both upper and lower case. so if you're on regexp or pcre, casing is your problem now bestie ๐Ÿ’€


๐ŸŒˆ TABLE FORMAT ๐ŸŒˆ

  • By default, Postfix will prepend a hard-coded prefix "5.1.6 User has moved to " to a table lookup result, and the format for a table entry is as follows:
pattern      new_location

Where new_location specifies contact information such as an email address, or perhaps a street address or telephone number. like, whatever you want them to reach out to ๐Ÿ“ฎ

  • Postfix 3.11 and later can optionally disable that hard-coded prefix. Specify relocated_prefix_enable = no in main.cf, and then specify relocated_maps entries with your own RFC 3463-compliant enhanced status code and text, for example:
pattern      5.1.6 Mailbox has moved to user@example
pattern      5.2.0 Mailbox is unavailable
pattern      5.2.1 Mailbox is disabled

you get to write your own status codes now, main character energy ๐Ÿ‘‘

  • Empty lines and whitespace-only lines are ignored, as are lines whose first non-whitespace character is a #. those are the classic "not me, not today" lines ๐Ÿ’…
  • A logical line starts with non-whitespace text. A line that starts with whitespace continues a logical line. so indentation = continuation, don't forget ๐Ÿงš

โญ TABLE SEARCH ORDER โญ

With lookups from indexed files such as DB or DBM, or from networked tables such as NIS, LDAP or SQL, patterns are tried in the order listed below:

  • user@domain โ€” Matches user@domain. This form has precedence over all other forms. it's the VIP of the group chat ๐Ÿ‘‘
  • user โ€” Matches user@site when site is $myorigin, when site is listed in $mydestination, or when site is listed in $inet_interfaces or $proxy_interfaces.
  • @domain โ€” Matches other addresses in domain. This form has the lowest precedence. last place, sorry babe ๐Ÿฅฒ

๐Ÿฆ‹ ADDRESS EXTENSION ๐Ÿฆ‹

When a mail address localpart contains the optional recipient delimiter (e.g., user+foo@domain), the lookup order becomes: user+foo@domain, user@domain, user+foo, user, and @domain.

that's the full chain, in that exact order, no skipping ๐Ÿ”ฅ


๐Ÿ’œ REGULAR EXPRESSION TABLES ๐Ÿ’œ

This section describes how the table lookups change when the table is given in the form of regular expressions, or when lookups are directed to a TCP-based server. For a description of regular expression lookup table syntax, see regexp_table(5) or pcre_table(5). For a description of the TCP client/server table lookup protocol, see tcp_table(5). This feature is available in Postfix 2.5 and later.

Each pattern is a regular expression that is applied to the entire address being looked up. so user@domain mail addresses are not broken up into their user and @domain constituent parts, and user+foo is not broken up into user and foo. no splitting, no chopping, we respect the whole address ๐Ÿซถ

Patterns are applied in the order as specified in the table, until a pattern is found that matches the search string.

Results are the same as with indexed file lookups, with the additional feature that parenthesized substrings from the pattern can be interpolated as $1, $2 and so on. cute little placeholders, obsessed โœจ


๐Ÿ’€ TCP-BASED TABLES ๐Ÿ’€

This section describes how the table lookups change when lookups are directed to a TCP-based server. For a description of the TCP client/server lookup protocol, see tcp_table(5). This feature is available in Postfix 2.5 and later.

Each lookup operation uses the entire address once. so again: user@domain mail addresses are not broken up into their user and @domain constituent parts, and user+foo is not broken up into user and foo. one address, one lookup, that's the rule ๐Ÿ’…

Results are the same as with indexed file lookups.


๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

The table format does not understand quoting conventions.

that's it. that's the bug. no fancy quotes, no escape tricks, it simply does not know her ๐Ÿ™ˆ


โœจ 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. (iykyk ๐Ÿ’œ)

  • relocated_maps (empty) โ€” Optional lookup tables with new contact information for users or domains that no longer exist.

Available with Postfix version 3.11 and later:

  • relocated_prefix_enable (yes) โ€” Prepend the prefix "5.1.6 User has moved to " to all relocated_maps lookup results.

Other parameters of interest:

  • inet_interfaces (all) โ€” The local network interface addresses that this mail system receives mail on.
  • mydestination ($myhostname, localhost.$mydomain, localhost) โ€” The list of domains that are delivered via the $local_transport mail delivery transport.
  • myorigin ($myhostname) โ€” The domain name that locally-posted mail appears to come from, and that locally posted mail is delivered to.
  • proxy_interfaces (empty) โ€” The remote network interface addresses that this mail system receives mail on by way of a proxy or network address translation unit.

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ


๐Ÿ“š README FILES ๐Ÿ“š

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

  • DATABASE_README, Postfix lookup table overview
  • ADDRESS_REWRITING_README, address rewriting guide

๐Ÿ‘‘ 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, we ate and left no crumbs ๐Ÿ’…โœจ and to sign off cute: this whole thing lives in the File Formats Manual as RELOCATED(5), so if you ever forget where you found it, that's where, mwah ๐ŸŽ€๐Ÿฆ‹๐Ÿ’œ

๐Ÿ“ฆ where this page comes from