Cleanup: don't panic in mymalloc() when master can't find
any IP addresses. LaMont Jones. File: master/master_ent.c.
-Open problems:
+20050207
+
+ Documentation: added a generics(5) manual page for consistency
+ with the already existing table driven mechanisms, added
+ references to or examples of the new generic mapping.
- Med: document generics mapping in BASIC_CONFIGURATION_README.
+ Bugfix: the header_checks REPLACE action mis-handled
+ multi-line replacement text in message headers, for example:
+ /(.*)/ REPLACE X-$1. File: cleanup/cleanup_message.c.
- Med: local and remote source port and IP address for
- smtpd policy hook.
+ Bugfix: the header_checks REPLACE action should not drop
+ the input when the action is NOT executed. File:
+ cleanup/cleanup_message.c.
+
+Open problems:
+
+ Med: local and remote source port and IP address for smtpd
+ policy hook.
Med: smtp_connect_timeout_budget (default: 2x smtp_connect_timeout)
to limit the total time spent trying to connect.
- Low: pointers to postfinger and saslfinger. postfinger
- is now bundled.
-
Med: transform IPv4-in-IPv6 address literals to IPv4 form
when comparing against local IP addresses?
Internet, because many mail servers reject mail addresses with invalid domain
names.
-With the smtp_generics_maps parameter you can specify lookup tables that
-replace local mail addresses by valid Internet addresses when mail leaves the
-machine via SMTP. This mapping replaces envelope and header addresses, and is
-non-recursive. It does not happen when you send mail between addresses on the
-local machine.
+With the smtp_generics_maps parameter you can specify generics(5) lookup tables
+that replace local mail addresses by valid Internet addresses when mail leaves
+the machine via SMTP. The generics(5) mapping replaces envelope and header
+addresses, and is non-recursive. It does not happen when you send mail between
+addresses on the local machine.
This feature is available in Postfix version 2.2 and later.
smtp_generics_maps = hash:/etc/postfix/generics
/etc/postfix/generics:
- you@localdomain.local youraccount@yourisp.example
+ his@localdomain.local hisaccount@hisisp.example
her@localdomain.local heraccount@herisp.example
- @localdomain.local youraccount+local@yourisp.example
+ @localdomain.local hisaccount+local@hisisp.example
-When mail is sent to a remote host via SMTP, this replaces your local mail
-address you@localdomain.local by your ISP mail address, replaces
-her@localdomain.local by her ISP mail address, and replaces all other local
-addresses by your ISP account, with an address extension of +local (this
-example assumes that the ISP supports "+" style address extensions).
+When mail is sent to a remote host via SMTP, this replaces
+his@localdomain.local by his ISP mail address, replaces her@localdomain.local
+by her ISP mail address, and replaces other local addresses by his ISP account,
+with an address extension of +local (this example assumes that the ISP supports
+"+" style address extensions).
L\bLo\boc\bca\bal\bl a\bal\bli\bia\bas\bs d\bda\bat\bta\bab\bba\bas\bse\be
* Running Postfix behind a firewall
* Configuring Postfix as MX host for a remote site
* Postfix on a dialup machine
- * Postfix on hosts without a real hostname
+ * Postfix on hosts without a real Internet hostname
P\bPo\bos\bst\btf\bfi\bix\bx o\bon\bn a\ba s\bst\bta\ban\bnd\bd-\b-a\bal\blo\bon\bne\be I\bIn\bnt\bte\ber\brn\bne\bet\bt h\bho\bos\bst\bt
mynetworks_style = host
relay_domains =
-See also the section "Postfix on hosts without a real hostname" if this is
-applicable to your configuration.
+See also the section "Postfix on hosts without a real Internet hostname" if
+this is applicable to your configuration.
P\bPo\bos\bst\btf\bfi\bix\bx o\bon\bn a\ba n\bnu\bul\bll\bl c\bcl\bli\bie\ben\bnt\bt
This section presents additional configuration. You need to combine this with
basic configuration information as discussed the first half of this document.
-If you do not have your own hostname (as with dynamic IP addressing) then you
-should also study the section on "Postfix on hosts without a real hostname".
+If you do not have your own hostname and IP address (usually with dialup, cable
+TV or DSL connections) then you should also study the section on "Postfix on
+hosts without a real Internet hostname".
* Route all outgoing mail to your network provider.
If your machine is disconnected most of the time, there isn't a lot of
the "s\bse\ben\bnd\bdm\bma\bai\bil\bl -\b-q\bq" command every now and then while the dialup link is up,
so that newly-posted mail is flushed from the queue.
-P\bPo\bos\bst\btf\bfi\bix\bx o\bon\bn h\bho\bos\bst\bts\bs w\bwi\bit\bth\bho\bou\but\bt a\ba r\bre\bea\bal\bl h\bho\bos\bst\btn\bna\bam\bme\be
+P\bPo\bos\bst\btf\bfi\bix\bx o\bon\bn h\bho\bos\bst\bts\bs w\bwi\bit\bth\bho\bou\but\bt a\ba r\bre\bea\bal\bl I\bIn\bnt\bte\ber\brn\bne\bet\bt h\bho\bos\bst\btn\bna\bam\bme\be
-This section is for hosts that don't have an Internet hostname. Typically these
-are systems that get a dynamic IP address via DHCP or via dialup. Postfix will
-let you send and receive mail just fine between accounts on a machine with a
-fantasy name. However, you cannot use a fantasy hostname in your email address
-when sending mail into the Internet, because no-one would be able to reply to
-your mail. In fact, more and more sites refuse mail from non-existent domain
-names.
+This section is for hosts that don't have their own Internet hostname.
+Typically these are systems that get a dynamic IP address via DHCP or via
+dialup. Postfix will let you send and receive mail just fine between accounts
+on a machine with a fantasy name. However, you cannot use a fantasy hostname in
+your email address when sending mail into the Internet, because no-one would be
+able to reply to your mail. In fact, more and more sites refuse mail addresses
+with non-existent domain names.
-The perfect solution would be for Postfix to do a mapping from local fantasy
-email addresses to valid Internet addresses when mail leaves the machine
-(similar to Sendmail's generics table). This is planned for the near future.
+Note: the following information is Postfix version dependent. To find out what
+Postfix version you have, execute the command "p\bpo\bos\bst\btc\bco\bon\bnf\bf m\bma\bai\bil\bl_\b_v\bve\ber\brs\bsi\bio\bon\bn".
+
+P\bPo\bos\bst\btf\bfi\bix\bx v\bve\ber\brs\bsi\bio\bon\bn 2\b2.\b.2\b2 a\ban\bnd\bd l\bla\bat\bte\ber\br
+
+Postfix 2.2 uses the generics(5) address mapping to replace local fantasy email
+addresses by valid Internet addresses. This mapping happens ONLY when mail
+leaves the machine; not when you send mail between users on the same machine.
+
+The following example presents additional configuration. You need to combine
+this with basic configuration information as discussed the first half of this
+document.
+
+ 1 /etc/postfix/main.cf:
+ 2 smtp_generics_maps = hash:/etc/postfix/generics
+ 3
+ 4 /etc/postfix/generics:
+ 5 his@localdomain.local hisaccount@hisisp.example
+ 6 her@localdomain.local heraccount@herisp.example
+ 7 @localdomain.local hisaccount+local@hisisp.example
+
+When mail is sent to a remote host via SMTP:
+
+ * Line 5 replaces his@localdomain.local by his ISP mail address,
-In the mean time, the solution with Postfix is to use valid Internet addresses
+ * Line 6 replaces her@localdomain.local by her ISP mail address, and
+
+ * Line 7 replaces other local addresses by his ISP account, with an address
+ extension of +local (this example assumes that the ISP supports "+" style
+ address extensions).
+
+Specify d\bdb\bbm\bm instead of h\bha\bas\bsh\bh if your system uses d\bdb\bbm\bm files instead of d\bdb\bb files.
+To find out what lookup tables Postfix supports, use the command "p\bpo\bos\bst\btc\bco\bon\bnf\bf -\b-m\bm".
+
+Execute the command "p\bpo\bos\bst\btm\bma\bap\bp /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/g\bge\ben\bne\ber\bri\bic\bcs\bs" whenever you change the
+generics table.
+
+P\bPo\bos\bst\btf\bfi\bix\bx v\bve\ber\brs\bsi\bio\bon\bn 2\b2.\b.1\b1 a\ban\bnd\bd e\bea\bar\brl\bli\bie\ber\br
+
+The solution with older Postfix systems is to use valid Internet addresses
where possible, and to let Postfix map valid Internet addresses to local
fantasy addresses. With this, you can send mail to the Internet and to local
fantasy addresses, including mail to local fantasy addresses that don't have a
instead of sending it to the ISP. This part is not required but is
convenient.
+Specify d\bdb\bbm\bm instead of h\bha\bas\bsh\bh if your system uses d\bdb\bbm\bm files instead of d\bdb\bb files.
+To find out what lookup tables Postfix supports, use the command "p\bpo\bos\bst\btc\bco\bon\bnf\bf -\b-m\bm".
+
+Execute the command "p\bpo\bos\bst\btm\bma\bap\bp /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/c\bca\ban\bno\bon\bni\bic\bca\bal\bl" whenever you change the
+canonical table.
+
+Execute the command "p\bpo\bos\bst\btm\bma\bap\bp /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/v\bvi\bir\brt\btu\bua\bal\bl" whenever you change the
+virtual table.
+
# A list of address rewriting or forwarding mecha-
# nisms that propagate an address extension from the
# original address to the result. Specify zero or
-# more of canonical, virtual, alias, forward, or
-# include.
+# more of canonical, virtual, alias, forward,
+# include, or generics.
#
# owner_request_special
# Give special treatment to owner-listname and list-
# DESCRIPTION
# The optional canonical(5) table specifies an address map-
# ping for local and non-local addresses. The mapping is
-# used by the cleanup(8) daemon. The address mapping is
-# recursive.
+# used by the cleanup(8) daemon, before mail is stored into
+# the queue. The address mapping is recursive.
#
# Normally, the canonical(5) table is specified as a text
# file that serves as input to the postmap(1) command. The
# aliasing. Use the aliases(5) map for that purpose.
#
# TABLE FORMAT
-# make# The input format for the postmap(1) command is as
-# follows:
+# The input format for the postmap(1) command is as follows:
#
# pattern result
# When pattern matches a mail address, replace it by
# line that starts with whitespace continues a logi-
# cal line.
#
+# 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 as listed below:
#
# user@domain address
-# user@domain is replaced by address. This form has
-# the highest precedence.
+# Replace user@domain by address. This form has the
+# highest precedence.
#
# This is useful to clean up addresses produced by
# legacy mail systems. It can also be used to pro-
# below for a simpler solution.
#
# user address
-# user@site is replaced by address when site is equal
-# to $myorigin, when site is listed in $mydestina-
-# tion, or when it is listed in $inet_interfaces or
+# Replace user@site by address when site is equal to
+# $myorigin, when site is listed in $mydestination,
+# or when it is listed in $inet_interfaces or
# $proxy_interfaces.
#
# This form is useful for replacing login names by
# Firstname.Lastname.
#
# @domain address
-# Every address in domain is replaced by address.
-# This form has the lowest precedence.
+# Replace other addresses in domain by address. This
+# form has the lowest precedence.
#
# In all the above forms, when address has the form @other-
# domain, the result is the same user in otherdomain.
# A list of address rewriting or forwarding mecha-
# nisms that propagate an address extension from the
# original address to the result. Specify zero or
-# more of canonical, virtual, alias, forward, or
-# include.
+# more of canonical, virtual, alias, forward,
+# include, or generics.
#
# Other parameters of interest:
#
--- /dev/null
+# GENERICS(5) GENERICS(5)
+#
+# NAME
+# generics - Postfix generics table format
+#
+# SYNOPSIS
+# postmap /etc/postfix/generics
+#
+# postmap -q "string" /etc/postfix/generics
+#
+# postmap -q - /etc/postfix/generics <inputfile
+#
+# DESCRIPTION
+# The optional generics(5) table specifies an address map-
+# ping that applies when mail is delivered. This is the
+# opposite of canonical(5) mapping, which applies when mail
+# is received.
+#
+# Typically, one would use the generics(5) table on a system
+# that does not have a valid Internet domain name and that
+# uses something like localdomain.local instead. The gener-
+# ics(5) table is then used by the smtp(8) client to trans-
+# form local mail addresses into valid Internet mail
+# addresses when mail has to be sent across the Internet.
+# See the EXAMPLE section at the end of this document.
+#
+# The generics(5) mapping affects both message header
+# addresses (i.e. addresses that appear inside messages) and
+# message envelope addresses (for example, the addresses
+# that are used in SMTP protocol commands).
+#
+# Normally, the generics(5) table is specified as a text
+# file that serves as input to the postmap(1) command. The
+# result, an indexed file in dbm or db format, is used for
+# fast searching by the mail system. Execute the command
+# "postmap /etc/postfix/generics" in order to rebuild the
+# indexed file after changing the text file.
+#
+# When the table is provided via other means such as NIS,
+# LDAP or SQL, the same lookups are done as for ordinary
+# indexed files.
+#
+# Alternatively, the table can be provided as a regular-
+# expression map where patterns are given as regular expres-
+# sions, or lookups can be directed to TCP-based server. In
+# that case, the lookups are done in a slightly different
+# way as described below under "REGULAR EXPRESSION TABLES"
+# and "TCP-BASED TABLES".
+#
+# TABLE FORMAT
+# The input format for the postmap(1) command is as follows:
+#
+# pattern result
+# When pattern matches a mail address, replace it by
+# the corresponding result.
+#
+# blank lines and comments
+# Empty lines and whitespace-only lines are ignored,
+# as are lines whose first non-whitespace character
+# is a `#'.
+#
+# multi-line text
+# A logical line starts with non-whitespace text. A
+# line that starts with whitespace continues a logi-
+# cal line.
+#
+# 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 as listed below:
+#
+# user@domain address
+# Replace user@domain by address. This form has the
+# highest precedence.
+#
+# user address
+# Replace user@site by address when site is equal to
+# $myorigin, when site is listed in $mydestination,
+# or when it is listed in $inet_interfaces or
+# $proxy_interfaces.
+#
+# @domain address
+# Replace other addresses in domain by address. This
+# form has the lowest precedence.
+#
+# In all the above forms, the result address must have the
+# form username@domainname.
+#
+# ADDRESS EXTENSION
+# When a mail address localpart contains the optional recip-
+# ient delimiter (e.g., user+foo@domain), the lookup order
+# becomes: user+foo@domain, user@domain, user+foo, user, and
+# @domain.
+#
+# The propagate_unmatched_extensions parameter controls
+# whether an unmatched address extension (+foo) is propa-
+# gated to the result of table lookup.
+#
+# 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).
+#
+# Each pattern is a regular expression that is applied to
+# the entire address being looked up. Thus, user@domain mail
+# addresses are not broken up into their user and @domain
+# constituent parts, nor is user+foo broken up into user and
+# foo.
+#
+# 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.
+#
+# TCP-BASED TABLES
+# This section describes how the table lookups change when
+# lookups are directed to a TCP-based server. For a descrip-
+# tion of the TCP client/server lookup protocol, see
+# tcp_table(5). This feature is not available up to and
+# including Postfix version 2.2.
+#
+# Each lookup operation uses the entire address once. Thus,
+# user@domain mail addresses are not broken up into their
+# user and @domain constituent parts, nor is user+foo broken
+# up into user and foo.
+#
+# Results are the same as with indexed file lookups.
+#
+# EXAMPLE
+# The following shows a generic mapping with an indexed
+# file. When mail is sent to a remote host via SMTP, this
+# replaces his@localdomain.local by his ISP mail address,
+# replaces her@localdomain.local by her ISP mail address,
+# and replaces other local addresses by his ISP account,
+# with an address extension of +local (this example assumes
+# that the ISP supports "+" style address extensions).
+#
+# /etc/postfix/main.cf:
+# smtp_generics_maps = hash:/etc/postfix/generics
+#
+# /etc/postfix/generics:
+# his@localdomain.local hisaccount@hisisp.example
+# her@localdomain.local heraccount@herisp.example
+# @localdomain.local hisaccount+local@hisisp.example
+#
+# Execute the command "postmap /etc/postfix/generics" when-
+# ever the table is changed. Instead of hash, some systems
+# use dbm database files. To find out what tables your sys-
+# tem supports use the command "postconf -m".
+#
+# BUGS
+# The table format does not understand quoting conventions.
+#
+# 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.
+#
+# smtp_generics_maps
+# Address mapping lookup table for envelope and
+# header sender and recipient addresses while deliv-
+# ering mail via SMTP.
+#
+# propagate_unmatched_extensions
+# A list of address rewriting or forwarding mecha-
+# nisms that propagate an address extension from the
+# original address to the result. Specify zero or
+# more of canonical, virtual, alias, forward,
+# include, or generics.
+#
+# Other parameters of interest:
+#
+# inet_interfaces
+# The network interface addresses that this system
+# receives mail on. You need to stop and start Post-
+# fix when this parameter changes.
+#
+# proxy_interfaces
+# Other interfaces that this machine receives mail on
+# by way of a proxy agent or network address transla-
+# tor.
+#
+# mydestination
+# List of domains that this mail system considers
+# local.
+#
+# myorigin
+# The domain that is appended to locally-posted mail.
+#
+# owner_request_special
+# Give special treatment to owner-xxx and xxx-request
+# addresses.
+#
+# SEE ALSO
+# postmap(1), Postfix lookup table manager
+# postconf(5), configuration parameters
+# smtp(8), Postfix SMTP client
+#
+# README FILES
+# Use "postconf readme_directory" or "postconf html_direc-
+# tory" 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.
+#
+# HISTORY
+# A genericstable feature appears in the Sendmail MTA.
+#
+# This feature is available in Postfix 2.2 and later.
+#
+# AUTHOR(S)
+# Wietse Venema
+# IBM T.J. Watson Research
+# P.O. Box 704
+# Yorktown Heights, NY 10598, USA
+#
+# GENERICS(5)
$config_directory/aliases:f:root:-:644:p
$config_directory/canonical:f:root:-:644:p
$config_directory/cidr_table:f:root:-:644:o
+$config_directory/generics:f:root:-:644:p
$config_directory/header_checks:f:root:-:644:p
$config_directory/install.cf:f:root:-:644:o
$config_directory/main.cf:f:root:-:644:p
$manpage_directory/man5/body_checks.5:f:root:-:644
$manpage_directory/man5/canonical.5:f:root:-:644
$manpage_directory/man5/cidr_table.5:f:root:-:644
+$manpage_directory/man5/generics.5:f:root:-:644
$manpage_directory/man5/header_checks.5:f:root:-:644
$manpage_directory/man5/ldap_table.5:f:root:-:644
$manpage_directory/man5/master.5:f:root:-:644
$html_directory/discard.8.html:f:root:-:644
$html_directory/error.8.html:f:root:-:644
$html_directory/flush.8.html:f:root:-:644
+$html_directory/generics.5.html:f:root:-:644
$html_directory/header_checks.5.html:f:root:-:644
$html_directory/index.html:f:root:-:644
$html_directory/ldap_table.5.html:f:root:-:644
# line that starts with whitespace continues a logi-
# cal line.
#
+# 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 as listed below:
# in $inet_interfaces or $proxy_interfaces.
#
# @domain
-# Matches every address in domain. This form has the
-# lowest precedence.
+# Matches every other address in domain. This form
+# has the lowest precedence.
#
# ADDRESS EXTENSION
# When a mail address localpart contains the optional recip-
# how or where to deliver mail. This is described in section
# "RESULT FORMAT".
#
-# TABLE LOOKUP
+# 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 as listed below:
#
# user+extension@domain transport:nexthop
-# Mail for user+extension@domain is delivered through
+# Deliver mail for user+extension@domain through
# transport to nexthop.
#
# user@domain transport:nexthop
-# Mail for user@domain is delivered through transport
-# to nexthop.
+# Deliver mail for user@domain through transport to
+# nexthop.
#
# domain transport:nexthop
-# Mail for domain is delivered through transport to
-# nexthop.
+# Deliver mail for domain through transport to nex-
+# thop.
#
# .domain transport:nexthop
-# Mail for any subdomain of domain is delivered
-# through transport to nexthop. This applies only
-# when the string transport_maps is not listed in the
-# parent_domain_matches_subdomains configuration set-
+# Deliver mail for any subdomain of domain through
+# transport to nexthop. This applies only when the
+# string transport_maps is not listed in the par-
+# ent_domain_matches_subdomains configuration set-
# ting. Otherwise, a domain name matches itself and
# its subdomains.
#
# line that starts with whitespace continues a logi-
# cal line.
#
+# 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 as listed below:
#
# user@domain address, address, ...
-# Mail for user@domain is redirected to address.
-# This form has the highest precedence.
+# Redirect mail for user@domain to address. This
+# form has the highest precedence.
#
# user address, address, ...
-# Mail for user@site is redirected to address when
-# site is equal to $myorigin, when site is listed in
-# $mydestination, or when it is listed in
-# $inet_interfaces or $proxy_interfaces.
+# Redirect mail for user@site to address when site is
+# equal to $myorigin, when site is listed in $mydes-
+# tination, or when it is listed in $inet_interfaces
+# or $proxy_interfaces.
#
# This functionality overlaps with functionality of
# the local aliases(5) database. The difference is
# addresses.
#
# @domain address, address, ...
-# Mail for any user in domain is redirected to
-# address. This form has the lowest precedence.
+# Redirect mail for other users in domain to address.
+# This form has the lowest precedence.
#
# In all the above forms, when address has the form @other-
# domain, the result is the same user in otherdomain. This
# A list of address rewriting or forwarding mecha-
# nisms that propagate an address extension from the
# original address to the result. Specify zero or
-# more of canonical, virtual, alias, forward, or
-# include.
+# more of canonical, virtual, alias, forward,
+# include, or generics.
#
# Other parameters of interest:
#
you want to send mail over the Internet, because many mail servers
reject mail addresses with invalid domain names. </p>
-<p> With the <a href="postconf.5.html#smtp_generics_maps">smtp_generics_maps</a> parameter you can specify lookup
-tables that replace local mail addresses by valid Internet addresses
-when mail leaves the machine via SMTP. This mapping replaces envelope
-and header addresses, and is non-recursive. It does not happen when
-you send mail between addresses on the local machine. </p>
+<p> With the <a href="postconf.5.html#smtp_generics_maps">smtp_generics_maps</a> parameter you can specify <a href="generics.5.html">generics(5)</a>
+lookup tables that replace local mail addresses by valid Internet
+addresses when mail leaves the machine via SMTP. The <a href="generics.5.html">generics(5)</a>
+mapping replaces envelope and header addresses, and is non-recursive.
+It does not happen when you send mail between addresses on the
+local machine. </p>
<p> This feature is available in Postfix version 2.2 and later.</p>
<a href="postconf.5.html#smtp_generics_maps">smtp_generics_maps</a> = hash:/etc/postfix/generics
/etc/postfix/generics:
- you@localdomain.local youraccount@yourisp.example
+ his@localdomain.local hisaccount@hisisp.example
her@localdomain.local heraccount@herisp.example
- @localdomain.local youraccount+local@yourisp.example
+ @localdomain.local hisaccount+local@hisisp.example
</pre>
</blockquote>
-<p> When mail is sent to a remote host via SMTP, this replaces your
-local mail address <i>you@localdomain.local</i> by your ISP mail
-address, replaces <i>her@localdomain.local</i> by her ISP mail
-address, and replaces all other local addresses by your ISP account,
-with an address extension of +<i>local</i> (this example assumes
-that the ISP supports "+" style address extensions). </p>
+<p> When mail is sent to a remote host via SMTP, this replaces
+<i>his@localdomain.local</i> by his ISP mail address, replaces
+<i>her@localdomain.local</i> by her ISP mail address, and replaces
+other local addresses by his ISP account, with an address extension
+of +<i>local</i> (this example assumes that the ISP supports "+"
+style address extensions). </p>
<h3> <a name="aliases"> Local alias database </a> </h3>
transport.5.html virtual.5.html pcre_table.5.html regexp_table.5.html \
cidr_table.5.html tcp_table.5.html header_checks.5.html \
ldap_table.5.html mysql_table.5.html pgsql_table.5.html \
- master.5.html nisplus_table.5.html
+ master.5.html nisplus_table.5.html generics.5.html
OTHER = postfix-manuals.html
AWK = awk '{ print; if (NR == 2) print ".pl 9999\n.ll 65" }'
MAN2HTML = man2html -t "Postfix manual - `IFS=.; set \`echo $@\`; echo \"$$1($$2)\"`"
PATH=../mantools:$$PATH; \
srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+generics.5.html: ../proto/generics
+ PATH=../mantools:$$PATH; \
+ srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+
ldap_table.5.html: ../proto/ldap_table
PATH=../mantools:$$PATH; \
srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
<li><a href="#dialup">Postfix on a dialup machine</a>
<li><a href="#fantasy">Postfix on hosts without a real
-hostname</a>
+Internet hostname</a>
</ul>
</blockquote>
<p> See also the section "<a href="#fantasy">Postfix on hosts without
-a real hostname</a>" if this is applicable to your configuration.
+a real Internet hostname</a>" if this is applicable to your configuration.
</p>
<h2><a name="null_client">Postfix on a null client</a></h2>
combine this with basic configuration information as discussed the
first half of this document. </p>
-<p> If you do not have your own hostname (as with dynamic IP
-addressing) then you should also study the section on "<a
-href="#fantasy">Postfix on hosts without a real hostname</a>".
-</p>
+<p> If you do not have your own hostname and IP address (usually
+with dialup, cable TV or DSL connections) then you should also
+study the section on "<a href="#fantasy">Postfix on hosts without
+a real Internet hostname</a>". </p>
<ul>
</ul>
-<h2><a name="fantasy">Postfix on hosts without a real hostname</a></h2>
+<h2><a name="fantasy">Postfix on hosts without a real Internet
+hostname</a></h2>
-<p> This section is for hosts that don't have an Internet hostname.
-Typically these are systems that get a dynamic IP address via DHCP
-or via dialup. Postfix will let you send and receive mail just fine
-between accounts on a machine with a fantasy name. However, you
-cannot use a fantasy hostname in your email address when sending
+<p> This section is for hosts that don't have their own Internet
+hostname. Typically these are systems that get a dynamic IP address
+via DHCP or via dialup. Postfix will let you send and receive mail
+just fine between accounts on a machine with a fantasy name. However,
+you cannot use a fantasy hostname in your email address when sending
mail into the Internet, because no-one would be able to reply to
-your mail. In fact, more and more sites refuse mail from non-existent
-domain names. </p>
+your mail. In fact, more and more sites refuse mail addresses with
+non-existent domain names. </p>
+
+<p> Note: the following information is Postfix version dependent.
+To find out what Postfix version you have, execute the command
+"<b>postconf <a href="postconf.5.html#mail_version">mail_version</a></b>". </p>
+
+<h3>Postfix version 2.2 and later </h3>
+
+<p> Postfix 2.2 uses the <a href="generics.5.html">generics(5)</a> address mapping to replace
+local fantasy email addresses by valid Internet addresses. This
+mapping happens ONLY when mail leaves the machine; not when you
+send mail between users on the same machine. </p>
+
+<p> The following example presents additional configuration. You
+need to combine this with basic configuration information as
+discussed the first half of this document. </p>
+
+<blockquote>
+<pre>
+1 /etc/postfix/main.cf:
+2 <a href="postconf.5.html#smtp_generics_maps">smtp_generics_maps</a> = hash:/etc/postfix/generics
+3
+4 /etc/postfix/generics:
+5 his@localdomain.local hisaccount@hisisp.example
+6 her@localdomain.local heraccount@herisp.example
+7 @localdomain.local hisaccount+local@hisisp.example
+</pre>
+</blockquote>
+
+<p> When mail is sent to a remote host via SMTP: </p>
+
+<ul>
+
+<li> <p> Line 5 replaces <i>his@localdomain.local</i> by his ISP
+mail address, </p>
+
+<li> <p> Line 6 replaces <i>her@localdomain.local</i> by her ISP
+mail address, and </p>
-<p> The perfect solution would be for Postfix to do a mapping from
-local fantasy email addresses to valid Internet addresses when mail
-leaves the machine (similar to Sendmail's generics table). This is
-planned for the near future. </p>
+<li> <p> Line 7 replaces other local addresses by his ISP account,
+with an address extension of +<i>local</i> (this example assumes
+that the ISP supports "+" style address extensions). </p>
+
+</ul>
+
+<p>Specify <b>dbm</b> instead of <b>hash</b> if your system uses
+<b>dbm</b> files instead of <b>db</b> files. To find out what lookup
+tables Postfix supports, use the command "<b>postconf -m</b>". </p>
-<p> In the mean time, the solution with Postfix is to use valid
+<p> Execute the command "<b>postmap /etc/postfix/generics</b>"
+whenever you change the generics table. </p>
+
+<h3>Postfix version 2.1 and earlier </h3>
+
+<p> The solution with older Postfix systems is to use valid
Internet addresses where possible, and to let Postfix map valid
Internet addresses to local fantasy addresses. With this, you can
send mail to the Internet and to local fantasy addresses, including
</ul>
+<p>Specify <b>dbm</b> instead of <b>hash</b> if your system uses
+<b>dbm</b> files instead of <b>db</b> files. To find out what lookup
+tables Postfix supports, use the command "<b>postconf -m</b>". </p>
+
+<p> Execute the command "<b>postmap /etc/postfix/canonical</b>"
+whenever you change the canonical table. </p>
+
+<p> Execute the command "<b>postmap /etc/postfix/virtual</b>"
+whenever you change the virtual table. </p>
+
</body>
</html>
A list of address rewriting or forwarding mecha-
nisms that propagate an address extension from the
original address to the result. Specify zero or
- more of <b>canonical</b>, <b>virtual</b>, <b>alias</b>, <b>forward</b>, or
- <b>include</b>.
+ more of <b>canonical</b>, <b>virtual</b>, <b>alias</b>, <b>forward</b>,
+ <b>include</b>, or <b>generics</b>.
<b><a href="postconf.5.html#owner_request_special">owner_request_special</a></b>
Give special treatment to <b>owner-</b><i>listname</i> and <i>list-</i>
<b>DESCRIPTION</b>
The optional <a href="canonical.5.html"><b>canonical</b>(5)</a> table specifies an address map-
ping for local and non-local addresses. The mapping is
- used by the <a href="cleanup.8.html"><b>cleanup</b>(8)</a> daemon. The address mapping is
- recursive.
+ used by the <a href="cleanup.8.html"><b>cleanup</b>(8)</a> daemon, before mail is stored into
+ the queue. The address mapping is recursive.
Normally, the <a href="canonical.5.html"><b>canonical</b>(5)</a> table is specified as a text
file that serves as input to the <a href="postmap.1.html"><b>postmap</b>(1)</a> command. The
aliasing. Use the <a href="aliases.5.html"><b>aliases</b>(5)</a> map for that purpose.
<b>TABLE FORMAT</b>
- make# The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as
- follows:
+ The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as follows:
<i>pattern result</i>
When <i>pattern</i> matches a mail address, replace it by
line that starts with whitespace continues a logi-
cal line.
+<b>TABLE SEARCH ORDER</b>
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 as listed below:
<i>user</i>@<i>domain address</i>
- <i>user</i>@<i>domain</i> is replaced by <i>address</i>. This form has
- the highest precedence.
+ Replace <i>user</i>@<i>domain</i> by <i>address</i>. This form has the
+ highest precedence.
This is useful to clean up addresses produced by
legacy mail systems. It can also be used to pro-
below for a simpler solution.
<i>user address</i>
- <i>user</i>@<i>site</i> is replaced by <i>address</i> when <i>site</i> is equal
- to $<b><a href="postconf.5.html#myorigin">myorigin</a></b>, when <i>site</i> is listed in $<b><a href="postconf.5.html#mydestination">mydestina</a>-</b>
- <b><a href="postconf.5.html#mydestination">tion</a></b>, or when it is listed in $<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b> or
+ Replace <i>user</i>@<i>site</i> by <i>address</i> when <i>site</i> is equal to
+ $<b><a href="postconf.5.html#myorigin">myorigin</a></b>, when <i>site</i> is listed in $<b><a href="postconf.5.html#mydestination">mydestination</a></b>,
+ or when it is listed in $<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b> or
$<b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>.
This form is useful for replacing login names by
<i>Firstname.Lastname</i>.
@<i>domain address</i>
- Every address in <i>domain</i> is replaced by <i>address</i>.
- This form has the lowest precedence.
+ Replace other addresses in <i>domain</i> by <i>address</i>. This
+ form has the lowest precedence.
In all the above forms, when <i>address</i> has the form @<i>other-</i>
<i>domain</i>, the result is the same user in <i>otherdomain</i>.
A list of address rewriting or forwarding mecha-
nisms that propagate an address extension from the
original address to the result. Specify zero or
- more of <b>canonical</b>, <b>virtual</b>, <b>alias</b>, <b>forward</b>, or
- <b>include</b>.
+ more of <b>canonical</b>, <b>virtual</b>, <b>alias</b>, <b>forward</b>,
+ <b>include</b>, or <b>generics</b>.
Other parameters of interest:
line that starts with whitespace continues a logi-
cal line.
-<b>SEARCH ORDER</b>
+<b>TABLE SEARCH ORDER</b>
Patterns are applied in the order as specified in the
table, until a pattern is found that matches the search
string.
--- /dev/null
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html> <head>
+<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
+<title> Postfix manual - generics(5) </title>
+</head> <body> <pre>
+GENERICS(5) GENERICS(5)
+
+<b>NAME</b>
+ generics - Postfix generics table format
+
+<b>SYNOPSIS</b>
+ <b>postmap /etc/postfix/generics</b>
+
+ <b>postmap -q "</b><i>string</i><b>" /etc/postfix/generics</b>
+
+ <b>postmap -q - /etc/postfix/generics</b> <<i>inputfile</i>
+
+<b>DESCRIPTION</b>
+ The optional <a href="generics.5.html"><b>generics</b>(5)</a> table specifies an address map-
+ ping that applies when mail is delivered. This is the
+ opposite of <a href="canonical.5.html"><b>canonical</b>(5)</a> mapping, which applies when mail
+ is received.
+
+ Typically, one would use the <a href="generics.5.html"><b>generics</b>(5)</a> table on a system
+ that does not have a valid Internet domain name and that
+ uses something like <i>localdomain.local</i> instead. The <a href="generics.5.html"><b>gener-</b></a>
+ <a href="generics.5.html"><b>ics</b>(5)</a> table is then used by the <a href="smtp.8.html"><b>smtp</b>(8)</a> client to trans-
+ form local mail addresses into valid Internet mail
+ addresses when mail has to be sent across the Internet.
+ See the EXAMPLE section at the end of this document.
+
+ The <a href="generics.5.html"><b>generics</b>(5)</a> mapping affects both message header
+ addresses (i.e. addresses that appear inside messages) and
+ message envelope addresses (for example, the addresses
+ that are used in SMTP protocol commands).
+
+ Normally, the <a href="generics.5.html"><b>generics</b>(5)</a> table is specified as a text
+ file that serves as input to the <a href="postmap.1.html"><b>postmap</b>(1)</a> command. The
+ result, an indexed file in <b>dbm</b> or <b>db</b> format, is used for
+ fast searching by the mail system. Execute the command
+ "<b>postmap /etc/postfix/generics</b>" in order to rebuild the
+ indexed file after changing the text file.
+
+ When the table is provided via other means such as NIS,
+ LDAP or SQL, the same lookups are done as for ordinary
+ indexed files.
+
+ Alternatively, the table can be provided as a regular-
+ expression map where patterns are given as regular expres-
+ sions, or lookups can be directed to TCP-based server. In
+ that case, the lookups are done in a slightly different
+ way as described below under "REGULAR EXPRESSION TABLES"
+ and "TCP-BASED TABLES".
+
+<b>TABLE FORMAT</b>
+ The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as follows:
+
+ <i>pattern result</i>
+ When <i>pattern</i> matches a mail address, replace it by
+ the corresponding <i>result</i>.
+
+ blank lines and comments
+ Empty lines and whitespace-only lines are ignored,
+ as are lines whose first non-whitespace character
+ is a `#'.
+
+ multi-line text
+ A logical line starts with non-whitespace text. A
+ line that starts with whitespace continues a logi-
+ cal line.
+
+<b>TABLE SEARCH ORDER</b>
+ 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 as listed below:
+
+ <i>user</i>@<i>domain address</i>
+ Replace <i>user</i>@<i>domain</i> by <i>address</i>. This form has the
+ highest precedence.
+
+ <i>user address</i>
+ Replace <i>user</i>@<i>site</i> by <i>address</i> when <i>site</i> is equal to
+ $<b><a href="postconf.5.html#myorigin">myorigin</a></b>, when <i>site</i> is listed in $<b><a href="postconf.5.html#mydestination">mydestination</a></b>,
+ or when it is listed in $<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b> or
+ $<b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>.
+
+ @<i>domain address</i>
+ Replace other addresses in <i>domain</i> by <i>address</i>. This
+ form has the lowest precedence.
+
+ In all the above forms, the result <i>address</i> must have the
+ form <i>username@domainname</i>.
+
+<b>ADDRESS EXTENSION</b>
+ When a mail address localpart contains the optional recip-
+ ient delimiter (e.g., <i>user+foo</i>@<i>domain</i>), the lookup order
+ becomes: <i>user+foo</i>@<i>domain</i>, <i>user</i>@<i>domain</i>, <i>user+foo</i>, <i>user</i>, and
+ @<i>domain</i>.
+
+ The <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b> parameter controls
+ whether an unmatched address extension (<i>+foo</i>) is propa-
+ gated to the result of table lookup.
+
+<b>REGULAR EXPRESSION TABLES</b>
+ 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 <a href="regexp_table.5.html"><b>regexp_table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre_table</b>(5)</a>.
+
+ Each pattern is a regular expression that is applied to
+ the entire address being looked up. Thus, <i>user@domain</i> mail
+ addresses are not broken up into their <i>user</i> and <i>@domain</i>
+ constituent parts, nor is <i>user+foo</i> broken up into <i>user</i> and
+ <i>foo</i>.
+
+ 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 <b>$1</b>, <b>$2</b> and so on.
+
+<b>TCP-BASED TABLES</b>
+ This section describes how the table lookups change when
+ lookups are directed to a TCP-based server. For a descrip-
+ tion of the TCP client/server lookup protocol, see
+ <a href="tcp_table.5.html"><b>tcp_table</b>(5)</a>. This feature is not available up to and
+ including Postfix version 2.2.
+
+ Each lookup operation uses the entire address once. Thus,
+ <i>user@domain</i> mail addresses are not broken up into their
+ <i>user</i> and <i>@domain</i> constituent parts, nor is <i>user+foo</i> broken
+ up into <i>user</i> and <i>foo</i>.
+
+ Results are the same as with indexed file lookups.
+
+<b>EXAMPLE</b>
+ The following shows a generic mapping with an indexed
+ file. When mail is sent to a remote host via SMTP, this
+ replaces <i>his@localdomain.local</i> by his ISP mail address,
+ replaces <i>her@localdomain.local</i> by her ISP mail address,
+ and replaces other local addresses by his ISP account,
+ with an address extension of <i>+local</i> (this example assumes
+ that the ISP supports "+" style address extensions).
+
+ /etc/postfix/main.cf:
+ <a href="postconf.5.html#smtp_generics_maps">smtp_generics_maps</a> = hash:/etc/postfix/generics
+
+ /etc/postfix/generics:
+ his@localdomain.local hisaccount@hisisp.example
+ her@localdomain.local heraccount@herisp.example
+ @localdomain.local hisaccount+local@hisisp.example
+
+ Execute the command "<b>postmap /etc/postfix/generics</b>" when-
+ ever the table is changed. Instead of <b>hash</b>, some systems
+ use <b>dbm</b> database files. To find out what tables your sys-
+ tem supports use the command "<b>postconf -m</b>".
+
+<b>BUGS</b>
+ The table format does not understand quoting conventions.
+
+<b>CONFIGURATION PARAMETERS</b>
+ The following <b>main.cf</b> parameters are especially relevant.
+ The text below provides only a parameter summary. See
+ <a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including examples.
+
+ <b><a href="postconf.5.html#smtp_generics_maps">smtp_generics_maps</a></b>
+ Address mapping lookup table for envelope and
+ header sender and recipient addresses while deliv-
+ ering mail via SMTP.
+
+ <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b>
+ A list of address rewriting or forwarding mecha-
+ nisms that propagate an address extension from the
+ original address to the result. Specify zero or
+ more of <b>canonical</b>, <b>virtual</b>, <b>alias</b>, <b>forward</b>,
+ <b>include</b>, or <b>generics</b>.
+
+ Other parameters of interest:
+
+ <b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b>
+ The network interface addresses that this system
+ receives mail on. You need to stop and start Post-
+ fix when this parameter changes.
+
+ <b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>
+ Other interfaces that this machine receives mail on
+ by way of a proxy agent or network address transla-
+ tor.
+
+ <b><a href="postconf.5.html#mydestination">mydestination</a></b>
+ List of domains that this mail system considers
+ local.
+
+ <b><a href="postconf.5.html#myorigin">myorigin</a></b>
+ The domain that is appended to locally-posted mail.
+
+ <b><a href="postconf.5.html#owner_request_special">owner_request_special</a></b>
+ Give special treatment to <b>owner-</b><i>xxx</i> and <i>xxx</i><b>-request</b>
+ addresses.
+
+<b>SEE ALSO</b>
+ <a href="postmap.1.html">postmap(1)</a>, Postfix lookup table manager
+ <a href="postconf.5.html">postconf(5)</a>, configuration parameters
+ <a href="smtp.8.html">smtp(8)</a>, Postfix SMTP client
+
+<b>README FILES</b>
+ <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
+ <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a>, address rewriting guide
+
+<b>LICENSE</b>
+ The Secure Mailer license must be distributed with this
+ software.
+
+<b>HISTORY</b>
+ A genericstable feature appears in the Sendmail MTA.
+
+ This feature is available in Postfix 2.2 and later.
+
+<b>AUTHOR(S)</b>
+ Wietse Venema
+ IBM T.J. Watson Research
+ P.O. Box 704
+ Yorktown Heights, NY 10598, USA
+
+ GENERICS(5)
+</pre> </body> </html>
domain name, but uses something like <i>localdomain.local</i>
instead. </p>
-<p> The table search order is described below. The search terminates
-when a match is found. In other words, the search is non-recursive.
-</p>
-
-<dl>
-
-<dt> <i>user@domain.tld address</i> </dt>
+<p> The table format and lookups are documented in <a href="generics.5.html">generics(5)</a>;
+examples are shown in the <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a> and
+<a href="STANDARD_CONFIGURATION_README.html">STANDARD_CONFIGURATION_README</a> documents. </p>
-<dd> <p> Replace <i>user@domain.tld</i> by <i>address</i>. This
-form has the highest precedence. </p> </dd>
-
-<dt> <i>user address</i> </dt>
-
-<dd> <p> Replace <i>user@site</i> by <i>address</i> when <i>site</i> is
-equal to $<a href="postconf.5.html#myorigin">myorigin</a>, when <i>site</i> is listed in $<a href="postconf.5.html#mydestination">mydestination</a>,
-or when it matches $<a href="postconf.5.html#inet_interfaces">inet_interfaces</a> or $<a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a>. </p>
-</dd>
-
-<dt> <i>@domain.tld address</i> </dt>
-
-<dd> <p> Replace all other addresses in <i>domain.tld</i> by
-<i>address</i>. This form has the lowest preference. </p> </dd>
-
-</dl>
-
-<p> In all cases <i>address</i> must specify a username and a
-domain. </p> <p> This feature is available in Postfix 2.2 and later.
-</p>
+<p> This feature is available in Postfix 2.2 and later. </p>
</DD>
<li> <a href="postconf.1.html">postconf(1)</a>, Postfix configuration utility
+<li> <a href="postfix.1.html">postfix(1)</a>, Postfix control program
+
<li> <a href="postkick.1.html">postkick(1)</a>, trigger Postfix daemon
<li> <a href="postlock.1.html">postlock(1)</a>, Postfix-compatible locking
<li> <a href="postsuper.1.html">postsuper(1)</a>, Postfix housekeeping
+<li> <a href="mailq.1.html">mailq(1)</a>, Sendmail compatibility interface
+
+<li> <a href="newaliases.1.html">newaliases(1)</a>, Sendmail compatibility interface
+
<li> <a href="sendmail.1.html">sendmail(1)</a>, Sendmail compatibility interface
</ul>
<li> <a href="aliases.5.html">aliases(5)</a>, Postfix alias database
-<li> <a href="header_checks.5.html">header_checks(5)</a>, <a href="header_checks.5.html">body_checks(5)</a>, content inspection
+<li> <a href="canonical.5.html">canonical(5)</a>, Postfix input address rewriting
+
+<li> <a href="generics.5.html">generics(5)</a>, Postfix output address rewriting
-<li> <a href="canonical.5.html">canonical(5)</a>, Postfix address rewriting
+<li> <a href="header_checks.5.html">header_checks(5)</a>, <a href="header_checks.5.html">body_checks(5)</a>, Postfix content inspection
<li> <a href="relocated.5.html">relocated(5)</a>, Users that have moved
<a href="postalias.1.html">postalias(1)</a>, create/update/query alias database
<a href="postcat.1.html">postcat(1)</a>, examine Postfix queue file
<a href="postconf.1.html">postconf(1)</a>, Postfix configuration utility
+ <a href="postfix.1.html">postfix(1)</a>, Postfix control program
<a href="postkick.1.html">postkick(1)</a>, trigger Postfix daemon
<a href="postlock.1.html">postlock(1)</a>, Postfix-compatible locking
<a href="postlog.1.html">postlog(1)</a>, Postfix-compatible logging
<a href="postmap.1.html">postmap(1)</a>, Postfix lookup table manager
<a href="postqueue.1.html">postqueue(1)</a>, Postfix mail queue control
<a href="postsuper.1.html">postsuper(1)</a>, Postfix housekeeping
+ <a href="mailq.1.html">mailq(1)</a>, Sendmail compatibility interface
+ <a href="newaliases.1.html">newaliases(1)</a>, Sendmail compatibility interface
<a href="sendmail.1.html">sendmail(1)</a>, Sendmail compatibility interface
Postfix configuration:
Table-driven mechanisms:
<a href="access.5.html">access(5)</a>, Postfix SMTP access control table
<a href="aliases.5.html">aliases(5)</a>, Postfix alias database
- <a href="header_checks.5.html">header_checks(5)</a>, <a href="header_checks.5.html">body_checks(5)</a>, content inspection
- <a href="canonical.5.html">canonical(5)</a>, Postfix address rewriting
+ <a href="canonical.5.html">canonical(5)</a>, Postfix input address rewriting
+ <a href="generics.5.html">generics(5)</a>, Postfix output address rewriting
+ <a href="header_checks.5.html">header_checks(5)</a>, <a href="header_checks.5.html">body_checks(5)</a>, Postfix content inspection
<a href="relocated.5.html">relocated(5)</a>, Users that have moved
<a href="transport.5.html">transport(5)</a>, Postfix routing table
<a href="virtual.5.html">virtual(5)</a>, Postfix virtual aliasing
line that starts with whitespace continues a logi-
cal line.
+<b>TABLE SEARCH ORDER</b>
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 as listed below:
in $<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b> or $<b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>.
@<i>domain</i>
- Matches every address in <i>domain</i>. This form has the
- lowest precedence.
+ Matches every other address in <i>domain</i>. This form
+ has the lowest precedence.
<b>ADDRESS EXTENSION</b>
When a mail address localpart contains the optional recip-
how or where to deliver mail. This is described in section
"RESULT FORMAT".
-<b>TABLE LOOKUP</b>
+<b>TABLE SEARCH ORDER</b>
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 as listed below:
<i>user+extension@domain transport</i>:<i>nexthop</i>
- Mail for <i>user+extension@domain</i> is delivered through
+ Deliver mail for <i>user+extension@domain</i> through
<i>transport</i> to <i>nexthop</i>.
<i>user@domain transport</i>:<i>nexthop</i>
- Mail for <i>user@domain</i> is delivered through <i>transport</i>
- to <i>nexthop</i>.
+ Deliver mail for <i>user@domain</i> through <i>transport</i> to
+ <i>nexthop</i>.
<i>domain transport</i>:<i>nexthop</i>
- Mail for <i>domain</i> is delivered through <i>transport</i> to
- <i>nexthop</i>.
+ Deliver mail for <i>domain</i> through <i>transport</i> to <i>nex-</i>
+ <i>thop</i>.
<i>.domain transport</i>:<i>nexthop</i>
- Mail for any subdomain of <i>domain</i> is delivered
- through <i>transport</i> to <i>nexthop</i>. This applies only
- when the string <b><a href="postconf.5.html#transport_maps">transport_maps</a></b> is not listed in the
- <b><a href="postconf.5.html#parent_domain_matches_subdomains">parent_domain_matches_subdomains</a></b> configuration set-
+ Deliver mail for any subdomain of <i>domain</i> through
+ <i>transport</i> to <i>nexthop</i>. This applies only when the
+ string <b><a href="postconf.5.html#transport_maps">transport_maps</a></b> is not listed in the <b>par-</b>
+ <b>ent_domain_matches_subdomains</b> configuration set-
ting. Otherwise, a domain name matches itself and
its subdomains.
line that starts with whitespace continues a logi-
cal line.
+<b>TABLE SEARCH ORDER</b>
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 as listed below:
<i>user</i>@<i>domain address, address, ...</i>
- Mail for <i>user</i>@<i>domain</i> is redirected to <i>address</i>.
- This form has the highest precedence.
+ Redirect mail for <i>user</i>@<i>domain</i> to <i>address</i>. This
+ form has the highest precedence.
<i>user address, address, ...</i>
- Mail for <i>user</i>@<i>site</i> is redirected to <i>address</i> when
- <i>site</i> is equal to $<b><a href="postconf.5.html#myorigin">myorigin</a></b>, when <i>site</i> is listed in
- $<b><a href="postconf.5.html#mydestination">mydestination</a></b>, or when it is listed in
- $<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b> or $<b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>.
+ Redirect mail for <i>user</i>@<i>site</i> to <i>address</i> when <i>site</i> is
+ equal to $<b><a href="postconf.5.html#myorigin">myorigin</a></b>, when <i>site</i> is listed in $<b><a href="postconf.5.html#mydestination">mydes</a>-</b>
+ <b><a href="postconf.5.html#mydestination">tination</a></b>, or when it is listed in $<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b>
+ or $<b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>.
This functionality overlaps with functionality of
the local <i>aliases</i>(5) database. The difference is
addresses.
@<i>domain address, address, ...</i>
- Mail for any user in <i>domain</i> is redirected to
- <i>address</i>. This form has the lowest precedence.
+ Redirect mail for other users in <i>domain</i> to <i>address</i>.
+ This form has the lowest precedence.
In all the above forms, when <i>address</i> has the form @<i>other-</i>
<i>domain</i>, the result is the same user in <i>otherdomain</i>. This
A list of address rewriting or forwarding mecha-
nisms that propagate an address extension from the
original address to the result. Specify zero or
- more of <b>canonical</b>, <b>virtual</b>, <b>alias</b>, <b>forward</b>, or
- <b>include</b>.
+ more of <b>canonical</b>, <b>virtual</b>, <b>alias</b>, <b>forward</b>,
+ <b>include</b>, or <b>generics</b>.
Other parameters of interest:
man5/transport.5 man5/virtual.5 man5/pcre_table.5 man5/regexp_table.5 \
man5/cidr_table.5 man5/tcp_table.5 man5/header_checks.5 \
man5/body_checks.5 man5/ldap_table.5 man5/mysql_table.5 \
- man5/pgsql_table.5 man5/master.5 man5/nisplus_table.5
+ man5/pgsql_table.5 man5/master.5 man5/nisplus_table.5 \
+ man5/generics.5
TOOLS = man1/smtp-sink.1 man1/smtp-source.1 man1/qmqp-sink.1 \
man1/qmqp-source.1 man1/qshape.1
man5/cidr_table.5: ../proto/cidr_table
../mantools/srctoman - $? >$@
+man5/generics.5: ../proto/generics
+ ../mantools/srctoman - $? >$@
+
man5/header_checks.5: ../proto/header_checks
../mantools/srctoman - $? >$@
postalias(1), create/update/query alias database
postcat(1), examine Postfix queue file
postconf(1), Postfix configuration utility
+postfix(1), Postfix control program
postkick(1), trigger Postfix daemon
postlock(1), Postfix-compatible locking
postlog(1), Postfix-compatible logging
postmap(1), Postfix lookup table manager
postqueue(1), Postfix mail queue control
postsuper(1), Postfix housekeeping
+mailq(1), Sendmail compatibility interface
+newaliases(1), Sendmail compatibility interface
sendmail(1), Sendmail compatibility interface
Postfix configuration:
Table-driven mechanisms:
access(5), Postfix SMTP access control table
aliases(5), Postfix alias database
-header_checks(5), body_checks(5), content inspection
-canonical(5), Postfix address rewriting
+canonical(5), Postfix input address rewriting
+generics(5), Postfix output address rewriting
+header_checks(5), body_checks(5), Postfix content inspection
relocated(5), Users that have moved
transport(5), Postfix routing table
virtual(5), Postfix virtual aliasing
A list of address rewriting or forwarding mechanisms that
propagate an address extension from the original address
to the result. Specify zero or more of \fBcanonical\fR,
-\fBvirtual\fR, \fBalias\fR, \fBforward\fR, or \fBinclude\fR.
+\fBvirtual\fR, \fBalias\fR, \fBforward\fR, \fBinclude\fR,
+or \fBgenerics\fR.
.IP \fBowner_request_special\fR
Give special treatment to \fBowner-\fIlistname\fR and
\fIlistname\fB-request\fR
.fi
The optional \fBcanonical\fR(5) table specifies an address mapping for
local and non-local addresses. The mapping is used by the
-\fBcleanup\fR(8) daemon. The address mapping is recursive.
+\fBcleanup\fR(8) daemon, before mail is stored into the
+queue. The address mapping is recursive.
Normally, the \fBcanonical\fR(5) table is specified as a text file
that serves as input to the \fBpostmap\fR(1) command.
.nf
.ad
.fi
-make# The input format for the \fBpostmap\fR(1) command is as follows:
+The input format for the \fBpostmap\fR(1) command is as follows:
.IP "\fIpattern result\fR"
When \fIpattern\fR matches a mail address, replace it by the
corresponding \fIresult\fR.
.IP "multi-line text"
A logical line starts with non-whitespace text. A line that
starts with whitespace continues a logical line.
-.PP
+.SH "TABLE SEARCH ORDER"
+.na
+.nf
+.ad
+.fi
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 as
listed below:
.IP "\fIuser\fR@\fIdomain address\fR"
-\fIuser\fR@\fIdomain\fR is replaced by \fIaddress\fR. This form
+Replace \fIuser\fR@\fIdomain\fR by \fIaddress\fR. This form
has the highest precedence.
.sp
This is useful to clean up addresses produced by legacy mail systems.
It can also be used to produce \fIFirstname.Lastname\fR style
addresses, but see below for a simpler solution.
.IP "\fIuser address\fR"
-\fIuser\fR@\fIsite\fR is replaced by \fIaddress\fR when \fIsite\fR is
+Replace \fIuser\fR@\fIsite\fR by \fIaddress\fR when \fIsite\fR is
equal to $\fBmyorigin\fR, when \fIsite\fR is listed in
$\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR
or $\fBproxy_interfaces\fR.
This form is useful for replacing login names by
\fIFirstname.Lastname\fR.
.IP "@\fIdomain address\fR"
-Every address in \fIdomain\fR is replaced by \fIaddress\fR.
+Replace other addresses in \fIdomain\fR by \fIaddress\fR.
This form has the lowest precedence.
.PP
In all the above forms, when \fIaddress\fR has the form
A list of address rewriting or forwarding mechanisms that propagate
an address extension from the original address to the result.
Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
-\fBforward\fR, or \fBinclude\fR.
+\fBforward\fR, \fBinclude\fR, or \fBgenerics\fR.
.PP
Other parameters of interest:
.IP \fBinet_interfaces\fR
.IP "multi-line text"
A logical line starts with non-whitespace text. A line that
starts with whitespace continues a logical line.
-.SH "SEARCH ORDER"
+.SH "TABLE SEARCH ORDER"
.na
.nf
.ad
--- /dev/null
+.TH GENERICS 5
+.ad
+.fi
+.SH NAME
+generics
+\-
+Postfix generics table format
+.SH "SYNOPSIS"
+.na
+.nf
+\fBpostmap /etc/postfix/generics\fR
+
+\fBpostmap -q "\fIstring\fB" /etc/postfix/generics\fR
+
+\fBpostmap -q - /etc/postfix/generics <\fIinputfile\fR
+.SH DESCRIPTION
+.ad
+.fi
+The optional \fBgenerics\fR(5) table specifies an address
+mapping that applies when mail is delivered. This is the
+opposite of \fBcanonical\fR(5) mapping, which applies when
+mail is received.
+
+Typically, one would use the \fBgenerics\fR(5) table on a
+system that does not have a valid Internet domain name and
+that uses something like \fIlocaldomain.local\fR instead.
+The \fBgenerics\fR(5) table is then used by the \fBsmtp\fR(8)
+client to transform local mail addresses into valid Internet
+mail addresses when mail has to be sent across the Internet.
+See the EXAMPLE section at the end of this document.
+
+The \fBgenerics\fR(5) mapping affects both message header
+addresses (i.e. addresses that appear inside messages) and
+message envelope addresses (for example, the addresses that
+are used in SMTP protocol commands).
+
+Normally, the \fBgenerics\fR(5) table is specified as a
+text file that serves as input to the \fBpostmap\fR(1)
+command. The result, an indexed file in \fBdbm\fR or
+\fBdb\fR format, is used for fast searching by the mail
+system. Execute the command "\fBpostmap /etc/postfix/generics\fR"
+in order to rebuild the indexed file after changing the
+text file.
+
+When the table is provided via other means such as NIS, LDAP
+or SQL, the same lookups are done as for ordinary indexed files.
+
+Alternatively, the table can be provided as a regular-expression
+map where patterns are given as regular expressions, or lookups
+can be directed to TCP-based server. In that case, the lookups are
+done in a slightly different way as described below under
+"REGULAR EXPRESSION TABLES" and "TCP-BASED TABLES".
+.SH "TABLE FORMAT"
+.na
+.nf
+.ad
+.fi
+The input format for the \fBpostmap\fR(1) command is as follows:
+.IP "\fIpattern result\fR"
+When \fIpattern\fR matches a mail address, replace it by the
+corresponding \fIresult\fR.
+.IP "blank lines and comments"
+Empty lines and whitespace-only lines are ignored, as
+are lines whose first non-whitespace character is a `#'.
+.IP "multi-line text"
+A logical line starts with non-whitespace text. A line that
+starts with whitespace continues a logical line.
+.SH "TABLE SEARCH ORDER"
+.na
+.nf
+.ad
+.fi
+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 as
+listed below:
+.IP "\fIuser\fR@\fIdomain address\fR"
+Replace \fIuser\fR@\fIdomain\fR by \fIaddress\fR. This form
+has the highest precedence.
+.IP "\fIuser address\fR"
+Replace \fIuser\fR@\fIsite\fR by \fIaddress\fR when \fIsite\fR is
+equal to $\fBmyorigin\fR, when \fIsite\fR is listed in
+$\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR
+or $\fBproxy_interfaces\fR.
+.IP "@\fIdomain address\fR"
+Replace other addresses in \fIdomain\fR by \fIaddress\fR.
+This form has the lowest precedence.
+.PP
+In all the above forms, the result \fIaddress\fR must have
+the form \fIusername@domainname\fR.
+.SH "ADDRESS EXTENSION"
+.na
+.nf
+.fi
+.ad
+When a mail address localpart contains the optional recipient delimiter
+(e.g., \fIuser+foo\fR@\fIdomain\fR), the lookup order becomes:
+\fIuser+foo\fR@\fIdomain\fR, \fIuser\fR@\fIdomain\fR, \fIuser+foo\fR,
+\fIuser\fR, and @\fIdomain\fR.
+
+The \fBpropagate_unmatched_extensions\fR parameter controls whether
+an unmatched address extension (\fI+foo\fR) is propagated to the
+result of table lookup.
+.SH "REGULAR EXPRESSION TABLES"
+.na
+.nf
+.ad
+.fi
+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 \fBregexp_table\fR(5)
+or \fBpcre_table\fR(5).
+
+Each pattern is a regular expression that is applied to the entire
+address being looked up. Thus, \fIuser@domain\fR mail addresses are not
+broken up into their \fIuser\fR and \fI@domain\fR constituent parts,
+nor is \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR.
+
+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 \fB$1\fR, \fB$2\fR and so on.
+.SH "TCP-BASED TABLES"
+.na
+.nf
+.ad
+.fi
+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 \fBtcp_table\fR(5).
+This feature is not available up to and including Postfix version 2.2.
+
+Each lookup operation uses the entire address once. Thus,
+\fIuser@domain\fR mail addresses are not broken up into their
+\fIuser\fR and \fI@domain\fR constituent parts, nor is
+\fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR.
+
+Results are the same as with indexed file lookups.
+.SH "EXAMPLE"
+.na
+.nf
+.ad
+.fi
+The following shows a generic mapping with an indexed file.
+When mail is sent to a remote host via SMTP, this replaces
+\fIhis@localdomain.local\fR by his ISP mail address, replaces
+\fIher@localdomain.local\fR by her ISP mail address, and
+replaces other local addresses by his ISP account, with
+an address extension of \fI+local\fR (this example assumes
+that the ISP supports "+" style address extensions).
+
+.na
+.nf
+/etc/postfix/main.cf:
+.in +4
+ smtp_generics_maps = hash:/etc/postfix/generics
+.in -4
+
+/etc/postfix/generics:
+.in +4
+his@localdomain.local hisaccount@hisisp.example
+her@localdomain.local heraccount@herisp.example
+@localdomain.local hisaccount+local@hisisp.example
+.in -4
+
+.ad
+.fi
+Execute the command "\fBpostmap /etc/postfix/generics\fR"
+whenever the table is changed. Instead of \fBhash\fR, some
+systems use \fBdbm\fR database files. To find out what
+tables your system supports use the command "\fBpostconf
+-m\fR".
+.SH BUGS
+.ad
+.fi
+The table format does not understand quoting conventions.
+.SH "CONFIGURATION PARAMETERS"
+.na
+.nf
+.ad
+.fi
+The following \fBmain.cf\fR parameters are especially relevant.
+The text below provides only a parameter summary. See
+\fBpostconf\fR(5) for more details including examples.
+.IP \fBsmtp_generics_maps\fR
+Address mapping lookup table for envelope and header sender
+and recipient addresses while delivering mail via SMTP.
+.IP \fBpropagate_unmatched_extensions\fR
+A list of address rewriting or forwarding mechanisms that propagate
+an address extension from the original address to the result.
+Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
+\fBforward\fR, \fBinclude\fR, or \fBgenerics\fR.
+.PP
+Other parameters of interest:
+.IP \fBinet_interfaces\fR
+The network interface addresses that this system receives mail on.
+You need to stop and start Postfix when this parameter changes.
+.IP \fBproxy_interfaces\fR
+Other interfaces that this machine receives mail on by way of a
+proxy agent or network address translator.
+.IP \fBmydestination\fR
+List of domains that this mail system considers local.
+.IP \fBmyorigin\fR
+The domain that is appended to locally-posted mail.
+.IP \fBowner_request_special\fR
+Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR
+addresses.
+.SH "SEE ALSO"
+.na
+.nf
+postmap(1), Postfix lookup table manager
+postconf(5), configuration parameters
+smtp(8), Postfix SMTP client
+.SH "README FILES"
+.na
+.nf
+.ad
+.fi
+Use "\fBpostconf readme_directory\fR" or
+"\fBpostconf html_directory\fR" to locate this information.
+.na
+.nf
+DATABASE_README, Postfix lookup table overview
+ADDRESS_REWRITING_README, address rewriting guide
+.SH "LICENSE"
+.na
+.nf
+.ad
+.fi
+The Secure Mailer license must be distributed with this software.
+.SH "HISTORY"
+.na
+.nf
+A genericstable feature appears in the Sendmail MTA.
+
+This feature is available in Postfix 2.2 and later.
+.SH "AUTHOR(S)"
+.na
+.nf
+Wietse Venema
+IBM T.J. Watson Research
+P.O. Box 704
+Yorktown Heights, NY 10598, USA
domain name, but uses something like \fIlocaldomain.local\fR
instead.
.PP
-The table search order is described below. The search terminates
-when a match is found. In other words, the search is non-recursive.
-.IP "\fIuser@domain.tld address\fR"
-Replace \fIuser@domain.tld\fR by \fIaddress\fR. This
-form has the highest precedence.
-.IP "\fIuser address\fR"
-Replace \fIuser@site\fR by \fIaddress\fR when \fIsite\fR is
-equal to $myorigin, when \fIsite\fR is listed in $mydestination,
-or when it matches $inet_interfaces or $proxy_interfaces.
-.IP "\fI@domain.tld address\fR"
-Replace all other addresses in \fIdomain.tld\fR by
-\fIaddress\fR. This form has the lowest preference.
-.PP
-In all cases \fIaddress\fR must specify a username and a
-domain.
+The table format and lookups are documented in \fBgenerics\fR(5);
+examples are shown in the ADDRESS_REWRITING_README and
+STANDARD_CONFIGURATION_README documents.
+.PP
This feature is available in Postfix 2.2 and later.
.SH smtp_helo_name (default: $myhostname)
The hostname to send in the SMTP EHLO or HELO command.
.IP \(bu
A logical line starts with non-whitespace text. A line that
starts with whitespace continues a logical line.
-.PP
+.SH "TABLE SEARCH ORDER"
+.na
+.nf
+.ad
+.fi
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 as
listed below:
when \fIsite\fR is listed in $\fBmydestination\fR, or when \fIsite\fR
is listed in $\fBinet_interfaces\fR or $\fBproxy_interfaces\fR.
.IP @\fIdomain\fR
-Matches every address in \fIdomain\fR. This form has the lowest
+Matches every other address in \fIdomain\fR. This form has the lowest
precedence.
.SH "ADDRESS EXTENSION"
.na
The \fIresult\fR is of the form \fItransport:nexthop\fR and
specifies how or where to deliver mail. This is described in
section "RESULT FORMAT".
-.SH "TABLE LOOKUP"
+.SH "TABLE SEARCH ORDER"
.na
.nf
.ad
tables such as NIS, LDAP or SQL, patterns are tried in the order as
listed below:
.IP "\fIuser+extension@domain transport\fR:\fInexthop\fR"
-Mail for \fIuser+extension@domain\fR is delivered through
+Deliver mail for \fIuser+extension@domain\fR through
\fItransport\fR to
\fInexthop\fR.
.IP "\fIuser@domain transport\fR:\fInexthop\fR"
-Mail for \fIuser@domain\fR is delivered through \fItransport\fR to
+Deliver mail for \fIuser@domain\fR through \fItransport\fR to
\fInexthop\fR.
.IP "\fIdomain transport\fR:\fInexthop\fR"
-Mail for \fIdomain\fR is delivered through \fItransport\fR to
+Deliver mail for \fIdomain\fR through \fItransport\fR to
\fInexthop\fR.
.IP "\fI.domain transport\fR:\fInexthop\fR"
-Mail for any subdomain of \fIdomain\fR is delivered through
+Deliver mail for any subdomain of \fIdomain\fR through
\fItransport\fR to \fInexthop\fR. This applies only when the
string \fBtransport_maps\fR is not listed in the
\fBparent_domain_matches_subdomains\fR configuration setting.
.IP "multi-line text"
A logical line starts with non-whitespace text. A line that
starts with whitespace continues a logical line.
-.PP
+.SH "TABLE SEARCH ORDER"
+.na
+.nf
+.ad
+.fi
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 as
listed below:
.IP "\fIuser\fR@\fIdomain address, address, ...\fR"
-Mail for \fIuser\fR@\fIdomain\fR is redirected to \fIaddress\fR.
+Redirect mail for \fIuser\fR@\fIdomain\fR to \fIaddress\fR.
This form has the highest precedence.
.IP "\fIuser address, address, ...\fR"
-Mail for \fIuser\fR@\fIsite\fR is redirected to \fIaddress\fR when
+Redirect mail for \fIuser\fR@\fIsite\fR to \fIaddress\fR when
\fIsite\fR is equal to $\fBmyorigin\fR, when \fIsite\fR is listed in
$\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR
or $\fBproxy_interfaces\fR.
\fIaliases\fR(5) database. The difference is that \fBvirtual\fR(5)
mapping can be applied to non-local addresses.
.IP "@\fIdomain address, address, ...\fR"
-Mail for any user in \fIdomain\fR is redirected to \fIaddress\fR.
+Redirect mail for other users in \fIdomain\fR to \fIaddress\fR.
This form has the lowest precedence.
.PP
In all the above forms, when \fIaddress\fR has the form
A list of address rewriting or forwarding mechanisms that propagate
an address extension from the original address to the result.
Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
-\fBforward\fR, or \fBinclude\fR.
+\fBforward\fR, \fBinclude\fR, or \fBgenerics\fR.
.PP
Other parameters of interest:
.IP \fBinet_interfaces\fR
man/man8/oqmgr.8:55:.IP \fBbounce\fR
man/man8/qmgr.8:55:.IP \fBbounce\fR
man/man8/trivial-rewrite.8:21:.IP \fBlocal\fR
+man/man5/aliases.5:140:\fBvirtual\fR, \fBalias\fR, \fBforward\fR, \fBinclude\fR,
+man/man5/canonical.5:171:Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
+man/man5/generics.5:11:\fBpostmap /etc/postfix/generics\fR
+man/man5/generics.5:13:\fBpostmap -q "\fIstring\fB" /etc/postfix/generics\fR
+man/man5/generics.5:15:\fBpostmap -q - /etc/postfix/generics <\fIinputfile\fR
+man/man5/generics.5:189:Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
+man/man5/postconf.5:2446:and \fBvirtual\fR is likely to cause problems when mail is forwarded
+man/man5/postconf.5:4575:is \fBsmtpd\fR, corresponding to a SASL configuration file named
s/[<bB>]*access[<\/bB>]*\(5\)/<a href="access.5.html">$&<\/a>/g;
s/[<bB>]*aliases[<\/bB>]*\(5\)/<a href="aliases.5.html">$&<\/a>/g;
s/[<bB>]*canonical[<\/bB>]*\(5\)/<a href="canonical.5.html">$&<\/a>/g;
- s/[<bB>]*etrn[<\/bB>]*\(5\)/<a href="etrn.5.html">$&<\/a>/g;
+ s/[<bB>]*gener[-<\/bB>]*\n* *[<bB>]*ics[<\/bB>]*\(5\)/<a href="generics.5.html">$&<\/a>/g;
s/[<bB>]*ldap[<\/bBiI>]*_[<\/iIbB>]*table[<\/bB>]*\(5\)/<a href="ldap_table.5.html">$&<\/a>/g;
s/[<bB>]*mas[-<\/bB>]*\n* *[<bB>]*ter[<\/bB>]*\(5\)/<a href="master.5.html">$&<\/a>/g;
s/[<bB>]*mysql[<\/bBiI>]*_[<\/iIbB>]*table[<\/bB>]*\(5\)/<a href="mysql_table.5.html">$&<\/a>/g;
you want to send mail over the Internet, because many mail servers
reject mail addresses with invalid domain names. </p>
-<p> With the smtp_generics_maps parameter you can specify lookup
-tables that replace local mail addresses by valid Internet addresses
-when mail leaves the machine via SMTP. This mapping replaces envelope
-and header addresses, and is non-recursive. It does not happen when
-you send mail between addresses on the local machine. </p>
+<p> With the smtp_generics_maps parameter you can specify generics(5)
+lookup tables that replace local mail addresses by valid Internet
+addresses when mail leaves the machine via SMTP. The generics(5)
+mapping replaces envelope and header addresses, and is non-recursive.
+It does not happen when you send mail between addresses on the
+local machine. </p>
<p> This feature is available in Postfix version 2.2 and later.</p>
smtp_generics_maps = hash:/etc/postfix/generics
/etc/postfix/generics:
- you@localdomain.local youraccount@yourisp.example
+ his@localdomain.local hisaccount@hisisp.example
her@localdomain.local heraccount@herisp.example
- @localdomain.local youraccount+local@yourisp.example
+ @localdomain.local hisaccount+local@hisisp.example
</pre>
</blockquote>
-<p> When mail is sent to a remote host via SMTP, this replaces your
-local mail address <i>you@localdomain.local</i> by your ISP mail
-address, replaces <i>her@localdomain.local</i> by her ISP mail
-address, and replaces all other local addresses by your ISP account,
-with an address extension of +<i>local</i> (this example assumes
-that the ISP supports "+" style address extensions). </p>
+<p> When mail is sent to a remote host via SMTP, this replaces
+<i>his@localdomain.local</i> by his ISP mail address, replaces
+<i>her@localdomain.local</i> by her ISP mail address, and replaces
+other local addresses by his ISP account, with an address extension
+of +<i>local</i> (this example assumes that the ISP supports "+"
+style address extensions). </p>
<h3> <a name="aliases"> Local alias database </a> </h3>
# For now, just hard-coded rules.
CONFIG = ../conf/access ../conf/aliases ../conf/canonical ../conf/relocated \
- ../conf/transport ../conf/virtual ../conf/header_checks
+ ../conf/transport ../conf/virtual ../conf/header_checks \
+ ../conf/generics
HTML = ../html/ADDRESS_CLASS_README.html \
../html/ADDRESS_REWRITING_README.html \
../conf/canonical: canonical
$(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+../conf/generics: generics
+ $(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+
../conf/header_checks: header_checks
$(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
<li><a href="#dialup">Postfix on a dialup machine</a>
<li><a href="#fantasy">Postfix on hosts without a real
-hostname</a>
+Internet hostname</a>
</ul>
</blockquote>
<p> See also the section "<a href="#fantasy">Postfix on hosts without
-a real hostname</a>" if this is applicable to your configuration.
+a real Internet hostname</a>" if this is applicable to your configuration.
</p>
<h2><a name="null_client">Postfix on a null client</a></h2>
combine this with basic configuration information as discussed the
first half of this document. </p>
-<p> If you do not have your own hostname (as with dynamic IP
-addressing) then you should also study the section on "<a
-href="#fantasy">Postfix on hosts without a real hostname</a>".
-</p>
+<p> If you do not have your own hostname and IP address (usually
+with dialup, cable TV or DSL connections) then you should also
+study the section on "<a href="#fantasy">Postfix on hosts without
+a real Internet hostname</a>". </p>
<ul>
</ul>
-<h2><a name="fantasy">Postfix on hosts without a real hostname</a></h2>
+<h2><a name="fantasy">Postfix on hosts without a real Internet
+hostname</a></h2>
-<p> This section is for hosts that don't have an Internet hostname.
-Typically these are systems that get a dynamic IP address via DHCP
-or via dialup. Postfix will let you send and receive mail just fine
-between accounts on a machine with a fantasy name. However, you
-cannot use a fantasy hostname in your email address when sending
+<p> This section is for hosts that don't have their own Internet
+hostname. Typically these are systems that get a dynamic IP address
+via DHCP or via dialup. Postfix will let you send and receive mail
+just fine between accounts on a machine with a fantasy name. However,
+you cannot use a fantasy hostname in your email address when sending
mail into the Internet, because no-one would be able to reply to
-your mail. In fact, more and more sites refuse mail from non-existent
-domain names. </p>
+your mail. In fact, more and more sites refuse mail addresses with
+non-existent domain names. </p>
+
+<p> Note: the following information is Postfix version dependent.
+To find out what Postfix version you have, execute the command
+"<b>postconf mail_version</b>". </p>
+
+<h3>Postfix version 2.2 and later </h3>
+
+<p> Postfix 2.2 uses the generics(5) address mapping to replace
+local fantasy email addresses by valid Internet addresses. This
+mapping happens ONLY when mail leaves the machine; not when you
+send mail between users on the same machine. </p>
+
+<p> The following example presents additional configuration. You
+need to combine this with basic configuration information as
+discussed the first half of this document. </p>
+
+<blockquote>
+<pre>
+1 /etc/postfix/main.cf:
+2 smtp_generics_maps = hash:/etc/postfix/generics
+3
+4 /etc/postfix/generics:
+5 his@localdomain.local hisaccount@hisisp.example
+6 her@localdomain.local heraccount@herisp.example
+7 @localdomain.local hisaccount+local@hisisp.example
+</pre>
+</blockquote>
+
+<p> When mail is sent to a remote host via SMTP: </p>
+
+<ul>
+
+<li> <p> Line 5 replaces <i>his@localdomain.local</i> by his ISP
+mail address, </p>
+
+<li> <p> Line 6 replaces <i>her@localdomain.local</i> by her ISP
+mail address, and </p>
-<p> The perfect solution would be for Postfix to do a mapping from
-local fantasy email addresses to valid Internet addresses when mail
-leaves the machine (similar to Sendmail's generics table). This is
-planned for the near future. </p>
+<li> <p> Line 7 replaces other local addresses by his ISP account,
+with an address extension of +<i>local</i> (this example assumes
+that the ISP supports "+" style address extensions). </p>
+
+</ul>
+
+<p>Specify <b>dbm</b> instead of <b>hash</b> if your system uses
+<b>dbm</b> files instead of <b>db</b> files. To find out what lookup
+tables Postfix supports, use the command "<b>postconf -m</b>". </p>
-<p> In the mean time, the solution with Postfix is to use valid
+<p> Execute the command "<b>postmap /etc/postfix/generics</b>"
+whenever you change the generics table. </p>
+
+<h3>Postfix version 2.1 and earlier </h3>
+
+<p> The solution with older Postfix systems is to use valid
Internet addresses where possible, and to let Postfix map valid
Internet addresses to local fantasy addresses. With this, you can
send mail to the Internet and to local fantasy addresses, including
</ul>
+<p>Specify <b>dbm</b> instead of <b>hash</b> if your system uses
+<b>dbm</b> files instead of <b>db</b> files. To find out what lookup
+tables Postfix supports, use the command "<b>postconf -m</b>". </p>
+
+<p> Execute the command "<b>postmap /etc/postfix/canonical</b>"
+whenever you change the canonical table. </p>
+
+<p> Execute the command "<b>postmap /etc/postfix/virtual</b>"
+whenever you change the virtual table. </p>
+
</body>
</html>
# A list of address rewriting or forwarding mechanisms that
# propagate an address extension from the original address
# to the result. Specify zero or more of \fBcanonical\fR,
-# \fBvirtual\fR, \fBalias\fR, \fBforward\fR, or \fBinclude\fR.
+# \fBvirtual\fR, \fBalias\fR, \fBforward\fR, \fBinclude\fR,
+# or \fBgenerics\fR.
# .IP \fBowner_request_special\fR
# Give special treatment to \fBowner-\fIlistname\fR and
# \fIlistname\fB-request\fR
# DESCRIPTION
# The optional \fBcanonical\fR(5) table specifies an address mapping for
# local and non-local addresses. The mapping is used by the
-# \fBcleanup\fR(8) daemon. The address mapping is recursive.
+# \fBcleanup\fR(8) daemon, before mail is stored into the
+# queue. The address mapping is recursive.
#
# Normally, the \fBcanonical\fR(5) table is specified as a text file
# that serves as input to the \fBpostmap\fR(1) command.
# TABLE FORMAT
# .ad
# .fi
-make# The input format for the \fBpostmap\fR(1) command is as follows:
+# The input format for the \fBpostmap\fR(1) command is as follows:
# .IP "\fIpattern result\fR"
# When \fIpattern\fR matches a mail address, replace it by the
# corresponding \fIresult\fR.
# .IP "multi-line text"
# A logical line starts with non-whitespace text. A line that
# starts with whitespace continues a logical line.
-# .PP
+# TABLE SEARCH ORDER
+# .ad
+# .fi
# 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 as
# listed below:
# .IP "\fIuser\fR@\fIdomain address\fR"
-# \fIuser\fR@\fIdomain\fR is replaced by \fIaddress\fR. This form
+# Replace \fIuser\fR@\fIdomain\fR by \fIaddress\fR. This form
# has the highest precedence.
# .sp
# This is useful to clean up addresses produced by legacy mail systems.
# It can also be used to produce \fIFirstname.Lastname\fR style
# addresses, but see below for a simpler solution.
# .IP "\fIuser address\fR"
-# \fIuser\fR@\fIsite\fR is replaced by \fIaddress\fR when \fIsite\fR is
+# Replace \fIuser\fR@\fIsite\fR by \fIaddress\fR when \fIsite\fR is
# equal to $\fBmyorigin\fR, when \fIsite\fR is listed in
# $\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR
# or $\fBproxy_interfaces\fR.
# This form is useful for replacing login names by
# \fIFirstname.Lastname\fR.
# .IP "@\fIdomain address\fR"
-# Every address in \fIdomain\fR is replaced by \fIaddress\fR.
+# Replace other addresses in \fIdomain\fR by \fIaddress\fR.
# This form has the lowest precedence.
# .PP
# In all the above forms, when \fIaddress\fR has the form
# A list of address rewriting or forwarding mechanisms that propagate
# an address extension from the original address to the result.
# Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
-# \fBforward\fR, or \fBinclude\fR.
+# \fBforward\fR, \fBinclude\fR, or \fBgenerics\fR.
# .PP
# Other parameters of interest:
# .IP \fBinet_interfaces\fR
# .IP "multi-line text"
# A logical line starts with non-whitespace text. A line that
# starts with whitespace continues a logical line.
-# SEARCH ORDER
+# TABLE SEARCH ORDER
# .ad
# .fi
# Patterns are applied in the order as specified in the table, until a
--- /dev/null
+#++
+# NAME
+# generics 5
+# SUMMARY
+# Postfix generics table format
+# SYNOPSIS
+# \fBpostmap /etc/postfix/generics\fR
+#
+# \fBpostmap -q "\fIstring\fB" /etc/postfix/generics\fR
+#
+# \fBpostmap -q - /etc/postfix/generics <\fIinputfile\fR
+# DESCRIPTION
+# The optional \fBgenerics\fR(5) table specifies an address
+# mapping that applies when mail is delivered. This is the
+# opposite of \fBcanonical\fR(5) mapping, which applies when
+# mail is received.
+#
+# Typically, one would use the \fBgenerics\fR(5) table on a
+# system that does not have a valid Internet domain name and
+# that uses something like \fIlocaldomain.local\fR instead.
+# The \fBgenerics\fR(5) table is then used by the \fBsmtp\fR(8)
+# client to transform local mail addresses into valid Internet
+# mail addresses when mail has to be sent across the Internet.
+# See the EXAMPLE section at the end of this document.
+#
+# The \fBgenerics\fR(5) mapping affects both message header
+# addresses (i.e. addresses that appear inside messages) and
+# message envelope addresses (for example, the addresses that
+# are used in SMTP protocol commands).
+#
+# Normally, the \fBgenerics\fR(5) table is specified as a
+# text file that serves as input to the \fBpostmap\fR(1)
+# command. The result, an indexed file in \fBdbm\fR or
+# \fBdb\fR format, is used for fast searching by the mail
+# system. Execute the command "\fBpostmap /etc/postfix/generics\fR"
+# in order to rebuild the indexed file after changing the
+# text file.
+#
+# When the table is provided via other means such as NIS, LDAP
+# or SQL, the same lookups are done as for ordinary indexed files.
+#
+# Alternatively, the table can be provided as a regular-expression
+# map where patterns are given as regular expressions, or lookups
+# can be directed to TCP-based server. In that case, the lookups are
+# done in a slightly different way as described below under
+# "REGULAR EXPRESSION TABLES" and "TCP-BASED TABLES".
+# TABLE FORMAT
+# .ad
+# .fi
+# The input format for the \fBpostmap\fR(1) command is as follows:
+# .IP "\fIpattern result\fR"
+# When \fIpattern\fR matches a mail address, replace it by the
+# corresponding \fIresult\fR.
+# .IP "blank lines and comments"
+# Empty lines and whitespace-only lines are ignored, as
+# are lines whose first non-whitespace character is a `#'.
+# .IP "multi-line text"
+# A logical line starts with non-whitespace text. A line that
+# starts with whitespace continues a logical line.
+# TABLE SEARCH ORDER
+# .ad
+# .fi
+# 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 as
+# listed below:
+# .IP "\fIuser\fR@\fIdomain address\fR"
+# Replace \fIuser\fR@\fIdomain\fR by \fIaddress\fR. This form
+# has the highest precedence.
+# .IP "\fIuser address\fR"
+# Replace \fIuser\fR@\fIsite\fR by \fIaddress\fR when \fIsite\fR is
+# equal to $\fBmyorigin\fR, when \fIsite\fR is listed in
+# $\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR
+# or $\fBproxy_interfaces\fR.
+# .IP "@\fIdomain address\fR"
+# Replace other addresses in \fIdomain\fR by \fIaddress\fR.
+# This form has the lowest precedence.
+# .PP
+# In all the above forms, the result \fIaddress\fR must have
+# the form \fIusername@domainname\fR.
+# ADDRESS EXTENSION
+# .fi
+# .ad
+# When a mail address localpart contains the optional recipient delimiter
+# (e.g., \fIuser+foo\fR@\fIdomain\fR), the lookup order becomes:
+# \fIuser+foo\fR@\fIdomain\fR, \fIuser\fR@\fIdomain\fR, \fIuser+foo\fR,
+# \fIuser\fR, and @\fIdomain\fR.
+#
+# The \fBpropagate_unmatched_extensions\fR parameter controls whether
+# an unmatched address extension (\fI+foo\fR) is propagated to the
+# result of table lookup.
+# REGULAR EXPRESSION TABLES
+# .ad
+# .fi
+# 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 \fBregexp_table\fR(5)
+# or \fBpcre_table\fR(5).
+#
+# Each pattern is a regular expression that is applied to the entire
+# address being looked up. Thus, \fIuser@domain\fR mail addresses are not
+# broken up into their \fIuser\fR and \fI@domain\fR constituent parts,
+# nor is \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR.
+#
+# 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 \fB$1\fR, \fB$2\fR and so on.
+# TCP-BASED TABLES
+# .ad
+# .fi
+# 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 \fBtcp_table\fR(5).
+# This feature is not available up to and including Postfix version 2.2.
+#
+# Each lookup operation uses the entire address once. Thus,
+# \fIuser@domain\fR mail addresses are not broken up into their
+# \fIuser\fR and \fI@domain\fR constituent parts, nor is
+# \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR.
+#
+# Results are the same as with indexed file lookups.
+# EXAMPLE
+# .ad
+# .fi
+# The following shows a generic mapping with an indexed file.
+# When mail is sent to a remote host via SMTP, this replaces
+# \fIhis@localdomain.local\fR by his ISP mail address, replaces
+# \fIher@localdomain.local\fR by her ISP mail address, and
+# replaces other local addresses by his ISP account, with
+# an address extension of \fI+local\fR (this example assumes
+# that the ISP supports "+" style address extensions).
+#
+# .na
+# .nf
+# /etc/postfix/main.cf:
+# .in +4
+# smtp_generics_maps = hash:/etc/postfix/generics
+# .in -4
+#
+# /etc/postfix/generics:
+# .in +4
+# his@localdomain.local hisaccount@hisisp.example
+# her@localdomain.local heraccount@herisp.example
+# @localdomain.local hisaccount+local@hisisp.example
+# .in -4
+#
+# .ad
+# .fi
+# Execute the command "\fBpostmap /etc/postfix/generics\fR"
+# whenever the table is changed. Instead of \fBhash\fR, some
+# systems use \fBdbm\fR database files. To find out what
+# tables your system supports use the command "\fBpostconf
+# -m\fR".
+# BUGS
+# The table format does not understand quoting conventions.
+# CONFIGURATION PARAMETERS
+# .ad
+# .fi
+# The following \fBmain.cf\fR parameters are especially relevant.
+# The text below provides only a parameter summary. See
+# \fBpostconf\fR(5) for more details including examples.
+# .IP \fBsmtp_generics_maps\fR
+# Address mapping lookup table for envelope and header sender
+# and recipient addresses while delivering mail via SMTP.
+# .IP \fBpropagate_unmatched_extensions\fR
+# A list of address rewriting or forwarding mechanisms that propagate
+# an address extension from the original address to the result.
+# Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
+# \fBforward\fR, \fBinclude\fR, or \fBgenerics\fR.
+# .PP
+# Other parameters of interest:
+# .IP \fBinet_interfaces\fR
+# The network interface addresses that this system receives mail on.
+# You need to stop and start Postfix when this parameter changes.
+# .IP \fBproxy_interfaces\fR
+# Other interfaces that this machine receives mail on by way of a
+# proxy agent or network address translator.
+# .IP \fBmydestination\fR
+# List of domains that this mail system considers local.
+# .IP \fBmyorigin\fR
+# The domain that is appended to locally-posted mail.
+# .IP \fBowner_request_special\fR
+# Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR
+# addresses.
+# SEE ALSO
+# postmap(1), Postfix lookup table manager
+# postconf(5), configuration parameters
+# smtp(8), Postfix SMTP client
+# README FILES
+# .ad
+# .fi
+# Use "\fBpostconf readme_directory\fR" or
+# "\fBpostconf html_directory\fR" to locate this information.
+# .na
+# .nf
+# DATABASE_README, Postfix lookup table overview
+# ADDRESS_REWRITING_README, address rewriting guide
+# LICENSE
+# .ad
+# .fi
+# The Secure Mailer license must be distributed with this software.
+# HISTORY
+# A genericstable feature appears in the Sendmail MTA.
+#
+# This feature is available in Postfix 2.2 and later.
+# AUTHOR(S)
+# Wietse Venema
+# IBM T.J. Watson Research
+# P.O. Box 704
+# Yorktown Heights, NY 10598, USA
+#--
domain name, but uses something like <i>localdomain.local</i>
instead. </p>
-<p> The table search order is described below. The search terminates
-when a match is found. In other words, the search is non-recursive.
-</p>
-
-<dl>
-
-<dt> <i>user@domain.tld address</i> </dt>
+<p> The table format and lookups are documented in generics(5);
+examples are shown in the ADDRESS_REWRITING_README and
+STANDARD_CONFIGURATION_README documents. </p>
-<dd> <p> Replace <i>user@domain.tld</i> by <i>address</i>. This
-form has the highest precedence. </p> </dd>
-
-<dt> <i>user address</i> </dt>
-
-<dd> <p> Replace <i>user@site</i> by <i>address</i> when <i>site</i> is
-equal to $myorigin, when <i>site</i> is listed in $mydestination,
-or when it matches $inet_interfaces or $proxy_interfaces. </p>
-</dd>
-
-<dt> <i>@domain.tld address</i> </dt>
-
-<dd> <p> Replace all other addresses in <i>domain.tld</i> by
-<i>address</i>. This form has the lowest preference. </p> </dd>
-
-</dl>
-
-<p> In all cases <i>address</i> must specify a username and a
-domain. </p> <p> This feature is available in Postfix 2.2 and later.
-</p>
+<p> This feature is available in Postfix 2.2 and later. </p>
# .IP \(bu
# A logical line starts with non-whitespace text. A line that
# starts with whitespace continues a logical line.
-# .PP
+# TABLE SEARCH ORDER
+# .ad
+# .fi
# 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 as
# listed below:
# when \fIsite\fR is listed in $\fBmydestination\fR, or when \fIsite\fR
# is listed in $\fBinet_interfaces\fR or $\fBproxy_interfaces\fR.
# .IP @\fIdomain\fR
-# Matches every address in \fIdomain\fR. This form has the lowest
+# Matches other addresses in \fIdomain\fR. This form has the lowest
# precedence.
# ADDRESS EXTENSION
# .fi
# The \fIresult\fR is of the form \fItransport:nexthop\fR and
# specifies how or where to deliver mail. This is described in
# section "RESULT FORMAT".
-# TABLE LOOKUP
+# TABLE SEARCH ORDER
# .ad
# .fi
# 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 as
# listed below:
# .IP "\fIuser+extension@domain transport\fR:\fInexthop\fR"
-# Mail for \fIuser+extension@domain\fR is delivered through
+# Deliver mail for \fIuser+extension@domain\fR through
# \fItransport\fR to
# \fInexthop\fR.
# .IP "\fIuser@domain transport\fR:\fInexthop\fR"
-# Mail for \fIuser@domain\fR is delivered through \fItransport\fR to
+# Deliver mail for \fIuser@domain\fR through \fItransport\fR to
# \fInexthop\fR.
# .IP "\fIdomain transport\fR:\fInexthop\fR"
-# Mail for \fIdomain\fR is delivered through \fItransport\fR to
+# Deliver mail for \fIdomain\fR through \fItransport\fR to
# \fInexthop\fR.
# .IP "\fI.domain transport\fR:\fInexthop\fR"
-# Mail for any subdomain of \fIdomain\fR is delivered through
+# Deliver mail for any subdomain of \fIdomain\fR through
# \fItransport\fR to \fInexthop\fR. This applies only when the
# string \fBtransport_maps\fR is not listed in the
# \fBparent_domain_matches_subdomains\fR configuration setting.
# .IP "multi-line text"
# A logical line starts with non-whitespace text. A line that
# starts with whitespace continues a logical line.
-# .PP
+# TABLE SEARCH ORDER
+# .ad
+# .fi
# 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 as
# listed below:
# .IP "\fIuser\fR@\fIdomain address, address, ...\fR"
-# Mail for \fIuser\fR@\fIdomain\fR is redirected to \fIaddress\fR.
+# Redirect mail for \fIuser\fR@\fIdomain\fR to \fIaddress\fR.
# This form has the highest precedence.
# .IP "\fIuser address, address, ...\fR"
-# Mail for \fIuser\fR@\fIsite\fR is redirected to \fIaddress\fR when
+# Redirect mail for \fIuser\fR@\fIsite\fR to \fIaddress\fR when
# \fIsite\fR is equal to $\fBmyorigin\fR, when \fIsite\fR is listed in
# $\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR
# or $\fBproxy_interfaces\fR.
# \fIaliases\fR(5) database. The difference is that \fBvirtual\fR(5)
# mapping can be applied to non-local addresses.
# .IP "@\fIdomain address, address, ...\fR"
-# Mail for any user in \fIdomain\fR is redirected to \fIaddress\fR.
+# Redirect mail for other users in \fIdomain\fR to \fIaddress\fR.
# This form has the lowest precedence.
# .PP
# In all the above forms, when \fIaddress\fR has the form
# A list of address rewriting or forwarding mechanisms that propagate
# an address extension from the original address to the result.
# Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
-# \fBforward\fR, or \fBinclude\fR.
+# \fBforward\fR, \fBinclude\fR, or \fBgenerics\fR.
# .PP
# Other parameters of interest:
# .IP \fBinet_interfaces\fR
{
const char *optional_text = value + strcspn(value, " \t");
int command_len = optional_text - value;
+ VSTRING *bp;
while (*optional_text && ISSPACE(*optional_text))
optional_text++;
if (STREQUAL(value, "REPLACE", command_len)) {
if (*optional_text == 0) {
msg_warn("REPLACE action without text in %s map", map_class);
- } else if (strcmp(context, CLEANUP_ACT_CTXT_HEADER) == 0
- && !is_header(optional_text)) {
- msg_warn("bad REPLACE header text \"%s\" in %s map, "
- "need \"headername: headervalue\"",
- optional_text, map_class);
+ return (CLEANUP_ACT_KEEP);
+ } else if (strcmp(context, CLEANUP_ACT_CTXT_HEADER) == 0) {
+ if (!is_header(optional_text)) {
+ msg_warn("bad REPLACE header text \"%s\" in %s map, "
+ "need \"headername: headervalue\"",
+ optional_text, map_class);
+ return (CLEANUP_ACT_KEEP);
+ }
+ /* XXX Impedance mismatch. */
+ bp = vstring_strcpy(vstring_alloc(100), optional_text);
+ cleanup_out_header(state, bp);
+ vstring_free(bp);
} else {
- cleanup_act_log(state, "replace", context, buf, optional_text);
cleanup_out_string(state, REC_TYPE_NORM, optional_text);
}
+ cleanup_act_log(state, "replace", context, buf, optional_text);
return (CLEANUP_ACT_DROP);
}
if (STREQUAL(value, "REDIRECT", command_len)) {
* Patches change the patchlevel and the release date. Snapshots change the
* release date only.
*/
-#define MAIL_RELEASE_DATE "20050206"
+#define MAIL_RELEASE_DATE "20050207"
#define MAIL_VERSION_NUMBER "2.2"
#define VAR_MAIL_VERSION "mail_version"
/* postalias(1), create/update/query alias database
/* postcat(1), examine Postfix queue file
/* postconf(1), Postfix configuration utility
+/* postfix(1), Postfix control program
/* postkick(1), trigger Postfix daemon
/* postlock(1), Postfix-compatible locking
/* postlog(1), Postfix-compatible logging
/* postmap(1), Postfix lookup table manager
/* postqueue(1), Postfix mail queue control
/* postsuper(1), Postfix housekeeping
+/* mailq(1), Sendmail compatibility interface
+/* newaliases(1), Sendmail compatibility interface
/* sendmail(1), Sendmail compatibility interface
/*
/* Postfix configuration:
/* Table-driven mechanisms:
/* access(5), Postfix SMTP access control table
/* aliases(5), Postfix alias database
-/* header_checks(5), body_checks(5), content inspection
-/* canonical(5), Postfix address rewriting
+/* canonical(5), Postfix input address rewriting
+/* generics(5), Postfix output address rewriting
+/* header_checks(5), body_checks(5), Postfix content inspection
/* relocated(5), Users that have moved
/* transport(5), Postfix routing table
/* virtual(5), Postfix virtual aliasing