to control the delay before sending .<CR><LF> (default: 10
seconds) when doing the PIX <CR><LF>.<CR><LF> workaround.
+20011210
+
+ Bugfix: the 20011128 change in sendmail and postdrop did
+ not handle the case of message_size_limit=0. Fix by Will
+ Day, Georgia Tech.
+
+20011212
+
+ Compatibility: The SMTP server now accepts <CR><CR><LF> as
+ if the client sent <CR><LF>. Reportedly, some badly written
+ windows software produces such garbage, and some badly
+ written windows anti-VIRUS software cannot handle such
+ garbage. File: global/smtp_stream.c.
+
+20011214
+
+ Bugfix: postmap/postalias queries ignored the -f flag.
+ Reported by Hamish Marson.
+
+20011215-6
+
+ Safety: config file comments no longer span multiple lines
+ when the next line starts with whitespace; a comment that
+ is preceded by whitespace does not break multi-line input.
+
Open problems:
Low: after reorganizing configuration parameters, add flags
maps, or else accidents are bound to happen.
Medium: need in-process caching for map lookups. LDAP
- servers seem to need this in particular.
+ servers seem to need this in particular. Need a way to
+ expire cached results that are too old.
Medium: make address rewriting on/off configurable for
envelopes and/or headers.
--- /dev/null
+> Also, what considerations are there for file locking or other potential
+> problems when running Postfix with a Netapp-style box for /var/mail
+> delivery? I know that FreeBSD has broken NFS file locking (both client
+> and server?) but I'm not sure if this is something Postfix can work around
+> or not.
+
+Postfix jumps several hoops in order to deal with NFS-specific
+brain damage, however some operations can fail irrecoverably. This
+is why Wietse makes no promises about Postfix reliability on NFS.
+
+For queue locking, NFS is not an issue because you cannot share
+Postfix queues between Postfix instances anyawy.
+
+For mailbox locking, some systems such as FreeBSD use flock() by
+default. flock() does not work over NFS. This causes loss of mail
+when multiple hosts access the same mailboxes.
+
+In order to have mailbox locking over NFS you have to configure
+everything to use fcntl() locks for mailbox access (or switch to
+maildir style). With Postfix you'd specify:
+
+ virtual_mailbox_lock = fcntl
+ mailbox_delivery_lock = fcntl
+
+This is useful only if all mailbox access software uses fcntl()
+locks. I have no information on how well fcntl() locks work on NFS.
+
+You can also "play safe" and try to throw in username.lock files:
+
+ virtual_mailbox_lock = fcntl, dotlock
+ mailbox_delivery_lock = fcntl, dotlock
+
+this is the mix that many packages end up using.
+Incompatible changes with snapshot-20011216
+===========================================
+
+Postfix configuration file comments no longer span multiple lines
+when the next line starts with whitespace. This may cause unexpected
+behavior with existing, improperly formatted, configuration files.
+
+Major changes with snapshot-20011216
+====================================
+
+Postfix configuration files now support whitespace before comments.
+This allows you to comment out just one line in the middle of a
+block of multi-line input.
+
Incompatible changes with snapshot-20011210
===========================================
startup procedure now warns if "system" directories (etc, bin, lib,
usr) under the Postfix top-level queue directory are not owned by
the super-user (usually the result of well-intended, but misguided,
-applications of "chroot -R postfix /var/spool/postfix).
+applications of "chown -R postfix /var/spool/postfix).
The Postfix sendmail command no longer exits with status 1 when
mail submission fails, but instead returns a sendmail-compatible
# TABLE FORMAT
# The format of the access table is as follows:
#
-# blanks and comments
-# Blank lines are ignored, as are lines beginning
-# with `#'.
-#
-# leading whitespace
-# Lines that begin with whitespace continue the pre-
-# vious line.
-#
# pattern action
# When pattern matches a mail address, domain or host
# address, perform the corresponding action.
#
+# multi-line text
+# A line that starts with whitespace (space or tab)
+# is a continuation of the previous line. An empty
+# line terminates the previous line, as does a line
+# that starts with non-whitespace (text or comment).
+# A comment line that starts with whitespace does not
+# terminate multi-line text.
+#
+# comments
+# The # is recognized as the start of a comment, but
+# only when it is the first non-whitespace character
+# on a line. A comment terminates at the end of the
+# line, even when the next line starts with whites-
+# pace.
+#
# PATTERNS
# With lookups from indexed files such as DB or DBM, or from
-# networked tables such as NIS, LDAP or SQL, patterns are
+# networked tables such as NIS, LDAP or SQL, patterns are
# tried in the order as listed below:
#
# user@domain
# Matches the specified mail address.
#
# domain.name
-# Matches the domain.name itself and any subdomain
-# thereof, either in hostnames or in mail addresses.
-#
-# 1
-#
-# ACCESS(5) ACCESS(5)
-#
+# Matches the domain.name itself and any subdomain
+# thereof, either in hostnames or in mail addresses.
# Top-level domains will never be matched.
#
-# user@ Matches all mail addresses with the specified user
+# user@ Matches all mail addresses with the specified user
# part.
#
# net.work.addr.ess
#
# net.work
#
-# net Matches any host address in the specified network.
-# A network address is a sequence of one or more
+# net Matches any host address in the specified network.
+# A network address is a sequence of one or more
# octets separated by ".".
#
# ACTIONS
# [45]NN text
-# Reject the address etc. that matches the pattern,
+# Reject the address etc. that matches the pattern,
# and respond with the numerical code and text.
#
# REJECT Reject the address etc. that matches the pattern. A
# reject_unauth_destination, and so on).
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# 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,
+# 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
+# Each pattern is a regular expression that is applied to
# the entire string being looked up. Depending on the appli-
-# cation, that string is an entire client hostname, an
+# cation, that string is an entire client hostname, an
# entire client IP address, or an entire mail address. Thus,
-# no parent domain or parent network search is done, and
-# user@domain mail addresses are not broken up into their
+# no parent domain or parent network search is done, and
+# user@domain mail addresses are not broken up into their
# user@ and domain constituent parts.
#
-# Patterns are applied in the order as specified in the
-# table, until a pattern is found that matches the search
+# Patterns are applied in the order as specified in the
+# table, until a pattern is found that matches the search
# string.
#
-# Actions are the same as with normal indexed file lookups,
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# Actions are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
+# from the pattern can be interpolated as $1, $2 and so on.
#
# BUGS
-# The table format does not understand quoting conventions.
-#
-# 2
-#
-# ACCESS(5) ACCESS(5)
+# The table format does not understand quoting conventions.
#
# SEE ALSO
# postmap(1) create mapping table
# regexp_table(5) format of POSIX regular expression tables
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#
-# 3
+# 1
#
#
# name: value1, value2, ...
#
-# o Lines that begin with whitespace continue the pre-
-# vious line.
-#
-# o Blank lines are ignored, as are lines beginning
-# with `#'.
-#
-# The name is a local address (no domain part). Use double
-# quotes when the name contains any special characters such
-# as whitespace, `#', `:', or `@'. The name is folded to
+# o A line that starts with whitespace (space or tab)
+# is a continuation of the previous line. An empty
+# line terminates the previous line, as does a line
+# that starts with non-whitespace (text or comment).
+# A comment line that starts with whitespace does not
+# terminate multi-line text.
+#
+# o The # is recognized as the start of a comment, but
+# only when it is the first non-whitespace character
+# on a line. A comment terminates at the end of the
+# line, even when the next line starts with whites-
+# pace.
+#
+# The name is a local address (no domain part). Use double
+# quotes when the name contains any special characters such
+# as whitespace, `#', `:', or `@'. The name is folded to
# lowercase, in order to make database lookups case insensi-
# tive.
#
# In addition, when an alias exists for owner-name, delivery
-# diagnostics are directed to that address, instead of to
+# diagnostics are directed to that address, instead of to
# the originator. This is typically used to direct delivery
-# errors to the owner of a mailing list, who is in a better
-# position to deal with mailing list delivery problems than
+# errors to the owner of a mailing list, who is in a better
+# position to deal with mailing list delivery problems than
# the originator of the undelivered mail.
#
# The value contains one or more of the following:
#
-# 1
-#
-# ALIASES(5) ALIASES(5)
-#
# address
-# Mail is forwarded to address, which is compatible
+# Mail is forwarded to address, which is compatible
# with the RFC 822 standard.
#
# /file/name
-# Mail is appended to /file/name. See local(8) for
-# details of delivery to file. Delivery is not lim-
-# ited to regular files. For example, to dispose of
+# Mail is appended to /file/name. See local(8) for
+# details of delivery to file. Delivery is not lim-
+# ited to regular files. For example, to dispose of
# unwanted mail, deflect it to /dev/null.
#
# |command
-# Mail is piped into command. Commands that contain
-# special characters, such as whitespace, should be
-# enclosed between double quotes. See local(8) for
+# Mail is piped into command. Commands that contain
+# special characters, such as whitespace, should be
+# enclosed between double quotes. See local(8) for
# details of delivery to command.
#
# When the command fails, a limited amount of command
-# output is mailed back to the sender. The file
-# /usr/include/sysexits.h defines the expected exit
-# status codes. For example, use |"exit 67" to simu-
-# late a "user unknown" error, and |"exit 0" to
+# output is mailed back to the sender. The file
+# /usr/include/sysexits.h defines the expected exit
+# status codes. For example, use |"exit 67" to simu-
+# late a "user unknown" error, and |"exit 0" to
# implement an expensive black hole.
#
# :include:/file/name
-# Mail is sent to the destinations listed in the
+# Mail is sent to the destinations listed in the
# named file. Lines in :include: files have the same
# syntax as the right-hand side of alias entries.
#
#
# ADDRESS EXTENSION
# When alias database search fails, and the recipient local-
-# part contains the optional recipient delimiter (e.g.,
-# user+foo), the search is repeated for the unextended
+# part contains the optional recipient delimiter (e.g.,
+# user+foo), the search is repeated for the unextended
# address (e.g., user).
#
# CONFIGURATION PARAMETERS
-# The following main.cf parameters are especially relevant
-# to this topic. See the Postfix main.cf file for syntax
-# details and for default values. Use the postfix reload
+# The following main.cf parameters are especially relevant
+# to this topic. See the Postfix main.cf file for syntax
+# details and for default values. Use the postfix reload
# command after a configuration change.
#
# alias_maps
# List of alias databases.
#
# allow_mail_to_commands
-# Restrict the usage of mail delivery to external
+# Restrict the usage of mail delivery to external
# command.
#
-# 2
-#
-# ALIASES(5) ALIASES(5)
-#
# allow_mail_to_files
-# Restrict the usage of mail delivery to external
+# Restrict the usage of mail delivery to external
# file.
#
# expand_owner_alias
# When delivering to an alias that has an owner- com-
-# panion alias, set the envelope sender address to
-# the right-hand side of the owner alias, instead
+# panion alias, set the envelope sender address to
+# the right-hand side of the owner alias, instead
# using of the left-hand side address.
#
# owner_request_special
# addresses.
#
# recipient_delimiter
-# Delimiter that separates recipients from address
+# Delimiter that separates recipients from address
# extensions.
#
# STANDARDS
# postalias(1) alias database management
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#
-# 3
+# 1
#
# TABLE FORMAT
# The format of the canonical table is as follows:
#
-# blanks and comments
-# Blank lines are ignored, as are lines beginning
-# with `#'.
-#
-# leading whitespace
-# Lines that begin with whitespace continue the pre-
-# vious line.
-#
-# 1
-#
-# CANONICAL(5) CANONICAL(5)
-#
# pattern result
# When pattern matches a mail address, replace it by
# the corresponding result.
#
+# multi-line text
+# A line that starts with whitespace (space or tab)
+# is a continuation of the previous line. An empty
+# line terminates the previous line, as does a line
+# that starts with non-whitespace (text or comment).
+# A comment line that starts with whitespace does not
+# terminate multi-line text.
+#
+# comments
+# The # is recognized as the start of a comment, but
+# only when it is the first non-whitespace character
+# on a line. A comment terminates at the end of the
+# line, even when the next line starts with whites-
+# pace.
+#
# With lookups from indexed files such as DB or DBM, or from
-# networked tables such as NIS, LDAP or SQL, patterns are
+# 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
+# user@domain is replaced by address. This form has
# the highest precedence.
#
-# This form useful to clean up addresses produced by
-# legacy mail systems. It can also be used to pro-
-# duce Firstname.Lastname style addresses, but see
+# This form useful to clean up addresses produced by
+# legacy mail systems. It can also be used to pro-
+# duce Firstname.Lastname style addresses, but see
# 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-
+# to $myorigin, when site is listed in $mydestina-
# tion, or when it is listed in $inet_interfaces.
#
-# This form is useful for replacing login names by
+# This form is useful for replacing login names by
# Firstname.Lastname.
#
# @domain address
-# Every address in domain is replaced by address.
+# Every address in domain is replaced by address.
# This form has the lowest precedence.
#
-# In all the above forms, when address has the form @other-
+# In all the above forms, when address has the form @other-
# domain, the result is the same user in otherdomain.
#
# ADDRESS EXTENSION
-# When table lookup fails, and the address localpart con-
-# tains the optional recipient delimiter (e.g.,
-# user+foo@domain), the search is repeated for the unex-
-# tended address (e.g. user@domain), and the unmatched
+# When table lookup fails, and the address localpart con-
+# tains the optional recipient delimiter (e.g.,
+# user+foo@domain), the search is repeated for the unex-
+# tended address (e.g. user@domain), and the unmatched
# extension is propagated to the result of table lookup. The
# matching order is: user+foo@domain, user@domain, user+foo,
# user, and @domain.
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# 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,
+# 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
+# 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
+# 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
-#
-# 2
-#
-# CANONICAL(5) CANONICAL(5)
-#
-# table, until a pattern is found that matches the search
+# 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 normal indexed file lookups,
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# Results are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
+# from the pattern can be interpolated as $1, $2 and so on.
#
# BUGS
-# The table format does not understand quoting conventions.
+# The table format does not understand quoting conventions.
#
# CONFIGURATION PARAMETERS
-# The following main.cf parameters are especially relevant
-# to this topic. See the Postfix main.cf file for syntax
-# details and for default values. Use the postfix reload
+# The following main.cf parameters are especially relevant
+# to this topic. See the Postfix main.cf file for syntax
+# details and for default values. Use the postfix reload
# command after a configuration change.
#
# canonical_maps
# Other parameters of interest:
#
# inet_interfaces
-# The network interface addresses that this system
+# The network interface addresses that this system
# receives mail on.
#
# masquerade_classes
-# List of address classes subject to masquerading:
-# zero or more of envelope_sender, envelope_recipi-
+# List of address classes subject to masquerading:
+# zero or more of envelope_sender, envelope_recipi-
# ent, header_sender, header_recipient.
#
# masquerade_domains
-# List of domains that hide their subdomain struc-
+# List of domains that hide their subdomain struc-
# ture.
#
# masquerade_exceptions
-# List of user names that are not subject to address
+# List of user names that are not subject to address
# masquerading.
#
# mydestination
-# List of domains that this mail system considers
+# List of domains that this mail system considers
# local.
#
# myorigin
# The domain that is appended to locally-posted mail.
#
-# 3
-#
-# CANONICAL(5) CANONICAL(5)
-#
# owner_request_special
# Give special treatment to owner-xxx and xxx-request
# addresses.
# regexp_table(5) format of POSIX regular expression tables
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#
-# 4
+# 1
#
#
# The general form of a PCRE table is:
#
-# blanks and comments
-# Blank lines are ignored, as are lines beginning
-# with `#'.
-#
-# leading whitespace
-# Lines that begin with whitespace continue the pre-
-# vious line.
-#
# pattern result
# When pattern matches a search string, use the cor-
-# responding result. A line that starts with white
-# space continues the preceding line.
+# responding result.
+#
+# multi-line text
+# A line that starts with whitespace (space or tab)
+# is a continuation of the previous line. An empty
+# line terminates the previous line, as does a line
+# that starts with non-whitespace (text or comment).
+# A comment line that starts with whitespace does not
+# terminate multi-line text.
+#
+# comments
+# The # is recognized as the start of a comment, but
+# only when it is the first non-whitespace character
+# on a line. A comment terminates at the end of the
+# line, even when the next line starts with whites-
+# pace.
#
# Each pattern is a perl-like regular expression. The
# expression delimiter can be any character, except whites-
# table, until a pattern is found that matches the search
# string.
#
-# 1
-#
-# PCRE_TABLE(5) PCRE_TABLE(5)
-#
# Substitution of substrings from the matched expression
# into the result string is possible using the conventional
# perl syntax ($1, $2, etc.). The macros in the result
#
# EXAMPLE HEADER FILTER MAP
# /^Subject: make money fast/ REJECT
-# /^To: friend@public\.com/ REJECT
+# /^To: friend@public\.com/ REJECT
#
# SEE ALSO
# regexp_table(5) format of POSIX regular expression tables
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#
-# 2
+# 1
#
#
# The general form of a Postfix regular expression table is:
#
-# blanks and comments
-# Blank lines are ignored, as are lines beginning
-# with `#'.
-#
-# leading whitespace
-# Lines that begin with whitespace continue the pre-
-# vious line.
-#
# pattern result
# When pattern matches a search string, use the cor-
-# responding result. A line that starts with white
-# space continues the preceding line.
+# responding result.
+#
+# multi-line text
+# A line that starts with whitespace (space or tab)
+# is a continuation of the previous line. An empty
+# line terminates the previous line, as does a line
+# that starts with non-whitespace (text or comment).
+# A comment line that starts with whitespace does not
+# terminate multi-line text.
+#
+# comments
+# The # is recognized as the start of a comment, but
+# only when it is the first non-whitespace character
+# on a line. A comment terminates at the end of the
+# line, even when the next line starts with whites-
+# pace.
#
# pattern1!pattern2 result
# Matches pattern1 but not pattern2.
# nor is user+foo broken up into user and foo.
#
# Patterns are applied in the order as specified in the
-#
-# 1
-#
-# REGEXP_TABLE(5) REGEXP_TABLE(5)
-#
# table, until a pattern is found that matches the search
# string.
#
# EXAMPLE SMTPD ACCESS MAP
# # Disallow sender-specified routing. This is a must if you relay mail
# # for other domains.
-# /[%!@].*[%!@]/ 550 Sender-specified routing rejected
+# /[%!@].*[%!@]/ 550 Sender-specified routing rejected
#
# # Postmaster is OK, that way they can talk to us about how to fix
# # their problem.
-# /^postmaster@/ OK
+# /^postmaster@/ OK
#
# # Protect your outgoing majordomo exploders
-# /^(.*)-outgoing@(.*)$/!/^owner-/ 550 Use ${1}@${2} instead
+# /^(.*)-outgoing@(.*)$/!/^owner-/ 550 Use ${1}@${2} instead
#
# EXAMPLE HEADER FILTER MAP
# # These were once common in junk mail.
# /^Subject: make money fast/ REJECT
-# /^To: friend@public\.com/ REJECT
+# /^To: friend@public\.com/ REJECT
#
# SEE ALSO
# pcre_table(5) format of PCRE tables
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#
-# 2
+# 1
#
# TABLE FORMAT
# The format of the table is as follows:
#
-# o Blank lines are ignored, as are lines beginning
-# with `#'.
-#
-# o Lines that begin with whitespace continue the pre-
-# vious line.
-#
# o An entry has one of the following form:
# key new_location
# Where new_location specifies contact information
# such as an email address, or perhaps a street
# address or telephone number.
#
+# o A line that starts with whitespace (space or tab)
+# is a continuation of the previous line. An empty
+# line terminates the previous line, as does a line
+# that starts with non-whitespace (text or comment).
+# A comment line that starts with whitespace does not
+# terminate multi-line text.
+#
+# o The # is recognized as the start of a comment, but
+# only when it is the first non-whitespace character
+# on a line. A comment terminates at the end of the
+# line, even when the next line starts with whites-
+# pace.
+#
# With lookups from indexed files such as DB or DBM, or from
-# networked tables such as NIS, LDAP or SQL, the key field
+# networked tables such as NIS, LDAP or SQL, the key field
# is one of the following:
#
# user@domain
-# Matches user@domain. This form has precedence over
+# Matches user@domain. This form has precedence over
# all other forms.
#
# user Matches user@site when site is $myorigin, when site
# is listed in $mydestination, or when site is listed
-#
-# 1
-#
-# RELOCATED(5) RELOCATED(5)
-#
# in $inet_interfaces.
#
# @domain
-# Matches every address in domain. This form has the
+# Matches every address in domain. This form has the
# lowest precedence.
#
# ADDRESS EXTENSION
-# When the search fails, and the address localpart contains
-# the optional recipient delimiter (e.g., user+foo@domain),
-# the search is repeated for the unextended address (e.g.
+# When the search fails, and the address localpart contains
+# the optional recipient delimiter (e.g., user+foo@domain),
+# the search is repeated for the unextended address (e.g.
# user@domain).
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# 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,
+# 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
+# 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
+# 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
+# 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 normal indexed file lookups,
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# Results are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
+# from the pattern can be interpolated as $1, $2 and so on.
#
# BUGS
-# The table format does not understand quoting conventions.
+# The table format does not understand quoting conventions.
#
# CONFIGURATION PARAMETERS
-# The following main.cf parameters are especially relevant
-# to this topic. See the Postfix main.cf file for syntax
-# details and for default values. Use the postfix reload
+# The following main.cf parameters are especially relevant
+# to this topic. See the Postfix main.cf file for syntax
+# details and for default values. Use the postfix reload
# command after a configuration change.
#
# relocated_maps
# Other parameters of interest:
#
# inet_interfaces
-# The network interface addresses that this system
+# The network interface addresses that this system
# receives mail on.
#
# mydestination
-# List of domains that this mail system considers
+# List of domains that this mail system considers
# local.
#
-# 2
-#
-# RELOCATED(5) RELOCATED(5)
-#
# myorigin
# The domain that is appended to locally-posted mail.
#
# regexp_table(5) format of POSIX regular expression tables
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#
-# 3
+# 1
#
# REJECT text.... The text is sent to the originator.
# IGNORE The header line is silently discarded.
# WARN The header is logged (not rejected) with a warning.
-
-/^Subject: Make Money Fast/ REJECT
-/^To: friend@public.com/ REJECT
# TABLE FORMAT
# The format of the transport table is as follows:
#
-# blanks and comments
-# Blank lines are ignored, as are lines beginning
-# with `#'.
-#
-# leading whitespace
-# Lines that begin with whitespace continue the pre-
-# vious line.
-#
# pattern result
# When pattern matches the domain, use the corre-
# sponding result.
#
+# multi-line text
+# A line that starts with whitespace (space or tab)
+# is a continuation of the previous line. An empty
+# line terminates the previous line, as does a line
+# that starts with non-whitespace (text or comment).
+# A comment line that starts with whitespace does not
+# terminate multi-line text.
+#
+# comments
+# The # is recognized as the start of a comment, but
+# only when it is the first non-whitespace character
+# on a line. A comment terminates at the end of the
+# line, even when the next line starts with whites-
+# pace.
+#
# With lookups from indexed files such as DB or DBM, or from
-# networked tables such as NIS, LDAP or SQL, patterns are
+# networked tables such as NIS, LDAP or SQL, patterns are
# tried in the order as listed below:
#
# domain transport:nexthop
-# Mail for domain is delivered through transport to
+# Mail for domain is delivered through transport to
# nexthop.
#
# .domain transport:nexthop
-# Mail for any subdomain of domain is delivered
+# Mail for any subdomain of domain is delivered
# through transport to nexthop.
#
-# 1
-#
-# TRANSPORT(5) TRANSPORT(5)
-#
-# Note: transport map entries take precedence over domains
-# specified in the mydestination parameter. If you use the
+# Note: transport map entries take precedence over domains
+# specified in the mydestination parameter. If you use the
# optional transport map, it may be safer to specify
-# explicit entries for all domains specified in mydestina-
+# explicit entries for all domains specified in mydestina-
# tion, for example:
#
# hostname.my.domain local:
# localhost.my.domain local:
#
-# The interpretation of the nexthop field is transport
+# The interpretation of the nexthop field is transport
# dependent. In the case of SMTP, specify host:service for a
-# non-default server port, and use [host] or [host]:port in
-# order to disable MX (mail exchanger) DNS lookups. The []
-# form can also be used with IP addresses instead of host-
+# non-default server port, and use [host] or [host]:port in
+# order to disable MX (mail exchanger) DNS lookups. The []
+# form can also be used with IP addresses instead of host-
# names.
#
# EXAMPLES
-# In order to send mail for foo.org and its subdomains via
+# In order to send mail for foo.org and its subdomains via
# the uucp transport to the UUCP host named foo:
#
# foo.org uucp:foo
# .foo.org uucp:foo
#
-# When no nexthop host name is specified, the destination
-# domain name is used instead. For example, the following
-# directs mail for user@foo.org via the slow transport to a
-# mail exchanger for foo.org. The slow transport could be
-# something that runs at most one delivery process at a
+# When no nexthop host name is specified, the destination
+# domain name is used instead. For example, the following
+# directs mail for user@foo.org via the slow transport to a
+# mail exchanger for foo.org. The slow transport could be
+# something that runs at most one delivery process at a
# time:
#
# foo.org slow:
#
-# When no transport is specified, the default transport is
+# When no transport is specified, the default transport is
# used, as specified via the default_transport configuration
-# parameter. The following sends all mail for foo.org and
+# parameter. The following sends all mail for foo.org and
# its subdomains to host gateway.foo.org:
#
# foo.org :[gateway.foo.org]
# .foo.org :[gateway.foo.org]
#
-# In the above example, the [] are used to suppress MX
-# lookups. The result would likely point to your local
+# In the above example, the [] are used to suppress MX
+# lookups. The result would likely point to your local
# machine.
#
-# In the case of delivery via SMTP, one may specify host-
+# In the case of delivery via SMTP, one may specify host-
# name:service instead of just a host:
#
# foo.org smtp:bar.org:2025
#
-# This directs mail for user@foo.org to host bar.org port
-# 2025. Instead of a numerical port a symbolic name may be
-# used. Specify [] around the hostname in order to disable
+# This directs mail for user@foo.org to host bar.org port
+# 2025. Instead of a numerical port a symbolic name may be
+# used. Specify [] around the hostname in order to disable
# MX lookups.
#
-# 2
-#
-# TRANSPORT(5) TRANSPORT(5)
-#
# The error mailer can be used to bounce mail:
#
-# .foo.org error:mail for *.foo.org is not deliv-
+# .foo.org error:mail for *.foo.org is not deliv-
# erable
#
-# This causes all mail for user@anything.foo.org to be
+# This causes all mail for user@anything.foo.org to be
# bounced.
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# 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,
+# 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
+# Each pattern is a regular expression that is applied to
# the entire domain being looked up. Thus, some.domain.hier-
# archy is not broken up into parent domains.
#
-# Patterns are applied in the order as specified in the
-# table, until a pattern is found that matches the search
+# 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 normal indexed file lookups,
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# Results are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
+# from the pattern can be interpolated as $1, $2 and so on.
#
# CONFIGURATION PARAMETERS
-# The following main.cf parameters are especially relevant
-# to this topic. See the Postfix main.cf file for syntax
-# details and for default values. Use the postfix reload
+# The following main.cf parameters are especially relevant
+# to this topic. See the Postfix main.cf file for syntax
+# details and for default values. Use the postfix reload
# command after a configuration change.
#
# parent_domain_matches_subdomains (versions >= 20011119)
-# List of Postfix features that use domain.name pat-
+# List of Postfix features that use domain.name pat-
# terns to match sub.domain.name (as opposed to
# requiring .domain.name patterns).
#
# Other parameters of interest:
#
# default_transport
-# The transport to use when no transport is explic-
+# The transport to use when no transport is explic-
# itly specified.
#
# relayhost
# postmap(1) create mapping table
# trivial-rewrite(8) rewrite and resolve addresses
# pcre_table(5) format of PCRE tables
-#
-# 3
-#
-# TRANSPORT(5) TRANSPORT(5)
-#
# regexp_table(5) format of POSIX regular expression tables
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#
-# 4
+# 1
#
# user1@virtual.domain address1
# user2@virtual.domain address2, address3
#
-# The virtual.domain anything entry is required for a
-#
-# 1
-#
-# VIRTUAL(5) VIRTUAL(5)
-#
-# Postfix-style virtual domain.
+# The virtual.domain anything entry is required for a Post-
+# fix-style virtual domain.
#
# Do not list a Postfix-style virtual domain in the main.cf
# mydestination configuration parameter. Such an entry is
# The main.cf mydestination entry is required for a Send-
# mail-style virtual domain.
#
-# Do not specify a virtual.domain whatever virtual map entry
+# Do not specify a virtual.domain anything virtual map entry
# for a Sendmail-style virtual domain. Such an entry is
# required only with a Postfix-style virtual domain.
#
# The format of the virtual table is as follows, mappings
# being tried in the order as listed in this manual page:
#
-# blanks and comments
-# Blank lines are ignored, as are lines beginning
-# with `#'.
-#
-# leading whitespace
-# Lines that begin with whitespace continue the
-#
-# 2
-#
-# VIRTUAL(5) VIRTUAL(5)
-#
-# previous line.
-#
# pattern result
# When pattern matches a mail address, replace it by
# the corresponding result.
#
+# multi-line text
+# A line that starts with whitespace (space or tab)
+# is a continuation of the previous line. An empty
+# line terminates the previous line, as does a line
+# that starts with non-whitespace (text or comment).
+# A comment line that starts with whitespace does not
+# terminate multi-line text.
+#
+# comments
+# The # is recognized as the start of a comment, but
+# only when it is the first non-whitespace character
+# on a line. A comment terminates at the end of the
+# line, even when the next line starts with whites-
+# pace.
+#
# With lookups from indexed files such as DB or DBM, or from
-# networked tables such as NIS, LDAP or SQL, patterns are
+# 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.
+# Mail for user@domain is redirected 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
+# 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.
#
-# This functionality overlaps with functionality of
+# This functionality overlaps with functionality of
# the local alias(5) database. The difference is that
-# virtual mapping can be applied to non-local
+# virtual mapping can be applied to non-local
# addresses.
#
# @domain address, address, ...
-# Mail for any user in domain is redirected to
+# Mail for any user in domain is redirected 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
+# In all the above forms, when address has the form @other-
+# domain, the result is the same user in otherdomain. This
# works for the first address in the expansion only.
#
# ADDRESS EXTENSION
-# When the search fails, and the address localpart contains
-# the optional recipient delimiter (e.g., user+foo@domain),
-# the search is repeated for the unextended address (e.g.
+# When the search fails, and the address localpart contains
+# the optional recipient delimiter (e.g., user+foo@domain),
+# the search is repeated for the unextended address (e.g.
# user@domain), and the unmatched address extension is prop-
-# agated to the result of expansion. The matching order is:
+# agated to the result of expansion. The matching order is:
# user+foo@domain, user@domain, user+foo, user, and @domain.
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# 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,
+# 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
+# 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
+# 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
-#
-# 3
-#
-# VIRTUAL(5) VIRTUAL(5)
-#
-# table, until a pattern is found that matches the search
+# 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 normal indexed file lookups,
-# with the additional feature that parenthesized substrings
-# from the pattern can be interpolated as $1, $2 and so on.
+# Results are the same as with normal indexed file lookups,
+# with the additional feature that parenthesized substrings
+# from the pattern can be interpolated as $1, $2 and so on.
#
# BUGS
-# The table format does not understand quoting conventions.
+# The table format does not understand quoting conventions.
#
# CONFIGURATION PARAMETERS
-# The following main.cf parameters are especially relevant
-# to this topic. See the Postfix main.cf file for syntax
-# details and for default values. Use the postfix reload
+# The following main.cf parameters are especially relevant
+# to this topic. See the Postfix main.cf file for syntax
+# details and for default values. Use the postfix reload
# command after a configuration change.
#
# virtual_maps
# Other parameters of interest:
#
# inet_interfaces
-# The network interface addresses that this system
+# The network interface addresses that this system
# receives mail on.
#
# mydestination
-# List of domains that this mail system considers
+# List of domains that this mail system considers
# local.
#
# myorigin
# regexp_table(5) format of POSIX regular expression tables
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#
-# 4
+# 1
#
<b>TABLE</b> <b>FORMAT</b>
The format of the access table is as follows:
- blanks and comments
- Blank lines are ignored, as are lines beginning
- with `#'.
-
- leading whitespace
- Lines that begin with whitespace continue the pre-
- vious line.
-
<i>pattern</i> <i>action</i>
When <i>pattern</i> matches a mail address, domain or host
address, perform the corresponding <i>action</i>.
+ multi-line text
+ A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ comments
+ The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
+
<b>PATTERNS</b>
With lookups from indexed files such as DB or DBM, or from
- networked tables such as NIS, LDAP or SQL, patterns are
+ networked tables such as NIS, LDAP or SQL, patterns are
tried in the order as listed below:
<i>user</i>@<i>domain</i>
Matches the specified mail address.
<i>domain.name</i>
- Matches the <i>domain.name</i> itself and any subdomain
- thereof, either in hostnames or in mail addresses.
+ Matches the <i>domain.name</i> itself and any subdomain
+ thereof, either in hostnames or in mail addresses.
Top-level domains will never be matched.
- <i>user</i>@ Matches all mail addresses with the specified user
+ <i>user</i>@ Matches all mail addresses with the specified user
part.
<i>net.work.addr.ess</i>
<i>net.work</i>
- <i>net</i> Matches any host address in the specified network.
- A network address is a sequence of one or more
+ <i>net</i> Matches any host address in the specified network.
+ A network address is a sequence of one or more
octets separated by ".".
<b>ACTIONS</b>
[<b>45</b>]<i>NN</i> <i>text</i>
- Reject the address etc. that matches the pattern,
+ Reject the address etc. that matches the pattern,
and respond with the numerical code and text.
<b>REJECT</b> Reject the address etc. that matches the pattern. A
<b>reject</b><i>_</i><b>unauth</b><i>_</i><b>destination</b>, and so on).
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
- This section describes how the table lookups change when
+ 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,
+ a description of regular expression lookup table syntax,
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
- Each pattern is a regular expression that is applied to
+ Each pattern is a regular expression that is applied to
the entire string being looked up. Depending on the appli-
- cation, that string is an entire client hostname, an
+ cation, that string is an entire client hostname, an
entire client IP address, or an entire mail address. Thus,
- no parent domain or parent network search is done, and
- <i>user@domain</i> mail addresses are not broken up into their
+ no parent domain or parent network search is done, and
+ <i>user@domain</i> mail addresses are not broken up into their
<i>user@</i> and <i>domain</i> constituent parts.
- Patterns are applied in the order as specified in the
- table, until a pattern is found that matches the search
+ Patterns are applied in the order as specified in the
+ table, until a pattern is found that matches the search
string.
- Actions are the same as with normal 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.
+ Actions are the same as with normal 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>BUGS</b>
- The table format does not understand quoting conventions.
+ The table format does not understand quoting conventions.
<b>SEE</b> <b>ALSO</b>
<a href="postmap.1.html">postmap(1)</a> create mapping table
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
<i>name</i>: <i>value1</i>, <i>value2</i>, <i>...</i>
- <b>o</b> Lines that begin with whitespace continue the pre-
- vious line.
-
- <b>o</b> Blank lines are ignored, as are lines beginning
- with `#'.
-
- The <i>name</i> is a local address (no domain part). Use double
- quotes when the name contains any special characters such
- as whitespace, `#', `:', or `@'. The <i>name</i> is folded to
+ <b>o</b> A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ <b>o</b> The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
+
+ The <i>name</i> is a local address (no domain part). Use double
+ quotes when the name contains any special characters such
+ as whitespace, `#', `:', or `@'. The <i>name</i> is folded to
lowercase, in order to make database lookups case insensi-
tive.
In addition, when an alias exists for <b>owner-</b><i>name</i>, delivery
- diagnostics are directed to that address, instead of to
+ diagnostics are directed to that address, instead of to
the originator. This is typically used to direct delivery
- errors to the owner of a mailing list, who is in a better
- position to deal with mailing list delivery problems than
+ errors to the owner of a mailing list, who is in a better
+ position to deal with mailing list delivery problems than
the originator of the undelivered mail.
The <i>value</i> contains one or more of the following:
<i>address</i>
- Mail is forwarded to <i>address</i>, which is compatible
+ Mail is forwarded to <i>address</i>, which is compatible
with the <a href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a> standard.
<i>/file/name</i>
- Mail is appended to <i>/file/name</i>. See <a href="local.8.html"><b>local</b>(8)</a> for
- details of delivery to file. Delivery is not lim-
- ited to regular files. For example, to dispose of
+ Mail is appended to <i>/file/name</i>. See <a href="local.8.html"><b>local</b>(8)</a> for
+ details of delivery to file. Delivery is not lim-
+ ited to regular files. For example, to dispose of
unwanted mail, deflect it to <b>/dev/null</b>.
|<i>command</i>
- Mail is piped into <i>command</i>. Commands that contain
- special characters, such as whitespace, should be
- enclosed between double quotes. See <a href="local.8.html"><b>local</b>(8)</a> for
+ Mail is piped into <i>command</i>. Commands that contain
+ special characters, such as whitespace, should be
+ enclosed between double quotes. See <a href="local.8.html"><b>local</b>(8)</a> for
details of delivery to command.
When the command fails, a limited amount of command
- output is mailed back to the sender. The file
- <b>/usr/include/sysexits.h</b> defines the expected exit
- status codes. For example, use <b>|"exit</b> <b>67"</b> to simu-
- late a "user unknown" error, and <b>|"exit</b> <b>0"</b> to
+ output is mailed back to the sender. The file
+ <b>/usr/include/sysexits.h</b> defines the expected exit
+ status codes. For example, use <b>|"exit</b> <b>67"</b> to simu-
+ late a "user unknown" error, and <b>|"exit</b> <b>0"</b> to
implement an expensive black hole.
<b>:include:</b><i>/file/name</i>
- Mail is sent to the destinations listed in the
+ Mail is sent to the destinations listed in the
named file. Lines in <b>:include:</b> files have the same
syntax as the right-hand side of alias entries.
<b>ADDRESS</b> <b>EXTENSION</b>
When alias database search fails, and the recipient local-
- part contains the optional recipient delimiter (e.g.,
- <i>user+foo</i>), the search is repeated for the unextended
+ part contains the optional recipient delimiter (e.g.,
+ <i>user+foo</i>), the search is repeated for the unextended
address (e.g., <i>user</i>).
<b>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this topic. See the Postfix <b>main.cf</b> file for syntax
- details and for default values. Use the <b>postfix</b> <b>reload</b>
+ The following <b>main.cf</b> parameters are especially relevant
+ to this topic. See the Postfix <b>main.cf</b> file for syntax
+ details and for default values. Use the <b>postfix</b> <b>reload</b>
command after a configuration change.
<b>alias</b><i>_</i><b>maps</b>
List of alias databases.
<b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>commands</b>
- Restrict the usage of mail delivery to external
+ Restrict the usage of mail delivery to external
command.
<b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>files</b>
- Restrict the usage of mail delivery to external
+ Restrict the usage of mail delivery to external
file.
<b>expand</b><i>_</i><b>owner</b><i>_</i><b>alias</b>
When delivering to an alias that has an <b>owner-</b> com-
- panion alias, set the envelope sender address to
- the right-hand side of the owner alias, instead
+ panion alias, set the envelope sender address to
+ the right-hand side of the owner alias, instead
using of the left-hand side address.
<b>owner</b><i>_</i><b>request</b><i>_</i><b>special</b>
addresses.
<b>recipient</b><i>_</i><b>delimiter</b>
- Delimiter that separates recipients from address
+ Delimiter that separates recipients from address
extensions.
<b>STANDARDS</b>
<a href="postalias.1.html">postalias(1)</a> alias database management
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
<b>TABLE</b> <b>FORMAT</b>
The format of the <b>canonical</b> table is as follows:
- blanks and comments
- Blank lines are ignored, as are lines beginning
- with `#'.
-
- leading whitespace
- Lines that begin with whitespace continue the pre-
- vious line.
-
<i>pattern</i> <i>result</i>
When <i>pattern</i> matches a mail address, replace it by
the corresponding <i>result</i>.
+ multi-line text
+ A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ comments
+ The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
+
With lookups from indexed files such as DB or DBM, or from
- networked tables such as NIS, LDAP or SQL, patterns are
+ networked tables such as NIS, LDAP or SQL, patterns are
tried in the order as listed below:
<i>user</i>@<i>domain</i> <i>address</i>
- <i>user</i>@<i>domain</i> is replaced by <i>address</i>. This form has
+ <i>user</i>@<i>domain</i> is replaced by <i>address</i>. This form has
the highest precedence.
- This form useful to clean up addresses produced by
- legacy mail systems. It can also be used to pro-
- duce <i>Firstname.Lastname</i> style addresses, but see
+ This form useful to clean up addresses produced by
+ legacy mail systems. It can also be used to pro-
+ duce <i>Firstname.Lastname</i> style addresses, but see
below for a simpler solution.
<i>user</i> <i>address</i>
<i>user</i>@<i>site</i> is replaced by <i>address</i> when <i>site</i> is equal
- to $<b>myorigin</b>, when <i>site</i> is listed in $<b>mydestina-</b>
+ to $<b>myorigin</b>, when <i>site</i> is listed in $<b>mydestina-</b>
<b>tion</b>, or when it is listed in $<b>inet</b><i>_</i><b>interfaces</b>.
- This form is useful for replacing login names by
+ This form is useful for replacing login names by
<i>Firstname.Lastname</i>.
@<i>domain</i> <i>address</i>
- Every address in <i>domain</i> is replaced by <i>address</i>.
+ Every address in <i>domain</i> is replaced 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>
+ 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>.
<b>ADDRESS</b> <b>EXTENSION</b>
- When table lookup fails, and the address localpart con-
- tains the optional recipient delimiter (e.g.,
- <i>user+foo</i>@<i>domain</i>), the search is repeated for the unex-
- tended address (e.g. <i>user</i>@<i>domain</i>), and the unmatched
+ When table lookup fails, and the address localpart con-
+ tains the optional recipient delimiter (e.g.,
+ <i>user+foo</i>@<i>domain</i>), the search is repeated for the unex-
+ tended address (e.g. <i>user</i>@<i>domain</i>), and the unmatched
extension is propagated to the result of table lookup. The
matching order is: <i>user+foo</i>@<i>domain</i>, <i>user</i>@<i>domain</i>, <i>user+foo</i>,
<i>user</i>, and @<i>domain</i>.
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
- This section describes how the table lookups change when
+ 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,
+ a description of regular expression lookup table syntax,
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
- Each pattern is a regular expression that is applied to
+ 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>
+ 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
+ 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 normal 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.
+ Results are the same as with normal 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>BUGS</b>
- The table format does not understand quoting conventions.
+ The table format does not understand quoting conventions.
<b>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this topic. See the Postfix <b>main.cf</b> file for syntax
- details and for default values. Use the <b>postfix</b> <b>reload</b>
+ The following <b>main.cf</b> parameters are especially relevant
+ to this topic. See the Postfix <b>main.cf</b> file for syntax
+ details and for default values. Use the <b>postfix</b> <b>reload</b>
command after a configuration change.
<b>canonical</b><i>_</i><b>maps</b>
Other parameters of interest:
<b>inet</b><i>_</i><b>interfaces</b>
- The network interface addresses that this system
+ The network interface addresses that this system
receives mail on.
<b>masquerade</b><i>_</i><b>classes</b>
- List of address classes subject to masquerading:
- zero or more of <b>envelope</b><i>_</i><b>sender</b>, <b>envelope</b><i>_</i><b>recipi-</b>
+ List of address classes subject to masquerading:
+ zero or more of <b>envelope</b><i>_</i><b>sender</b>, <b>envelope</b><i>_</i><b>recipi-</b>
<b>ent</b>, <b>header</b><i>_</i><b>sender</b>, <b>header</b><i>_</i><b>recipient</b>.
<b>masquerade</b><i>_</i><b>domains</b>
- List of domains that hide their subdomain struc-
+ List of domains that hide their subdomain struc-
ture.
<b>masquerade</b><i>_</i><b>exceptions</b>
- List of user names that are not subject to address
+ List of user names that are not subject to address
masquerading.
<b>mydestination</b>
- List of domains that this mail system considers
+ List of domains that this mail system considers
local.
<b>myorigin</b>
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
The general form of a PCRE table is:
- blanks and comments
- Blank lines are ignored, as are lines beginning
- with `#'.
-
- leading whitespace
- Lines that begin with whitespace continue the pre-
- vious line.
-
<i>pattern</i> <i>result</i>
When <i>pattern</i> matches a search string, use the cor-
- responding <i>result</i>. A line that starts with white
- space continues the preceding line.
+ responding <i>result</i>.
+
+ multi-line text
+ A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ comments
+ The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
Each pattern is a perl-like regular expression. The
expression delimiter can be any character, except whites-
# Bounce friend@whatever, except when whatever is our domain (you would
# be better just bouncing all friend@ mail - this is just an example).
- /^friend@(?!my\.domain).*$/ 550 Stick this in your pipe $0
+ /^friend@(?!my\.domain)/ 550 Stick this in your pipe $0
# A multi-line entry. The text is sent as one line.
#
<b>EXAMPLE</b> <b>HEADER</b> <b>FILTER</b> <b>MAP</b>
/^Subject: make money fast/ REJECT
- /^To: friend@public\.com/ REJECT
+ /^To: friend@public\.com/ REJECT
<b>SEE</b> <b>ALSO</b>
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
keys was found.
<b>-f</b> Do not fold the lookup key to lower case while cre-
- ating a map.
+ ating or querying a map.
<b>-i</b> Incremental mode. Read entries from standard input
and do not truncate an existing database. By
The format of a lookup table input file is as follows:
- <b>o</b> Blank lines are ignored. So are lines beginning
- with `#'.
-
<b>o</b> A table entry has the form
<i>key</i> whitespace <i>value</i>
- <b>o</b> A line that starts with whitespace continues the
- preceding line.
-
- The <i>key</i> and <i>value</i> are processed as is, except that sur-
- rounding white space is stripped off. Unlike with Postfix
- alias databases, quotes cannot be used to protect lookup
- keys that contain special characters such as `#' or
+ <b>o</b> A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ <b>o</b> The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
+
+ The <i>key</i> and <i>value</i> are processed as is, except that sur-
+ rounding white space is stripped off. Unlike with Postfix
+ alias databases, quotes cannot be used to protect lookup
+ keys that contain special characters such as `#' or
whitespace. The <i>key</i> is mapped to lowercase to make mapping
lookups case insensitive.
Options:
- <b>-N</b> Include the terminating null character that termi-
- nates lookup keys and values. By default, Postfix
+ <b>-N</b> Include the terminating null character that termi-
+ nates lookup keys and values. By default, Postfix
does whatever is the default for the host operating
system.
<b>-c</b> <i>config_dir</i>
- Read the <b>main.cf</b> configuration file in the named
+ Read the <b>main.cf</b> configuration file in the named
directory instead of the default configuration
directory.
- <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one
- entry per map. The exit status is zero when the
+ <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one
+ entry per map. The exit status is zero when the
requested information was found.
If a key value of <b>-</b> is specified, the program reads
key values from the standard input stream. The exit
- status is zero when at least one of the requested
+ status is zero when at least one of the requested
keys was found.
<b>-f</b> Do not fold the lookup key to lower case while cre-
- ating a map.
+ ating or querying a map.
- <b>-i</b> Incremental mode. Read entries from standard input
+ <b>-i</b> Incremental mode. Read entries from standard input
and do not truncate an existing database. By
- default, <b>postmap</b> creates a new database from the
+ default, <b>postmap</b> creates a new database from the
entries in <b>file</b><i>_</i><b>name</b>.
- <b>-n</b> Don't include the terminating null character that
- terminates lookup keys and values. By default,
- Postfix does whatever is the default for the host
+ <b>-n</b> Don't include the terminating null character that
+ terminates lookup keys and values. By default,
+ Postfix does whatever is the default for the host
operating system.
- <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and print the
- first value found on the standard output stream.
+ <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and print the
+ first value found on the standard output stream.
The exit status is zero when the requested informa-
tion was found.
If a key value of <b>-</b> is specified, the program reads
- key values from the standard input stream and
- prints one line of <i>key</i> <i>value</i> output for each key
- that was found. The exit status is zero when at
+ key values from the standard input stream and
+ prints one line of <i>key</i> <i>value</i> output for each key
+ that was found. The exit status is zero when at
least one of the requested keys was found.
- <b>-r</b> When updating a table, do not warn about duplicate
+ <b>-r</b> When updating a table, do not warn about duplicate
entries; silently replace them.
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
- tiple <b>-v</b> options make the software increasingly
+ tiple <b>-v</b> options make the software increasingly
verbose.
- <b>-w</b> When updating a table, do not warn about duplicate
+ <b>-w</b> When updating a table, do not warn about duplicate
entries; silently ignore them.
Arguments:
<i>file_type</i>
The type of database to be produced.
- <b>btree</b> The output file is a btree file, named
- <i>file_name</i><b>.db</b>. This is available only on
+ <b>btree</b> The output file is a btree file, named
+ <i>file_name</i><b>.db</b>. This is available only on
systems with support for <b>db</b> databases.
- <b>dbm</b> The output consists of two files, named
- <i>file_name</i><b>.pag</b> and <i>file_name</i><b>.dir</b>. This is
- available only on systems with support for
+ <b>dbm</b> The output consists of two files, named
+ <i>file_name</i><b>.pag</b> and <i>file_name</i><b>.dir</b>. This is
+ available only on systems with support for
<b>dbm</b> databases.
- <b>hash</b> The output file is a hashed file, named
- <i>file_name</i><b>.db</b>. This is available only on
+ <b>hash</b> The output file is a hashed file, named
+ <i>file_name</i><b>.db</b>. This is available only on
systems with support for <b>db</b> databases.
- When no <i>file_type</i> is specified, the software uses
- the database type specified via the <b>database</b><i>_</i><b>type</b>
+ When no <i>file_type</i> is specified, the software uses
+ the database type specified via the <b>database</b><i>_</i><b>type</b>
configuration parameter.
<i>file_name</i>
- The name of the lookup table source file when
+ The name of the lookup table source file when
rebuilding a database.
<b>DIAGNOSTICS</b>
stream. No output means no problems. Duplicate entries are
skipped and are flagged with a warning.
- <b>postmap</b> terminates with zero exit status in case of suc-
- cess (including successful <b>postmap</b> <b>-q</b> lookup) and termi-
+ <b>postmap</b> terminates with zero exit status in case of suc-
+ cess (including successful <b>postmap</b> <b>-q</b> lookup) and termi-
nates with non-zero exit status in case of failure.
<b>ENVIRONMENT</b>
<b>CONFIGURATION</b> <b>PARAMETERS</b>
<b>database</b><i>_</i><b>type</b>
- Default output database type. On many UNIX sys-
- tems, the default database type is either <b>hash</b> or
+ Default output database type. On many UNIX sys-
+ tems, the default database type is either <b>hash</b> or
<b>dbm</b>.
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
The general form of a Postfix regular expression table is:
- blanks and comments
- Blank lines are ignored, as are lines beginning
- with `#'.
-
- leading whitespace
- Lines that begin with whitespace continue the pre-
- vious line.
-
<i>pattern</i> <i>result</i>
When <i>pattern</i> matches a search string, use the cor-
- responding <i>result</i>. A line that starts with white
- space continues the preceding line.
+ responding <i>result</i>.
+
+ multi-line text
+ A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ comments
+ The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
<i>pattern1!pattern2</i> <i>result</i>
Matches <i>pattern1</i> but not <i>pattern2</i>.
<b>EXAMPLE</b> <b>SMTPD</b> <b>ACCESS</b> <b>MAP</b>
# Disallow sender-specified routing. This is a must if you relay mail
# for other domains.
- /[%!@].*[%!@]/ 550 Sender-specified routing rejected
+ /[%!@].*[%!@]/ 550 Sender-specified routing rejected
# Postmaster is OK, that way they can talk to us about how to fix
# their problem.
- /^postmaster@.*$/ OK
+ /^postmaster@/ OK
# Protect your outgoing majordomo exploders
- /^(.*)-outgoing@(.*)$/!/^owner-.*/ 550 Use ${1}@${2} instead
+ /^(.*)-outgoing@(.*)$/!/^owner-/ 550 Use ${1}@${2} instead
<b>EXAMPLE</b> <b>HEADER</b> <b>FILTER</b> <b>MAP</b>
# These were once common in junk mail.
/^Subject: make money fast/ REJECT
- /^To: friend@public\.com/ REJECT
+ /^To: friend@public\.com/ REJECT
<b>SEE</b> <b>ALSO</b>
<a href="pcre_table.5.html">pcre_table(5)</a> format of PCRE tables
<b>TABLE</b> <b>FORMAT</b>
The format of the table is as follows:
- <b>o</b> Blank lines are ignored, as are lines beginning
- with `#'.
-
- <b>o</b> Lines that begin with whitespace continue the pre-
- vious line.
-
<b>o</b> An entry has one of the following form:
<i>key</i> <i>new_location</i>
Where <i>new_location</i> specifies contact information
such as an email address, or perhaps a street
address or telephone number.
+ <b>o</b> A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ <b>o</b> The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
+
With lookups from indexed files such as DB or DBM, or from
- networked tables such as NIS, LDAP or SQL, the <i>key</i> field
+ networked tables such as NIS, LDAP or SQL, the <i>key</i> field
is one of the following:
<i>user</i>@<i>domain</i>
- Matches <i>user</i>@<i>domain</i>. This form has precedence over
+ Matches <i>user</i>@<i>domain</i>. This form has precedence over
all other forms.
<i>user</i> Matches <i>user</i>@<i>site</i> when <i>site</i> is $<b>myorigin</b>, when <i>site</i>
in $<b>inet</b><i>_</i><b>interfaces</b>.
@<i>domain</i>
- Matches every address in <i>domain</i>. This form has the
+ Matches every address in <i>domain</i>. This form has the
lowest precedence.
<b>ADDRESS</b> <b>EXTENSION</b>
- When the search fails, and the address localpart contains
- the optional recipient delimiter (e.g., <i>user+foo</i>@<i>domain</i>),
- the search is repeated for the unextended address (e.g.
+ When the search fails, and the address localpart contains
+ the optional recipient delimiter (e.g., <i>user+foo</i>@<i>domain</i>),
+ the search is repeated for the unextended address (e.g.
<i>user</i>@<i>domain</i>).
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
- This section describes how the table lookups change when
+ 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,
+ a description of regular expression lookup table syntax,
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
- Each pattern is a regular expression that is applied to
+ 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>
+ 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
+ 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 normal 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.
+ Results are the same as with normal 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>BUGS</b>
- The table format does not understand quoting conventions.
+ The table format does not understand quoting conventions.
<b>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this topic. See the Postfix <b>main.cf</b> file for syntax
- details and for default values. Use the <b>postfix</b> <b>reload</b>
+ The following <b>main.cf</b> parameters are especially relevant
+ to this topic. See the Postfix <b>main.cf</b> file for syntax
+ details and for default values. Use the <b>postfix</b> <b>reload</b>
command after a configuration change.
<b>relocated</b><i>_</i><b>maps</b>
Other parameters of interest:
<b>inet</b><i>_</i><b>interfaces</b>
- The network interface addresses that this system
+ The network interface addresses that this system
receives mail on.
<b>mydestination</b>
- List of domains that this mail system considers
+ List of domains that this mail system considers
local.
<b>myorigin</b>
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
<b>TABLE</b> <b>FORMAT</b>
The format of the transport table is as follows:
- blanks and comments
- Blank lines are ignored, as are lines beginning
- with `#'.
-
- leading whitespace
- Lines that begin with whitespace continue the pre-
- vious line.
-
<i>pattern</i> <i>result</i>
When <i>pattern</i> matches the domain, use the corre-
sponding <i>result</i>.
+ multi-line text
+ A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ comments
+ The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
+
With lookups from indexed files such as DB or DBM, or from
- networked tables such as NIS, LDAP or SQL, patterns are
+ networked tables such as NIS, LDAP or SQL, patterns are
tried in the order as listed below:
<i>domain</i> <i>transport</i>:<i>nexthop</i>
- Mail for <i>domain</i> is delivered through <i>transport</i> to
+ Mail for <i>domain</i> is delivered through <i>transport</i> to
<i>nexthop</i>.
<i>.domain</i> <i>transport</i>:<i>nexthop</i>
- Mail for any subdomain of <i>domain</i> is delivered
+ Mail for any subdomain of <i>domain</i> is delivered
through <i>transport</i> to <i>nexthop</i>.
- Note: transport map entries take precedence over domains
- specified in the <b>mydestination</b> parameter. If you use the
+ Note: transport map entries take precedence over domains
+ specified in the <b>mydestination</b> parameter. If you use the
optional transport map, it may be safer to specify
- explicit entries for all domains specified in <b>mydestina-</b>
+ explicit entries for all domains specified in <b>mydestina-</b>
<b>tion</b>, for example:
<b>hostname.my.domain</b> <b>local:</b>
<b>localhost.my.domain</b> <b>local:</b>
- The interpretation of the <i>nexthop</i> field is transport
+ The interpretation of the <i>nexthop</i> field is transport
dependent. In the case of SMTP, specify <i>host</i>:<i>service</i> for a
- non-default server port, and use [<i>host</i>] or [<i>host</i>]:<i>port</i> in
- order to disable MX (mail exchanger) DNS lookups. The []
- form can also be used with IP addresses instead of host-
+ non-default server port, and use [<i>host</i>] or [<i>host</i>]:<i>port</i> in
+ order to disable MX (mail exchanger) DNS lookups. The []
+ form can also be used with IP addresses instead of host-
names.
<b>EXAMPLES</b>
- In order to send mail for <b>foo.org</b> and its subdomains via
+ In order to send mail for <b>foo.org</b> and its subdomains via
the <b>uucp</b> transport to the UUCP host named <b>foo</b>:
<b>foo.org</b> <b>uucp:foo</b>
<b>.foo.org</b> <b>uucp:foo</b>
- When no <i>nexthop</i> host name is specified, the destination
- domain name is used instead. For example, the following
- directs mail for <i>user</i>@<b>foo.org</b> via the <b>slow</b> transport to a
- mail exchanger for <b>foo.org</b>. The <b>slow</b> transport could be
- something that runs at most one delivery process at a
+ When no <i>nexthop</i> host name is specified, the destination
+ domain name is used instead. For example, the following
+ directs mail for <i>user</i>@<b>foo.org</b> via the <b>slow</b> transport to a
+ mail exchanger for <b>foo.org</b>. The <b>slow</b> transport could be
+ something that runs at most one delivery process at a
time:
<b>foo.org</b> <b>slow:</b>
- When no <i>transport</i> is specified, the default transport is
+ When no <i>transport</i> is specified, the default transport is
used, as specified via the <b>default</b><i>_</i><b>transport</b> configuration
- parameter. The following sends all mail for <b>foo.org</b> and
+ parameter. The following sends all mail for <b>foo.org</b> and
its subdomains to host <b>gateway.foo.org</b>:
<b>foo.org</b> <b>:[gateway.foo.org]</b>
<b>.foo.org</b> <b>:[gateway.foo.org]</b>
- In the above example, the [] are used to suppress MX
- lookups. The result would likely point to your local
+ In the above example, the [] are used to suppress MX
+ lookups. The result would likely point to your local
machine.
- In the case of delivery via SMTP, one may specify <i>host-</i>
+ In the case of delivery via SMTP, one may specify <i>host-</i>
<i>name</i>:<i>service</i> instead of just a host:
<b>foo.org</b> <b>smtp:bar.org:2025</b>
- This directs mail for <i>user</i>@<b>foo.org</b> to host <b>bar.org</b> port
- <b>2025</b>. Instead of a numerical port a symbolic name may be
- used. Specify [] around the hostname in order to disable
+ This directs mail for <i>user</i>@<b>foo.org</b> to host <b>bar.org</b> port
+ <b>2025</b>. Instead of a numerical port a symbolic name may be
+ used. Specify [] around the hostname in order to disable
MX lookups.
The error mailer can be used to bounce mail:
- <b>.foo.org</b> <b>error:mail</b> <b>for</b> <b>*.foo.org</b> <b>is</b> <b>not</b> <b>deliv-</b>
+ <b>.foo.org</b> <b>error:mail</b> <b>for</b> <b>*.foo.org</b> <b>is</b> <b>not</b> <b>deliv-</b>
<b>erable</b>
- This causes all mail for <i>user</i>@<i>anything</i><b>.foo.org</b> to be
+ This causes all mail for <i>user</i>@<i>anything</i><b>.foo.org</b> to be
bounced.
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
- This section describes how the table lookups change when
+ 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,
+ a description of regular expression lookup table syntax,
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
- Each pattern is a regular expression that is applied to
+ Each pattern is a regular expression that is applied to
the entire domain being looked up. Thus, <i>some.domain.hier-</i>
<i>archy</i> is not broken up into parent domains.
- Patterns are applied in the order as specified in the
- table, until a pattern is found that matches the search
+ 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 normal 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.
+ Results are the same as with normal 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>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this topic. See the Postfix <b>main.cf</b> file for syntax
- details and for default values. Use the <b>postfix</b> <b>reload</b>
+ The following <b>main.cf</b> parameters are especially relevant
+ to this topic. See the Postfix <b>main.cf</b> file for syntax
+ details and for default values. Use the <b>postfix</b> <b>reload</b>
command after a configuration change.
<b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b> (versions >= 20011119)
- List of Postfix features that use <i>domain.name</i> pat-
+ List of Postfix features that use <i>domain.name</i> pat-
terns to match <i>sub.domain.name</i> (as opposed to
requiring <i>.domain.name</i> patterns).
Other parameters of interest:
<b>default</b><i>_</i><b>transport</b>
- The transport to use when no transport is explic-
+ The transport to use when no transport is explic-
itly specified.
<b>relayhost</b>
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
The <b>main.cf</b> <b>mydestination</b> entry is required for a Send-
mail-style virtual domain.
- Do not specify a <i>virtual.domain</i> <i>whatever</i> virtual map entry
+ Do not specify a <i>virtual.domain</i> <i>anything</i> virtual map entry
for a Sendmail-style virtual domain. Such an entry is
required only with a Postfix-style virtual domain.
The format of the virtual table is as follows, mappings
being tried in the order as listed in this manual page:
- blanks and comments
- Blank lines are ignored, as are lines beginning
- with `#'.
-
- leading whitespace
- Lines that begin with whitespace continue the pre-
- vious line.
-
<i>pattern</i> <i>result</i>
When <i>pattern</i> matches a mail address, replace it by
the corresponding <i>result</i>.
+ multi-line text
+ A line that starts with whitespace (space or tab)
+ is a continuation of the previous line. An empty
+ line terminates the previous line, as does a line
+ that starts with non-whitespace (text or comment).
+ A comment line that starts with whitespace does not
+ terminate multi-line text.
+
+ comments
+ The <b>#</b> is recognized as the start of a comment, but
+ only when it is the first non-whitespace character
+ on a line. A comment terminates at the end of the
+ line, even when the next line starts with whites-
+ pace.
+
With lookups from indexed files such as DB or DBM, or from
- networked tables such as NIS, LDAP or SQL, patterns are
+ networked tables such as NIS, LDAP or SQL, patterns are
tried in the order as listed below:
<i>user</i>@<i>domain</i> <i>address,</i> <i>address,</i> <i>...</i>
- Mail for <i>user</i>@<i>domain</i> is redirected to <i>address</i>.
+ Mail for <i>user</i>@<i>domain</i> is redirected to <i>address</i>.
This form has the highest precedence.
<i>user</i> <i>address,</i> <i>address,</i> <i>...</i>
- Mail for <i>user</i>@<i>site</i> is redirected to <i>address</i> when
- <i>site</i> is equal to $<b>myorigin</b>, when <i>site</i> is listed in
+ Mail for <i>user</i>@<i>site</i> is redirected to <i>address</i> when
+ <i>site</i> is equal to $<b>myorigin</b>, when <i>site</i> is listed in
$mydestination, or when it is listed in
$<i>inet_interfaces</i>.
- This functionality overlaps with functionality of
+ This functionality overlaps with functionality of
the local <i>alias</i>(5) database. The difference is that
- <b>virtual</b> mapping can be applied to non-local
+ <b>virtual</b> mapping can be applied to non-local
addresses.
@<i>domain</i> <i>address,</i> <i>address,</i> <i>...</i>
- Mail for any user in <i>domain</i> is redirected to
+ Mail for any user in <i>domain</i> is redirected 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
+ 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
works for the first address in the expansion only.
<b>ADDRESS</b> <b>EXTENSION</b>
- When the search fails, and the address localpart contains
- the optional recipient delimiter (e.g., <i>user+foo</i>@<i>domain</i>),
- the search is repeated for the unextended address (e.g.
+ When the search fails, and the address localpart contains
+ the optional recipient delimiter (e.g., <i>user+foo</i>@<i>domain</i>),
+ the search is repeated for the unextended address (e.g.
<i>user</i>@<i>domain</i>), and the unmatched address extension is prop-
- agated to the result of expansion. The matching order is:
+ agated to the result of expansion. The matching order is:
<i>user+foo</i>@<i>domain</i>, <i>user</i>@<i>domain</i>, <i>user+foo</i>, <i>user</i>, and @<i>domain</i>.
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
- This section describes how the table lookups change when
+ 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,
+ a description of regular expression lookup table syntax,
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
- Each pattern is a regular expression that is applied to
+ 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>
+ 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
+ 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 normal 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.
+ Results are the same as with normal 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>BUGS</b>
- The table format does not understand quoting conventions.
+ The table format does not understand quoting conventions.
<b>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this topic. See the Postfix <b>main.cf</b> file for syntax
- details and for default values. Use the <b>postfix</b> <b>reload</b>
+ The following <b>main.cf</b> parameters are especially relevant
+ to this topic. See the Postfix <b>main.cf</b> file for syntax
+ details and for default values. Use the <b>postfix</b> <b>reload</b>
command after a configuration change.
<b>virtual</b><i>_</i><b>maps</b>
Other parameters of interest:
<b>inet</b><i>_</i><b>interfaces</b>
- The network interface addresses that this system
+ The network interface addresses that this system
receives mail on.
<b>mydestination</b>
- List of domains that this mail system considers
+ List of domains that this mail system considers
local.
<b>myorigin</b>
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
values from the standard input stream. The exit status is zero
when at least one of the requested keys was found.
.IP \fB-f\fR
-Do not fold the lookup key to lower case while creating a map.
+Do not fold the lookup key to lower case while creating or querying
+a map.
.IP \fB-i\fR
Incremental mode. Read entries from standard input and do not
truncate an existing database. By default, \fBpostalias\fR creates
The format of a lookup table input file is as follows:
.IP \(bu
-Blank lines are ignored. So are lines beginning with `#'.
-.IP \(bu
A table entry has the form
.sp
.ti +5
\fIkey\fR whitespace \fIvalue\fR
.IP \(bu
-A line that starts with whitespace continues the preceding line.
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
+.IP \(bu
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.PP
The \fIkey\fR and \fIvalue\fR are processed as is, except that
surrounding white space is stripped off. Unlike with Postfix alias
values from the standard input stream. The exit status is zero
when at least one of the requested keys was found.
.IP \fB-f\fR
-Do not fold the lookup key to lower case while creating a map.
+Do not fold the lookup key to lower case while creating or querying
+a map.
.IP \fB-i\fR
Incremental mode. Read entries from standard input and do not
truncate an existing database. By default, \fBpostmap\fR creates
.ad
.fi
The format of the access table is as follows:
-.IP "blanks and comments"
-Blank lines are ignored, as are lines beginning with `#'.
-.IP "leading whitespace"
-Lines that begin with whitespace continue the previous line.
.IP "\fIpattern action\fR"
When \fIpattern\fR matches a mail address, domain or host address,
perform the corresponding \fIaction\fR.
+.IP "multi-line text"
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
+.IP "comments"
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.SH PATTERNS
.na
.nf
.ti +5
\fIname\fR: \fIvalue1\fR, \fIvalue2\fR, \fI...\fR
.IP \(bu
-Lines that begin with whitespace continue the previous line.
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
.IP \(bu
-Blank lines are ignored, as are lines beginning with `#'.
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.PP
The \fIname\fR is a local address (no domain part).
Use double quotes when the name contains any special characters
.ad
.fi
The format of the \fBcanonical\fR table is as follows:
-.IP "blanks and comments"
-Blank lines are ignored, as are lines beginning with `#'.
-.IP "leading whitespace"
-Lines that begin with whitespace continue the previous line.
.IP "\fIpattern result\fR"
When \fIpattern\fR matches a mail address, replace it by the
corresponding \fIresult\fR.
+.IP "multi-line text"
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
+.IP "comments"
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.PP
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
supports use the \fBpostconf -m\fR command.
The general form of a PCRE table is:
-.IP "blanks and comments"
-Blank lines are ignored, as are lines beginning with `#'.
-.IP "leading whitespace"
-Lines that begin with whitespace continue the previous line.
.IP "\fIpattern result\fR"
When \fIpattern\fR matches a search string, use the corresponding
-\fIresult\fR. A line that starts with white space continues the
-preceding line.
+\fIresult\fR.
+.IP "multi-line text"
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
+.IP "comments"
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.PP
Each pattern is a perl-like regular expression. The expression
delimiter can be any character, except whitespace or characters
.na
.nf
/^Subject: make money fast/ REJECT
-/^To: friend@public\\.com/ REJECT
+/^To: friend@public\\.com/ REJECT
.SH SEE ALSO
.na
.nf
supports use the \fBpostconf -m\fR command.
The general form of a Postfix regular expression table is:
-.IP "blanks and comments"
-Blank lines are ignored, as are lines beginning with `#'.
-.IP "leading whitespace"
-Lines that begin with whitespace continue the previous line.
.IP "\fIpattern result\fR"
When \fIpattern\fR matches a search string, use the corresponding
-\fIresult\fR. A line that starts with white space continues the
-preceding line.
+\fIresult\fR.
+.IP "multi-line text"
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
+.IP "comments"
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.IP "\fIpattern1!pattern2 result\fR"
Matches \fIpattern1\fR but not \fIpattern2\fR.
.PP
.nf
# Disallow sender-specified routing. This is a must if you relay mail
# for other domains.
-/[%!@].*[%!@]/ 550 Sender-specified routing rejected
+/[%!@].*[%!@]/ 550 Sender-specified routing rejected
# Postmaster is OK, that way they can talk to us about how to fix
# their problem.
-/^postmaster@/ OK
+/^postmaster@/ OK
# Protect your outgoing majordomo exploders
-/^(.*)-outgoing@(.*)$/!/^owner-/ 550 Use ${1}@${2} instead
+/^(.*)-outgoing@(.*)$/!/^owner-/ 550 Use ${1}@${2} instead
.SH EXAMPLE HEADER FILTER MAP
.na
.nf
# These were once common in junk mail.
/^Subject: make money fast/ REJECT
-/^To: friend@public\\.com/ REJECT
+/^To: friend@public\\.com/ REJECT
.SH SEE ALSO
.na
.nf
.fi
The format of the table is as follows:
.IP \(bu
-Blank lines are ignored, as are lines beginning with `#'.
-.IP \(bu
-Lines that begin with whitespace continue the previous line.
-.IP \(bu
An entry has one of the following form:
.ti +5
\fIkey new_location\fR
.br
Where \fInew_location\fR specifies contact information such as
an email address, or perhaps a street address or telephone number.
+.IP \(bu
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
+.IP \(bu
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.PP
With lookups from indexed files such as DB or DBM, or from networked
tables such as NIS, LDAP or SQL, the \fIkey\fR field is one of the
.ad
.fi
The format of the transport table is as follows:
-.IP "blanks and comments"
-Blank lines are ignored, as are lines beginning with `#'.
-.IP "leading whitespace"
-Lines that begin with whitespace continue the previous line.
.IP "\fIpattern result\fR"
When \fIpattern\fR matches the domain, use the corresponding
\fIresult\fR.
+.IP "multi-line text"
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
+.IP "comments"
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.PP
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
The \fBmain.cf mydestination\fR entry is required for a Sendmail-style
virtual domain.
-Do not specify a \fIvirtual.domain whatever\fR virtual map entry
+Do not specify a \fIvirtual.domain anything\fR virtual map entry
for a Sendmail-style virtual domain.
Such an entry is required only with a Postfix-style virtual domain.
.fi
The format of the virtual table is as follows, mappings being
tried in the order as listed in this manual page:
-.IP "blanks and comments"
-Blank lines are ignored, as are lines beginning with `#'.
-.IP "leading whitespace"
-Lines that begin with whitespace continue the previous line.
.IP "\fIpattern result\fR"
When \fIpattern\fR matches a mail address, replace it by the
corresponding \fIresult\fR.
+.IP "multi-line text"
+A line that starts with whitespace (space or tab) is a continuation
+of the previous line. An empty line terminates the previous line,
+as does a line that starts with non-whitespace (text or comment). A
+comment line that starts with whitespace does not terminate multi-line
+text.
+.IP "comments"
+The \fB#\fR is recognized as the start of a comment, but only when it is
+the first non-whitespace character on a line. A comment terminates
+at the end of the line, even when the next line starts with whitespace.
.PP
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
../conf/transport ../conf/virtual ../conf/pcre_table \
../conf/regexp_table
+AWK = awk '{ print; if (NR == 1) print ".pl 9999" }'
+
update: $(CONFIG)
Makefile: Makefile.in
rm -f $(CONFIG)
../conf/access: access
- srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ srctoman - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/aliases: aliases0 aliases
- (cat aliases0; srctoman - aliases | nroff -man | col -bx | uniq | sed 's/^/# /') >$@
+ (cat aliases0; srctoman - aliases | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /') >$@
../conf/canonical: canonical
- srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ srctoman - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/pcre_table: pcre_table
- srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ srctoman - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/regexp_table: regexp_table
- srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ srctoman - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/relocated: relocated
- srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ srctoman - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/transport: transport
- srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ srctoman - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/virtual: virtual
- srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ srctoman - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
# .ad
# .fi
# The format of the access table is as follows:
-# .IP "blanks and comments"
-# Blank lines are ignored, as are lines beginning with `#'.
-# .IP "leading whitespace"
-# Lines that begin with whitespace continue the previous line.
# .IP "\fIpattern action\fR"
# When \fIpattern\fR matches a mail address, domain or host address,
# perform the corresponding \fIaction\fR.
+# .IP "multi-line text"
+# A line that starts with whitespace (space or tab) is a continuation
+# of the previous line. An empty line terminates the previous line,
+# as does a line that starts with non-whitespace (text or comment). A
+# comment line that starts with whitespace does not terminate multi-line
+# text.
+# .IP "comments"
+# The \fB#\fR is recognized as the start of a comment, but only when it is
+# the first non-whitespace character on a line. A comment terminates
+# at the end of the line, even when the next line starts with whitespace.
# PATTERNS
# .ad
# .fi
# .ti +5
# \fIname\fR: \fIvalue1\fR, \fIvalue2\fR, \fI...\fR
# .IP \(bu
-# Lines that begin with whitespace continue the previous line.
+# A line that starts with whitespace (space or tab) is a continuation
+# of the previous line. An empty line terminates the previous line,
+# as does a line that starts with non-whitespace (text or comment). A
+# comment line that starts with whitespace does not terminate multi-line
+# text.
# .IP \(bu
-# Blank lines are ignored, as are lines beginning with `#'.
+# The \fB#\fR is recognized as the start of a comment, but only when it is
+# the first non-whitespace character on a line. A comment terminates
+# at the end of the line, even when the next line starts with whitespace.
# .PP
# The \fIname\fR is a local address (no domain part).
# Use double quotes when the name contains any special characters
# .ad
# .fi
# The format of the \fBcanonical\fR table is as follows:
-# .IP "blanks and comments"
-# Blank lines are ignored, as are lines beginning with `#'.
-# .IP "leading whitespace"
-# Lines that begin with whitespace continue the previous line.
# .IP "\fIpattern result\fR"
# When \fIpattern\fR matches a mail address, replace it by the
# corresponding \fIresult\fR.
+# .IP "multi-line text"
+# A line that starts with whitespace (space or tab) is a continuation
+# of the previous line. An empty line terminates the previous line,
+# as does a line that starts with non-whitespace (text or comment). A
+# comment line that starts with whitespace does not terminate multi-line
+# text.
+# .IP "comments"
+# The \fB#\fR is recognized as the start of a comment, but only when it is
+# the first non-whitespace character on a line. A comment terminates
+# at the end of the line, even when the next line starts with whitespace.
# .PP
# 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
# supports use the \fBpostconf -m\fR command.
#
# The general form of a PCRE table is:
-# .IP "blanks and comments"
-# Blank lines are ignored, as are lines beginning with `#'.
-# .IP "leading whitespace"
-# Lines that begin with whitespace continue the previous line.
# .IP "\fIpattern result\fR"
# When \fIpattern\fR matches a search string, use the corresponding
-# \fIresult\fR. A line that starts with white space continues the
-# preceding line.
+# \fIresult\fR.
+# .IP "multi-line text"
+# A line that starts with whitespace (space or tab) is a continuation
+# of the previous line. An empty line terminates the previous line,
+# as does a line that starts with non-whitespace (text or comment). A
+# comment line that starts with whitespace does not terminate multi-line
+# text.
+# .IP "comments"
+# The \fB#\fR is recognized as the start of a comment, but only when it is
+# the first non-whitespace character on a line. A comment terminates
+# at the end of the line, even when the next line starts with whitespace.
# .PP
# Each pattern is a perl-like regular expression. The expression
# delimiter can be any character, except whitespace or characters
#
# # Bounce friend@whatever, except when whatever is our domain (you would
# # be better just bouncing all friend@ mail - this is just an example).
-# /^friend@(?!my\\.domain)/ 550 Stick this in your pipe $0
+# /^friend@(?!my\\.domain)/ 550 Stick this in your pipe $0
#
# # A multi-line entry. The text is sent as one line.
# #
# \ them as it only makes their head spin.
# EXAMPLE HEADER FILTER MAP
# /^Subject: make money fast/ REJECT
-# /^To: friend@public\\.com/ REJECT
+# /^To: friend@public\\.com/ REJECT
# SEE ALSO
# regexp_table(5) format of POSIX regular expression tables
# AUTHOR(S)
# supports use the \fBpostconf -m\fR command.
#
# The general form of a Postfix regular expression table is:
-# .IP "blanks and comments"
-# Blank lines are ignored, as are lines beginning with `#'.
-# .IP "leading whitespace"
-# Lines that begin with whitespace continue the previous line.
# .IP "\fIpattern result\fR"
# When \fIpattern\fR matches a search string, use the corresponding
-# \fIresult\fR. A line that starts with white space continues the
-# preceding line.
+# \fIresult\fR.
+# .IP "multi-line text"
+# A line that starts with whitespace (space or tab) is a continuation
+# of the previous line. An empty line terminates the previous line,
+# as does a line that starts with non-whitespace (text or comment). A
+# comment line that starts with whitespace does not terminate multi-line
+# text.
+# .IP "comments"
+# The \fB#\fR is recognized as the start of a comment, but only when it is
+# the first non-whitespace character on a line. A comment terminates
+# at the end of the line, even when the next line starts with whitespace.
# .IP "\fIpattern1!pattern2 result\fR"
# Matches \fIpattern1\fR but not \fIpattern2\fR.
# .PP
# EXAMPLE SMTPD ACCESS MAP
# # Disallow sender-specified routing. This is a must if you relay mail
# # for other domains.
-# /[%!@].*[%!@]/ 550 Sender-specified routing rejected
+# /[%!@].*[%!@]/ 550 Sender-specified routing rejected
#
# # Postmaster is OK, that way they can talk to us about how to fix
# # their problem.
-# /^postmaster@/ OK
+# /^postmaster@/ OK
#
# # Protect your outgoing majordomo exploders
-# /^(.*)-outgoing@(.*)$/!/^owner-/ 550 Use ${1}@${2} instead
+# /^(.*)-outgoing@(.*)$/!/^owner-/ 550 Use ${1}@${2} instead
# EXAMPLE HEADER FILTER MAP
# # These were once common in junk mail.
# /^Subject: make money fast/ REJECT
-# /^To: friend@public\\.com/ REJECT
+# /^To: friend@public\\.com/ REJECT
# SEE ALSO
# pcre_table(5) format of PCRE tables
# AUTHOR(S)
# .fi
# The format of the table is as follows:
# .IP \(bu
-# Blank lines are ignored, as are lines beginning with `#'.
-# .IP \(bu
-# Lines that begin with whitespace continue the previous line.
-# .IP \(bu
# An entry has one of the following form:
# .ti +5
# \fIkey new_location\fR
# .br
# Where \fInew_location\fR specifies contact information such as
# an email address, or perhaps a street address or telephone number.
+# .IP \(bu
+# A line that starts with whitespace (space or tab) is a continuation
+# of the previous line. An empty line terminates the previous line,
+# as does a line that starts with non-whitespace (text or comment). A
+# comment line that starts with whitespace does not terminate multi-line
+# text.
+# .IP \(bu
+# The \fB#\fR is recognized as the start of a comment, but only when it is
+# the first non-whitespace character on a line. A comment terminates
+# at the end of the line, even when the next line starts with whitespace.
# .PP
# With lookups from indexed files such as DB or DBM, or from networked
# tables such as NIS, LDAP or SQL, the \fIkey\fR field is one of the
# .ad
# .fi
# The format of the transport table is as follows:
-# .IP "blanks and comments"
-# Blank lines are ignored, as are lines beginning with `#'.
-# .IP "leading whitespace"
-# Lines that begin with whitespace continue the previous line.
# .IP "\fIpattern result\fR"
# When \fIpattern\fR matches the domain, use the corresponding
# \fIresult\fR.
+# .IP "multi-line text"
+# A line that starts with whitespace (space or tab) is a continuation
+# of the previous line. An empty line terminates the previous line,
+# as does a line that starts with non-whitespace (text or comment). A
+# comment line that starts with whitespace does not terminate multi-line
+# text.
+# .IP "comments"
+# The \fB#\fR is recognized as the start of a comment, but only when it is
+# the first non-whitespace character on a line. A comment terminates
+# at the end of the line, even when the next line starts with whitespace.
# .PP
# 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
# The \fBmain.cf mydestination\fR entry is required for a Sendmail-style
# virtual domain.
#
-# Do not specify a \fIvirtual.domain whatever\fR virtual map entry
+# Do not specify a \fIvirtual.domain anything\fR virtual map entry
# for a Sendmail-style virtual domain.
# Such an entry is required only with a Postfix-style virtual domain.
#
# .fi
# The format of the virtual table is as follows, mappings being
# tried in the order as listed in this manual page:
-# .IP "blanks and comments"
-# Blank lines are ignored, as are lines beginning with `#'.
-# .IP "leading whitespace"
-# Lines that begin with whitespace continue the previous line.
# .IP "\fIpattern result\fR"
# When \fIpattern\fR matches a mail address, replace it by the
# corresponding \fIresult\fR.
+# .IP "multi-line text"
+# A line that starts with whitespace (space or tab) is a continuation
+# of the previous line. An empty line terminates the previous line,
+# as does a line that starts with non-whitespace (text or comment). A
+# comment line that starts with whitespace does not terminate multi-line
+# text.
+# .IP "comments"
+# The \fB#\fR is recognized as the start of a comment, but only when it is
+# the first non-whitespace character on a line. A comment terminates
+# at the end of the line, even when the next line starts with whitespace.
# .PP
# 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
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
-#define DEF_MAIL_VERSION "Snapshot-20011209"
+#define DEF_MAIL_VERSION "Snapshot-20011216"
extern char *var_mail_version;
/* LICENSE
/*
* Strip off the record terminator: either CRLF or just bare LF.
+ *
+ * XXX RFC 2821 disallows sending bare CR everywhere. We remove bare CR
+ * if received before CRLF, and leave it alone otherwise.
*/
case '\n':
- if (VSTRING_LEN(vp) > 1 && vstring_end(vp)[-2] == '\r')
- vstring_truncate(vp, VSTRING_LEN(vp) - 2);
- else
+ vstring_truncate(vp, VSTRING_LEN(vp) - 1);
+ while (VSTRING_LEN(vp) > 0 && vstring_end(vp)[-1] == '\r')
vstring_truncate(vp, VSTRING_LEN(vp) - 1);
VSTRING_TERMINATE(vp);
* Skip blank lines and comment lines.
*/
do {
- if (readlline(buf, master_fp, &master_line, READLL_STRIPNL) == 0) {
+ if (readlline(buf, master_fp, &master_line, READLL_STRIP_NOISE) == 0) {
vstring_free(buf);
vstring_free(junk);
return (0);
}
bufp = vstring_str(buf);
- } while ((cp = mystrtok(&bufp, master_blanks)) == 0 || *cp == '#');
+ } while ((cp = mystrtok(&bufp, master_blanks)) == 0);
/*
* Parse one logical line from the configuration file. Initialize service
/* values from the standard input stream. The exit status is zero
/* when at least one of the requested keys was found.
/* .IP \fB-f\fR
-/* Do not fold the lookup key to lower case while creating a map.
+/* Do not fold the lookup key to lower case while creating or querying
+/* a map.
/* .IP \fB-i\fR
/* Incremental mode. Read entries from standard input and do not
/* truncate an existing database. By default, \fBpostalias\fR creates
* Add records to the database.
*/
lineno = 0;
- while (readlline(line_buffer, source_fp, &lineno, READLL_STRIPNL)) {
-
- /*
- * Skip comments.
- */
- if (*STR(line_buffer) == '#')
- continue;
+ while (readlline(line_buffer, source_fp, &lineno, READLL_STRIP_NOISE)) {
/*
* Weird stuff. Normally, a line that begins with whitespace is a
/* postalias_queries - apply multiple requests from stdin */
-static int postalias_queries(VSTREAM *in, char **maps, const int map_count)
+static int postalias_queries(VSTREAM *in, char **maps, const int map_count,
+ const int dict_flags)
{
int found = 0;
VSTRING *keybuf = vstring_alloc(100);
* maps.
*/
while (vstring_get_nonl(keybuf, in) != VSTREAM_EOF) {
+ if (dict_flags & DICT_FLAG_FOLD_KEY)
+ lowercase(STR(keybuf));
for (n = 0; n < map_count; n++) {
if (dicts[n] == 0)
dicts[n] = ((map_name = split_at(maps[n], ':')) != 0 ?
if (optind + 1 > argc)
usage(argv[0]);
if (strcmp(query, "-") == 0)
- exit(postalias_queries(VSTREAM_IN, argv + optind, argc - optind) == 0);
+ exit(postalias_queries(VSTREAM_IN, argv + optind, argc - optind,
+ dict_flags) == 0);
+ if (dict_flags & DICT_FLAG_FOLD_KEY)
+ lowercase(query);
while (optind < argc) {
if ((path_name = split_at(argv[optind], ':')) != 0) {
found = postalias_query(argv[optind], path_name, query);
*/
#define STR(x) vstring_str(x)
- while (readlline(buf, src, (int *) 0, READLL_KEEPNL)) {
+ while (readlline(buf, src, (int *) 0, READLL_KEEP_NOISE)) {
cp = STR(buf);
if (first) {
first = 0;
* Stop run-away process accidents by limiting the queue file size. This
* is not a defense against DOS attack.
*/
- if (get_file_limit() > var_message_limit)
+ if (var_message_limit > 0 && get_file_limit() > var_message_limit)
set_file_limit((off_t) var_message_limit);
/*
/*
/* The format of a lookup table input file is as follows:
/* .IP \(bu
-/* Blank lines are ignored. So are lines beginning with `#'.
-/* .IP \(bu
/* A table entry has the form
/* .sp
/* .ti +5
/* \fIkey\fR whitespace \fIvalue\fR
/* .IP \(bu
-/* A line that starts with whitespace continues the preceding line.
+/* A line that starts with whitespace (space or tab) is a continuation
+/* of the previous line. An empty line terminates the previous line,
+/* as does a line that starts with non-whitespace (text or comment). A
+/* comment line that starts with whitespace does not terminate multi-line
+/* text.
+/* .IP \(bu
+/* The \fB#\fR is recognized as the start of a comment, but only when it is
+/* the first non-whitespace character on a line. A comment terminates
+/* at the end of the line, even when the next line starts with whitespace.
/* .PP
/* The \fIkey\fR and \fIvalue\fR are processed as is, except that
/* surrounding white space is stripped off. Unlike with Postfix alias
/* values from the standard input stream. The exit status is zero
/* when at least one of the requested keys was found.
/* .IP \fB-f\fR
-/* Do not fold the lookup key to lower case while creating a map.
+/* Do not fold the lookup key to lower case while creating or querying
+/* a map.
/* .IP \fB-i\fR
/* Incremental mode. Read entries from standard input and do not
/* truncate an existing database. By default, \fBpostmap\fR creates
* Add records to the database.
*/
lineno = 0;
- while (readlline(line_buffer, source_fp, &lineno, READLL_STRIPNL)) {
+ while (readlline(line_buffer, source_fp, &lineno, READLL_STRIP_NOISE)) {
/*
* Skip comments.
/* postmap_queries - apply multiple requests from stdin */
-static int postmap_queries(VSTREAM *in, char **maps, const int map_count)
+static int postmap_queries(VSTREAM *in, char **maps, const int map_count,
+ const int dict_flags)
{
int found = 0;
VSTRING *keybuf = vstring_alloc(100);
* maps.
*/
while (vstring_get_nonl(keybuf, in) != VSTREAM_EOF) {
+ if (dict_flags & DICT_FLAG_FOLD_KEY)
+ lowercase(STR(keybuf));
for (n = 0; n < map_count; n++) {
if (dicts[n] == 0)
dicts[n] = ((map_name = split_at(maps[n], ':')) != 0 ?
if (optind + 1 > argc)
usage(argv[0]);
if (strcmp(query, "-") == 0)
- exit(postmap_queries(VSTREAM_IN, argv + optind, argc - optind) == 0);
+ exit(postmap_queries(VSTREAM_IN, argv + optind, argc - optind,
+ dict_flags) == 0);
+ if (dict_flags & DICT_FLAG_FOLD_KEY)
+ lowercase(query);
while (optind < argc) {
if ((path_name = split_at(argv[optind], ':')) != 0) {
found = postmap_query(argv[optind], path_name, query);
* Stop run-away process accidents by limiting the queue file size. This
* is not a defense against DOS attack.
*/
- if (get_file_limit() > var_message_limit)
+ if (var_message_limit > 0 && get_file_limit() > var_message_limit)
set_file_limit((off_t) var_message_limit);
signal(SIGPIPE, SIG_IGN);
buf = vstring_alloc(100);
lineno = 0;
- while (readlline(buf, fp, &lineno, READLL_STRIPNL)) {
+ while (readlline(buf, fp, &lineno, READLL_STRIP_NOISE)) {
start = STR(buf);
SKIP(start, member, ISSPACE(*member)); /* find member begin */
- if (*member == 0 || *member == '#')
- continue; /* comment or blank line */
SKIP(member, ep, !ISSPACE(*ep) && *ep != '='); /* find member end */
SKIP(ep, cp, ISSPACE(*cp)); /* skip blanks before '=' */
if (*cp && *cp != '=') /* need '=' or end of string */
if ((map_fp = vstream_fopen(map, O_RDONLY, 0)) == 0) {
msg_fatal("open %s: %m", map);
}
- while (readlline(line_buffer, map_fp, &lineno, READLL_STRIPNL)) {
-
- if (*vstring_str(line_buffer) == '#') /* Skip comments */
- continue;
-
- if (*vstring_str(line_buffer) == 0) /* Skip blank lines */
- continue;
+ while (readlline(line_buffer, map_fp, &lineno, READLL_STRIP_NOISE)) {
p = vstring_str(line_buffer);
trimblanks(p, 0)[0] = 0; /* Trim space at end */
if ((map_fp = vstream_fopen(map, O_RDONLY, 0)) == 0) {
msg_fatal("open %s: %m", map);
}
- while (readlline(line_buffer, map_fp, &lineno, READLL_STRIPNL)) {
+ while (readlline(line_buffer, map_fp, &lineno, READLL_STRIP_NOISE)) {
p = vstring_str(line_buffer);
- if (*p == '#') /* Skip comments */
- continue;
-
- if (*p == 0) /* Skip blank lines */
- continue;
-
trimblanks(p, 0)[0] = 0; /* Trim space at end */
rule = dict_regexp_parseline(lineno, p, &nsub, map_fp);
/* SYNOPSIS
/* #include <readlline.h>
/*
-/* VSTRING *readlline(buf, fp, lineno, stripnl)
+/* VSTRING *readlline(buf, fp, lineno, strip_noise)
/* VSTRING *buf;
/* VSTREAM *fp;
/* int *lineno;
-/* int stripnl;
+/* int strip_noise;
/* DESCRIPTION
/* readlline() reads one logical line from the named stream.
-/* A line that starts with whitespace is a continuation of
-/* the previous line. When the stripnl argument is non-zero,
-/* the newline between continued lines
-/* is deleted from the input. The result value is the input
-/* buffer argument or a null pointer when no input is found.
+/*
+/* A line that starts with whitespace (space or tab) is a continuation
+/* of the previous line. An empty line terminates the previous line,
+/* as does a line that starts with non-whitespace (text or comment). A
+/* comment line that starts with whitespace does not terminate multi-line
+/* text.
+/*
+/* The # is recognized as the start of a comment, but only when it is
+/* the first non-whitespace character on a line. A comment terminates
+/* at the end of the line, even when the next line starts with whitespace.
+/*
+/* The result value is the input buffer argument or a null pointer
+/* when no input is found.
/*
/* Arguments:
/* .IP buf
/* .IP lineno
/* A null pointer, or a pointer to an integer that is incremented
/* after reading a newline.
-/* .IP stripnl
-/* Non-zero to strip newlines. readlline.h provides the symbolic
-/* constants READLL_STRIPNL and READLL_KEEPNL for convenience.
+/* .IP strip_noise
+/* Non-zero to strip newlines, empty lines and comments from the result.
+/* For convenience, READLL_STRIP_NOISE requests stripping while
+/* READLL_KEEP_NOISE disables stripping.
+/* .RE
/* LICENSE
/* .ad
/* .fi
#include "vstring.h"
#include "readlline.h"
+ /*
+ * Comment stripper states. States are (1)->(2) or (1)->(3) as we proceed
+ * through a line of text.
+ */
+#define READLL_STATE_WANT_LWSP 1 /* expecting leading whitespace */
+#define READLL_STATE_IN_COMMENT 2 /* inside comment */
+#define READLL_STATE_IN_TEXT 3 /* inside other text */
+
+#define LWSP_CHARACTER(ch) ((ch) == ' ' || (ch) == '\t')
+
+#define STR(x) vstring_str(x)
+
/* readlline - read one logical line */
-VSTRING *readlline(VSTRING *buf, VSTREAM *fp, int *lineno, int stripnl)
+VSTRING *readlline(VSTRING *buf, VSTREAM *fp, int *lineno, int strip_noise)
{
int ch;
int next;
+ int state;
/*
- * Lines that start with whitespace continue the preceding line.
+ * Lines that start with whitespace continue the preceding line. Comments
+ * always terminate at the first newline.
*/
VSTRING_RESET(buf);
+ if (strip_noise)
+ state = READLL_STATE_WANT_LWSP;
+
while ((ch = VSTREAM_GETC(fp)) != VSTREAM_EOF) {
+ /* Skip leading whitespace that doesn't continue a previous line. */
+ if (VSTRING_LEN(buf) == 0 && LWSP_CHARACTER(ch))
+ continue;
if (ch == '\n') {
- if (stripnl == 0)
- VSTRING_ADDCH(buf, ch);
if (lineno)
*lineno += 1;
- if ((next = VSTREAM_GETC(fp)) == ' ' || next == '\t') {
+ if (strip_noise) {
+ state = READLL_STATE_WANT_LWSP;
+ /* Skip empty, whitespace, or comment line before text. */
+ if (VSTRING_LEN(buf) == 0)
+ continue;
+ } else {
+ VSTRING_ADDCH(buf, ch);
+ /* Terminate empty, whitespace, or comment line before text. */
+ if (VSTRING_LEN(buf) == 1 || STR(buf)[0] == '#')
+ break;
+ }
+ next = VSTREAM_GETC(fp);
+ /* Continue this line if the next line starts with whitespace. */
+ if (LWSP_CHARACTER(next)) {
ch = next;
} else {
if (next != VSTREAM_EOF)
break;
}
}
+ /* Update the comment stripping state machine. */
+ if (strip_noise) {
+ if (state == READLL_STATE_WANT_LWSP) {
+ if (ch == '#') {
+ state = READLL_STATE_IN_COMMENT;
+ } else if (!LWSP_CHARACTER(ch)) {
+ state = READLL_STATE_IN_TEXT;
+ }
+ }
+ if (state == READLL_STATE_IN_COMMENT)
+ continue;
+ }
VSTRING_ADDCH(buf, ch);
}
VSTRING_TERMINATE(buf);
*/
extern VSTRING *readlline(VSTRING *, VSTREAM *, int *, int);
-#define READLL_STRIPNL 1
-#define READLL_KEEPNL 0
+#define READLL_STRIP_NOISE 1
+#define READLL_KEEP_NOISE 0
/* LICENSE
/* .ad