From 3414d539d23eaf9976edbe2c042c9b70e973a665 Mon Sep 17 00:00:00 2001
From: Wietse Venema
Date: Mon, 7 Feb 2005 00:00:00 -0500
Subject: [PATCH] postfix-2.2-20050207
---
postfix/HISTORY | 23 +-
postfix/README_FILES/ADDRESS_REWRITING_README | 24 +-
.../STANDARD_CONFIGURATION_README | 79 ++++--
postfix/conf/aliases | 4 +-
postfix/conf/canonical | 26 +-
postfix/conf/generics | 224 ++++++++++++++++
postfix/conf/postfix-files | 3 +
postfix/conf/relocated | 5 +-
postfix/conf/transport | 22 +-
postfix/conf/virtual | 21 +-
postfix/html/ADDRESS_REWRITING_README.html | 27 +-
postfix/html/Makefile.in | 6 +-
.../html/STANDARD_CONFIGURATION_README.html | 96 +++++--
postfix/html/aliases.5.html | 4 +-
postfix/html/canonical.5.html | 26 +-
postfix/html/cidr_table.5.html | 2 +-
postfix/html/generics.5.html | 229 ++++++++++++++++
postfix/html/postconf.5.html | 31 +--
postfix/html/postfix-manuals.html | 12 +-
postfix/html/postfix.1.html | 8 +-
postfix/html/relocated.5.html | 5 +-
postfix/html/transport.5.html | 22 +-
postfix/html/virtual.5.html | 21 +-
postfix/man/Makefile.in | 6 +-
postfix/man/man1/postfix.1 | 8 +-
postfix/man/man5/aliases.5 | 3 +-
postfix/man/man5/canonical.5 | 19 +-
postfix/man/man5/cidr_table.5 | 2 +-
postfix/man/man5/generics.5 | 244 ++++++++++++++++++
postfix/man/man5/postconf.5 | 17 +-
postfix/man/man5/relocated.5 | 8 +-
postfix/man/man5/transport.5 | 10 +-
postfix/man/man5/virtual.5 | 14 +-
postfix/mantools/manlint.stop | 8 +
postfix/mantools/postlink | 2 +-
postfix/proto/ADDRESS_REWRITING_README.html | 27 +-
postfix/proto/Makefile.in | 6 +-
.../proto/STANDARD_CONFIGURATION_README.html | 96 +++++--
postfix/proto/aliases | 3 +-
postfix/proto/canonical | 17 +-
postfix/proto/cidr_table | 2 +-
postfix/proto/generics | 213 +++++++++++++++
postfix/proto/postconf.proto | 31 +--
postfix/proto/relocated | 6 +-
postfix/proto/transport | 10 +-
postfix/proto/virtual | 12 +-
postfix/src/cleanup/cleanup_message.c | 20 +-
postfix/src/global/mail_version.h | 2 +-
postfix/src/postfix/postfix.c | 8 +-
49 files changed, 1408 insertions(+), 306 deletions(-)
create mode 100644 postfix/conf/generics
create mode 100644 postfix/html/generics.5.html
create mode 100644 postfix/man/man5/generics.5
create mode 100644 postfix/proto/generics
diff --git a/postfix/HISTORY b/postfix/HISTORY
index 9dc7db36c..f710bce07 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -10286,19 +10286,28 @@ Apologies for any names omitted.
Cleanup: don't panic in mymalloc() when master can't find
any IP addresses. LaMont Jones. File: master/master_ent.c.
+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.
+
+ 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.
+
+ 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: document generics mapping in BASIC_CONFIGURATION_README.
-
- Med: local and remote source port and IP address for
- smtpd policy hook.
+ 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?
diff --git a/postfix/README_FILES/ADDRESS_REWRITING_README b/postfix/README_FILES/ADDRESS_REWRITING_README
index 183eb8896..d3f3e0f45 100644
--- a/postfix/README_FILES/ADDRESS_REWRITING_README
+++ b/postfix/README_FILES/ADDRESS_REWRITING_README
@@ -607,11 +607,11 @@ localdomain.local. This can be a problem when you want to send mail over the
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.
@@ -621,15 +621,15 @@ Example:
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).
LLooccaall aalliiaass ddaattaabbaassee
diff --git a/postfix/README_FILES/STANDARD_CONFIGURATION_README b/postfix/README_FILES/STANDARD_CONFIGURATION_README
index 7c177af93..755b939ad 100644
--- a/postfix/README_FILES/STANDARD_CONFIGURATION_README
+++ b/postfix/README_FILES/STANDARD_CONFIGURATION_README
@@ -25,7 +25,7 @@ in specific environments.
* 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
PPoossttffiixx oonn aa ssttaanndd--aalloonnee IInntteerrnneett hhoosstt
@@ -49,8 +49,8 @@ document:
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.
PPoossttffiixx oonn aa nnuullll cclliieenntt
@@ -443,8 +443,9 @@ dialup connections that are up 24x7, see the local area network section above.
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
@@ -501,21 +502,56 @@ should also study the section on "Postfix on hosts without a real hostname".
the "sseennddmmaaiill --qq" command every now and then while the dialup link is up,
so that newly-posted mail is flushed from the queue.
-PPoossttffiixx oonn hhoossttss wwiitthhoouutt aa rreeaall hhoossttnnaammee
+PPoossttffiixx oonn hhoossttss wwiitthhoouutt aa rreeaall IInntteerrnneett hhoossttnnaammee
-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 "ppoossttccoonnff mmaaiill__vveerrssiioonn".
-In the mean time, the solution with Postfix is to use valid Internet addresses
+PPoossttffiixx vveerrssiioonn 22..22 aanndd llaatteerr
+
+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,
+
+ * 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 ddbbmm instead of hhaasshh if your system uses ddbbmm files instead of ddbb files.
+To find out what lookup tables Postfix supports, use the command "ppoossttccoonnff --mm".
+
+Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//ggeenneerriiccss" whenever you change the
+generics table.
+
+PPoossttffiixx vveerrssiioonn 22..11 aanndd eeaarrlliieerr
+
+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
@@ -553,3 +589,12 @@ Translation:
instead of sending it to the ISP. This part is not required but is
convenient.
+Specify ddbbmm instead of hhaasshh if your system uses ddbbmm files instead of ddbb files.
+To find out what lookup tables Postfix supports, use the command "ppoossttccoonnff --mm".
+
+Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//ccaannoonniiccaall" whenever you change the
+canonical table.
+
+Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//vviirrttuuaall" whenever you change the
+virtual table.
+
diff --git a/postfix/conf/aliases b/postfix/conf/aliases
index 935638688..b13f4047c 100644
--- a/postfix/conf/aliases
+++ b/postfix/conf/aliases
@@ -180,8 +180,8 @@ decode: root
# 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-
diff --git a/postfix/conf/canonical b/postfix/conf/canonical
index e2eacf381..d835107cc 100644
--- a/postfix/conf/canonical
+++ b/postfix/conf/canonical
@@ -13,8 +13,8 @@
# 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
@@ -53,8 +53,7 @@
# 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
@@ -70,13 +69,14 @@
# 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-
@@ -84,17 +84,17 @@
# 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.
@@ -170,8 +170,8 @@
# 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:
#
diff --git a/postfix/conf/generics b/postfix/conf/generics
new file mode 100644
index 000000000..164226a39
--- /dev/null
+++ b/postfix/conf/generics
@@ -0,0 +1,224 @@
+# 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 localdomain.local. This can be a problem when
you want to send mail over the 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.
@@ -962,18 +963,18 @@ you send mail between addresses on the local machine.
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).
diff --git a/postfix/html/Makefile.in b/postfix/html/Makefile.in
index e573cb5a4..39dd1a732 100644
--- a/postfix/html/Makefile.in
+++ b/postfix/html/Makefile.in
@@ -18,7 +18,7 @@ CONFIG = access.5.html aliases.5.html canonical.5.html relocated.5.html \
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)\"`"
@@ -241,6 +241,10 @@ header_checks.5.html: ../proto/header_checks
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 >$@
diff --git a/postfix/html/STANDARD_CONFIGURATION_README.html b/postfix/html/STANDARD_CONFIGURATION_README.html
index 855747fca..5febf7130 100644
--- a/postfix/html/STANDARD_CONFIGURATION_README.html
+++ b/postfix/html/STANDARD_CONFIGURATION_README.html
@@ -56,7 +56,7 @@ site
Postfix on a dialup machine
Postfix on hosts without a real
-hostname
+Internet hostname
@@ -88,7 +88,7 @@ what is covered in the BASIC_CONFIGURA
See also the section "Postfix on hosts without
-a real hostname" if this is applicable to your configuration.
+a real Internet hostname
" if this is applicable to your configuration.
@@ -610,10 +610,10 @@ href="#local_network">local area network section above.
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".
@@ -689,23 +689,71 @@ newly-posted mail is flushed from the queue.
-
+
- 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
+
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.
+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
+"postconf mail_version".
- In the mean time, the solution with Postfix is to use valid
+
Postfix version 2.2 and later
+
+ 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,
+
+ -
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 dbm instead of hash if your system uses
+dbm files instead of db files. To find out what lookup
+tables Postfix supports, use the command "postconf -m".
+
+ Execute the command "postmap /etc/postfix/generics"
+whenever you change the generics table.
+
+Postfix version 2.1 and earlier
+
+ 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
@@ -753,6 +801,16 @@ but is convenient.
+
Specify dbm instead of hash if your system uses
+dbm files instead of db files. To find out what lookup
+tables Postfix supports, use the command "postconf -m".
+
+ Execute the command "postmap /etc/postfix/canonical"
+whenever you change the canonical table.
+
+ Execute the command "postmap /etc/postfix/virtual"
+whenever you change the virtual table.
+