From: Wietse Venema Date: Sun, 16 Dec 2001 05:00:00 +0000 (-0500) Subject: snapshot-20011216 X-Git-Tag: v1.1.0~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=468ab8079190cd4c942315d6158deb8aecd415c7;p=thirdparty%2Fpostfix.git snapshot-20011216 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index e7b96dc48..54be1cf01 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -5770,6 +5770,31 @@ Apologies for any names omitted. to control the delay before sending . (default: 10 seconds) when doing the PIX . 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 as + if the client sent . 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 @@ -5781,7 +5806,8 @@ Open problems: 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. diff --git a/postfix/NFS_README b/postfix/NFS_README new file mode 100644 index 000000000..807beb8df --- /dev/null +++ b/postfix/NFS_README @@ -0,0 +1,33 @@ +> 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. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index bd94c2723..c932a32cb 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,3 +1,17 @@ +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 =========================================== @@ -11,7 +25,7 @@ Stricter checking of Postfix chroot configurations. The Postfix 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 diff --git a/postfix/conf/access b/postfix/conf/access index 59a855eb3..56a4bedcb 100644 --- a/postfix/conf/access +++ b/postfix/conf/access @@ -32,37 +32,39 @@ # 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 @@ -71,13 +73,13 @@ # # 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 @@ -90,33 +92,29 @@ # 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 @@ -125,7 +123,7 @@ # 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) @@ -134,5 +132,5 @@ # P.O. Box 704 # Yorktown Heights, NY 10598, USA # -# 3 +# 1 # diff --git a/postfix/conf/aliases b/postfix/conf/aliases index a836b8700..59bcc60dd 100644 --- a/postfix/conf/aliases +++ b/postfix/conf/aliases @@ -68,56 +68,59 @@ decode: root # # 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. # @@ -129,35 +132,31 @@ decode: root # # 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 @@ -165,7 +164,7 @@ decode: root # addresses. # # recipient_delimiter -# Delimiter that separates recipients from address +# Delimiter that separates recipients from address # extensions. # # STANDARDS @@ -176,7 +175,7 @@ decode: root # 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) @@ -185,5 +184,5 @@ decode: root # P.O. Box 704 # Yorktown Heights, NY 10598, USA # -# 3 +# 1 # diff --git a/postfix/conf/canonical b/postfix/conf/canonical index 34288f8ca..1646465ff 100644 --- a/postfix/conf/canonical +++ b/postfix/conf/canonical @@ -47,91 +47,89 @@ # 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 @@ -148,33 +146,29 @@ # 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. @@ -187,7 +181,7 @@ # 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) @@ -196,5 +190,5 @@ # P.O. Box 704 # Yorktown Heights, NY 10598, USA # -# 4 +# 1 # diff --git a/postfix/conf/pcre_table b/postfix/conf/pcre_table index b4f6326b8..983de3398 100644 --- a/postfix/conf/pcre_table +++ b/postfix/conf/pcre_table @@ -18,18 +18,24 @@ # # 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- @@ -55,10 +61,6 @@ # 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 @@ -81,7 +83,7 @@ # # 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 @@ -100,5 +102,5 @@ # P.O. Box 704 # Yorktown Heights, NY 10598, USA # -# 2 +# 1 # diff --git a/postfix/conf/regexp_table b/postfix/conf/regexp_table index cd9866d92..df06800bf 100644 --- a/postfix/conf/regexp_table +++ b/postfix/conf/regexp_table @@ -18,18 +18,24 @@ # # 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. @@ -55,11 +61,6 @@ # 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. # @@ -71,19 +72,19 @@ # 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 @@ -106,5 +107,5 @@ # P.O. Box 704 # Yorktown Heights, NY 10598, USA # -# 2 +# 1 # diff --git a/postfix/conf/relocated b/postfix/conf/relocated index 37e2f29d0..738480424 100644 --- a/postfix/conf/relocated +++ b/postfix/conf/relocated @@ -33,72 +33,74 @@ # 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 @@ -107,17 +109,13 @@ # 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. # @@ -127,7 +125,7 @@ # 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) @@ -136,5 +134,5 @@ # P.O. Box 704 # Yorktown Heights, NY 10598, USA # -# 3 +# 1 # diff --git a/postfix/conf/sample-regexp-body.cf b/postfix/conf/sample-regexp-body.cf index 344c1ce38..f9d3172da 100644 --- a/postfix/conf/sample-regexp-body.cf +++ b/postfix/conf/sample-regexp-body.cf @@ -21,6 +21,3 @@ # 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 diff --git a/postfix/conf/transport b/postfix/conf/transport index adae6210a..4c40ade17 100644 --- a/postfix/conf/transport +++ b/postfix/conf/transport @@ -32,126 +32,125 @@ # 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). # @@ -161,7 +160,7 @@ # 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 @@ -172,15 +171,10 @@ # 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) @@ -189,5 +183,5 @@ # P.O. Box 704 # Yorktown Heights, NY 10598, USA # -# 4 +# 1 # diff --git a/postfix/conf/virtual b/postfix/conf/virtual index d0a3d7b8a..d2ba3db90 100644 --- a/postfix/conf/virtual +++ b/postfix/conf/virtual @@ -54,13 +54,8 @@ # 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 @@ -94,7 +89,7 @@ # 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. # @@ -108,90 +103,87 @@ # 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 @@ -200,11 +192,11 @@ # 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 @@ -221,7 +213,7 @@ # 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) @@ -230,5 +222,5 @@ # P.O. Box 704 # Yorktown Heights, NY 10598, USA # -# 4 +# 1 # diff --git a/postfix/html/access.5.html b/postfix/html/access.5.html index 2c12de10a..e575307a5 100644 --- a/postfix/html/access.5.html +++ b/postfix/html/access.5.html @@ -33,32 +33,39 @@ ACCESS(5) ACCESS(5) 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. + 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 @@ -67,13 +74,13 @@ ACCESS(5) ACCESS(5) 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 @@ -86,29 +93,29 @@ ACCESS(5) ACCESS(5) 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. + The table format does not understand quoting conventions. SEE ALSO postmap(1) create mapping table @@ -117,7 +124,7 @@ ACCESS(5) ACCESS(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) diff --git a/postfix/html/aliases.5.html b/postfix/html/aliases.5.html index a281a75ff..fd7e77032 100644 --- a/postfix/html/aliases.5.html +++ b/postfix/html/aliases.5.html @@ -35,52 +35,59 @@ ALIASES(5) ALIASES(5) 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: 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. @@ -92,31 +99,31 @@ ALIASES(5) ALIASES(5) 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. 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 @@ -124,7 +131,7 @@ ALIASES(5) ALIASES(5) addresses. recipient_delimiter - Delimiter that separates recipients from address + Delimiter that separates recipients from address extensions. STANDARDS @@ -135,7 +142,7 @@ ALIASES(5) ALIASES(5) 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) diff --git a/postfix/html/canonical.5.html b/postfix/html/canonical.5.html index 53ce0960d..d69e5d1f4 100644 --- a/postfix/html/canonical.5.html +++ b/postfix/html/canonical.5.html @@ -48,82 +48,89 @@ CANONICAL(5) CANONICAL(5) 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. - 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 - 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 @@ -140,24 +147,24 @@ CANONICAL(5) CANONICAL(5) 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 @@ -175,7 +182,7 @@ CANONICAL(5) CANONICAL(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) diff --git a/postfix/html/pcre_table.5.html b/postfix/html/pcre_table.5.html index dcb944bd4..09e869fc6 100644 --- a/postfix/html/pcre_table.5.html +++ b/postfix/html/pcre_table.5.html @@ -19,18 +19,24 @@ PCRE_TABLE(5) PCRE_TABLE(5) 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- @@ -68,7 +74,7 @@ PCRE_TABLE(5) PCRE_TABLE(5) # 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. # @@ -78,7 +84,7 @@ PCRE_TABLE(5) PCRE_TABLE(5) 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 diff --git a/postfix/html/postalias.1.html b/postfix/html/postalias.1.html index b1d6cf7d3..75168f09f 100644 --- a/postfix/html/postalias.1.html +++ b/postfix/html/postalias.1.html @@ -43,7 +43,7 @@ POSTALIAS(1) POSTALIAS(1) keys was found. -f Do not fold the lookup key to lower case while cre- - ating a map. + ating or querying a map. -i Incremental mode. Read entries from standard input and do not truncate an existing database. By diff --git a/postfix/html/postmap.1.html b/postfix/html/postmap.1.html index 711f5d38b..612989201 100644 --- a/postfix/html/postmap.1.html +++ b/postfix/html/postmap.1.html @@ -23,76 +23,83 @@ POSTMAP(1) POSTMAP(1) The format of a lookup table input file is as follows: - o Blank lines are ignored. So are lines beginning - with `#'. - o A table entry has the form key whitespace value - o A line that starts with whitespace continues the - preceding line. - - The key and value 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 + 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 key and value 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 key is mapped to lowercase to make mapping lookups case insensitive. Options: - -N Include the terminating null character that termi- - nates lookup keys and values. By default, Postfix + -N 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. -c config_dir - Read the main.cf configuration file in the named + Read the main.cf configuration file in the named directory instead of the default configuration directory. - -d key Search the specified maps for key and remove one - entry per map. The exit status is zero when the + -d key Search the specified maps for key and remove one + entry per map. The exit status is zero when the requested information was found. If a key value of - 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. -f Do not fold the lookup key to lower case while cre- - ating a map. + ating or querying a map. - -i Incremental mode. Read entries from standard input + -i Incremental mode. Read entries from standard input and do not truncate an existing database. By - default, postmap creates a new database from the + default, postmap creates a new database from the entries in file_name. - -n Don't include the terminating null character that - terminates lookup keys and values. By default, - Postfix does whatever is the default for the host + -n 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. - -q key Search the specified maps for key and print the - first value found on the standard output stream. + -q key Search the specified maps for key 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 - is specified, the program reads - key values from the standard input stream and - prints one line of key value 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 key value output for each key + that was found. The exit status is zero when at least one of the requested keys was found. - -r When updating a table, do not warn about duplicate + -r When updating a table, do not warn about duplicate entries; silently replace them. -v Enable verbose logging for debugging purposes. Mul- - tiple -v options make the software increasingly + tiple -v options make the software increasingly verbose. - -w When updating a table, do not warn about duplicate + -w When updating a table, do not warn about duplicate entries; silently ignore them. Arguments: @@ -100,25 +107,25 @@ POSTMAP(1) POSTMAP(1) file_type The type of database to be produced. - btree The output file is a btree file, named - file_name.db. This is available only on + btree The output file is a btree file, named + file_name.db. This is available only on systems with support for db databases. - dbm The output consists of two files, named - file_name.pag and file_name.dir. This is - available only on systems with support for + dbm The output consists of two files, named + file_name.pag and file_name.dir. This is + available only on systems with support for dbm databases. - hash The output file is a hashed file, named - file_name.db. This is available only on + hash The output file is a hashed file, named + file_name.db. This is available only on systems with support for db databases. - When no file_type is specified, the software uses - the database type specified via the database_type + When no file_type is specified, the software uses + the database type specified via the database_type configuration parameter. file_name - The name of the lookup table source file when + The name of the lookup table source file when rebuilding a database. DIAGNOSTICS @@ -126,8 +133,8 @@ POSTMAP(1) POSTMAP(1) stream. No output means no problems. Duplicate entries are skipped and are flagged with a warning. - postmap terminates with zero exit status in case of suc- - cess (including successful postmap -q lookup) and termi- + postmap terminates with zero exit status in case of suc- + cess (including successful postmap -q lookup) and termi- nates with non-zero exit status in case of failure. ENVIRONMENT @@ -139,12 +146,12 @@ POSTMAP(1) POSTMAP(1) CONFIGURATION PARAMETERS database_type - Default output database type. On many UNIX sys- - tems, the default database type is either hash or + Default output database type. On many UNIX sys- + tems, the default database type is either hash or dbm. LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/html/regexp_table.5.html b/postfix/html/regexp_table.5.html index cae7abe84..11273391a 100644 --- a/postfix/html/regexp_table.5.html +++ b/postfix/html/regexp_table.5.html @@ -19,18 +19,24 @@ REGEXP_TABLE(5) REGEXP_TABLE(5) 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. @@ -67,19 +73,19 @@ REGEXP_TABLE(5) REGEXP_TABLE(5) 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 diff --git a/postfix/html/relocated.5.html b/postfix/html/relocated.5.html index f5b1e8fb9..5ef72fed6 100644 --- a/postfix/html/relocated.5.html +++ b/postfix/html/relocated.5.html @@ -34,24 +34,31 @@ RELOCATED(5) RELOCATED(5) 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 @@ -59,42 +66,42 @@ 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 @@ -103,11 +110,11 @@ RELOCATED(5) RELOCATED(5) 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 @@ -119,7 +126,7 @@ RELOCATED(5) RELOCATED(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) diff --git a/postfix/html/transport.5.html b/postfix/html/transport.5.html index 14a5367f3..7cedd665b 100644 --- a/postfix/html/transport.5.html +++ b/postfix/html/transport.5.html @@ -33,118 +33,125 @@ TRANSPORT(5) TRANSPORT(5) 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. - 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. 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). @@ -154,7 +161,7 @@ TRANSPORT(5) TRANSPORT(5) 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 @@ -168,7 +175,7 @@ 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) diff --git a/postfix/html/virtual.5.html b/postfix/html/virtual.5.html index 65659bcaf..9304514b9 100644 --- a/postfix/html/virtual.5.html +++ b/postfix/html/virtual.5.html @@ -90,7 +90,7 @@ VIRTUAL(5) VIRTUAL(5) 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. @@ -104,80 +104,87 @@ VIRTUAL(5) VIRTUAL(5) 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. - 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 - 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 @@ -186,11 +193,11 @@ VIRTUAL(5) VIRTUAL(5) 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 @@ -207,7 +214,7 @@ VIRTUAL(5) VIRTUAL(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) diff --git a/postfix/man/man1/postalias.1 b/postfix/man/man1/postalias.1 index c7ec54dd6..0917606ff 100644 --- a/postfix/man/man1/postalias.1 +++ b/postfix/man/man1/postalias.1 @@ -41,7 +41,8 @@ If a key value of \fB-\fR is specified, the program reads key 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 diff --git a/postfix/man/man1/postmap.1 b/postfix/man/man1/postmap.1 index b3d1e791f..1ff4e6062 100644 --- a/postfix/man/man1/postmap.1 +++ b/postfix/man/man1/postmap.1 @@ -29,14 +29,20 @@ programs. 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 @@ -60,7 +66,8 @@ If a key value of \fB-\fR is specified, the program reads key 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 diff --git a/postfix/man/man5/access.5 b/postfix/man/man5/access.5 index 6488c0b79..80ce2af17 100644 --- a/postfix/man/man5/access.5 +++ b/postfix/man/man5/access.5 @@ -35,13 +35,19 @@ the lookups are done in a slightly different way as described below. .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 diff --git a/postfix/man/man5/aliases.5 b/postfix/man/man5/aliases.5 index 8eab116ac..89ef2bdee 100644 --- a/postfix/man/man5/aliases.5 +++ b/postfix/man/man5/aliases.5 @@ -40,9 +40,15 @@ An alias definition has the form .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 diff --git a/postfix/man/man5/canonical.5 b/postfix/man/man5/canonical.5 index 1bddf88ff..6cee20288 100644 --- a/postfix/man/man5/canonical.5 +++ b/postfix/man/man5/canonical.5 @@ -50,13 +50,19 @@ Use the \fBaliases\fR(5) map for that purpose. .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 diff --git a/postfix/man/man5/pcre_table.5 b/postfix/man/man5/pcre_table.5 index dde2dcf42..cb4b51aba 100644 --- a/postfix/man/man5/pcre_table.5 +++ b/postfix/man/man5/pcre_table.5 @@ -21,14 +21,19 @@ To find out what types of lookup tables your Postfix system 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 @@ -75,7 +80,7 @@ or $(n) if they aren't followed by whitespace. .na .nf /^Subject: make money fast/ REJECT -/^To: friend@public\\.com/ REJECT +/^To: friend@public\\.com/ REJECT .SH SEE ALSO .na .nf diff --git a/postfix/man/man5/regexp_table.5 b/postfix/man/man5/regexp_table.5 index 36ddf9f93..43a84fb1a 100644 --- a/postfix/man/man5/regexp_table.5 +++ b/postfix/man/man5/regexp_table.5 @@ -21,14 +21,19 @@ To find out what types of lookup tables your Postfix system 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 @@ -63,20 +68,20 @@ by whitespace. .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 diff --git a/postfix/man/man5/relocated.5 b/postfix/man/man5/relocated.5 index 727a732f6..c3cb8de6b 100644 --- a/postfix/man/man5/relocated.5 +++ b/postfix/man/man5/relocated.5 @@ -37,16 +37,22 @@ Table lookups are case insensitive. .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 diff --git a/postfix/man/man5/transport.5 b/postfix/man/man5/transport.5 index d45ec5ba4..0d467b964 100644 --- a/postfix/man/man5/transport.5 +++ b/postfix/man/man5/transport.5 @@ -35,13 +35,19 @@ the lookups are done in a slightly different way as described below. .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 diff --git a/postfix/man/man5/virtual.5 b/postfix/man/man5/virtual.5 index ef75b179d..8ac87c937 100644 --- a/postfix/man/man5/virtual.5 +++ b/postfix/man/man5/virtual.5 @@ -106,7 +106,7 @@ mydestination = $myhostname localhost.$mydomain $mydomain 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. @@ -122,13 +122,19 @@ mail to the sender. .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 diff --git a/postfix/proto/Makefile b/postfix/proto/Makefile new file mode 100644 index 000000000..e69de29bb diff --git a/postfix/proto/Makefile.in b/postfix/proto/Makefile.in index 02397426d..fadc14678 100644 --- a/postfix/proto/Makefile.in +++ b/postfix/proto/Makefile.in @@ -6,6 +6,8 @@ CONFIG = ../conf/access ../conf/aliases ../conf/canonical ../conf/relocated \ ../conf/transport ../conf/virtual ../conf/pcre_table \ ../conf/regexp_table +AWK = awk '{ print; if (NR == 1) print ".pl 9999" }' + update: $(CONFIG) Makefile: Makefile.in @@ -20,25 +22,25 @@ clobber: 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/^/# /' >$@ diff --git a/postfix/proto/access b/postfix/proto/access index a319352cd..55842b6eb 100644 --- a/postfix/proto/access +++ b/postfix/proto/access @@ -27,13 +27,19 @@ # .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 diff --git a/postfix/proto/aliases b/postfix/proto/aliases index a8b420958..8922c01f5 100644 --- a/postfix/proto/aliases +++ b/postfix/proto/aliases @@ -34,9 +34,15 @@ # .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 diff --git a/postfix/proto/canonical b/postfix/proto/canonical index 74346dd18..c803429c7 100644 --- a/postfix/proto/canonical +++ b/postfix/proto/canonical @@ -42,13 +42,19 @@ # .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 diff --git a/postfix/proto/pcre_table b/postfix/proto/pcre_table index 249e9ed98..8579f8974 100644 --- a/postfix/proto/pcre_table +++ b/postfix/proto/pcre_table @@ -15,14 +15,19 @@ # 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 @@ -56,7 +61,7 @@ # # # 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. # # @@ -65,7 +70,7 @@ # \ 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) diff --git a/postfix/proto/regexp_table b/postfix/proto/regexp_table index cb388ab23..be13704e3 100644 --- a/postfix/proto/regexp_table +++ b/postfix/proto/regexp_table @@ -15,14 +15,19 @@ # 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 @@ -55,18 +60,18 @@ # 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) diff --git a/postfix/proto/relocated b/postfix/proto/relocated index 9a272b80c..6b916223e 100644 --- a/postfix/proto/relocated +++ b/postfix/proto/relocated @@ -29,16 +29,22 @@ # .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 diff --git a/postfix/proto/transport b/postfix/proto/transport index ff2c109d1..4e95106c5 100644 --- a/postfix/proto/transport +++ b/postfix/proto/transport @@ -27,13 +27,19 @@ # .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 diff --git a/postfix/proto/virtual b/postfix/proto/virtual index a42646c7e..84c65b685 100644 --- a/postfix/proto/virtual +++ b/postfix/proto/virtual @@ -96,7 +96,7 @@ # 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. # @@ -110,13 +110,19 @@ # .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 diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 6db2bf440..1fc8ab211 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -15,7 +15,7 @@ * 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 diff --git a/postfix/src/global/smtp_stream.c b/postfix/src/global/smtp_stream.c index b919cfaa8..751e92aa6 100644 --- a/postfix/src/global/smtp_stream.c +++ b/postfix/src/global/smtp_stream.c @@ -227,11 +227,13 @@ int smtp_get(VSTRING *vp, VSTREAM *stream, int bound) /* * 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); diff --git a/postfix/src/master/master_ent.c b/postfix/src/master/master_ent.c index 3eb824c97..b8e0bff28 100644 --- a/postfix/src/master/master_ent.c +++ b/postfix/src/master/master_ent.c @@ -242,13 +242,13 @@ MASTER_SERV *get_master_ent() * 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 diff --git a/postfix/src/postalias/postalias.c b/postfix/src/postalias/postalias.c index d4429958c..08c1fb5a7 100644 --- a/postfix/src/postalias/postalias.c +++ b/postfix/src/postalias/postalias.c @@ -35,7 +35,8 @@ /* 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 @@ -197,13 +198,7 @@ static void postalias(char *map_type, char *path_name, * 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 @@ -318,7 +313,8 @@ static void postalias(char *map_type, char *path_name, /* 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); @@ -345,6 +341,8 @@ static int postalias_queries(VSTREAM *in, char **maps, const int map_count) * 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 ? @@ -572,7 +570,10 @@ int main(int argc, char **argv) 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); diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index 59433d4fc..2998b23de 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -342,7 +342,7 @@ static void edit_parameters(int argc, char **argv) */ #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; diff --git a/postfix/src/postdrop/postdrop.c b/postfix/src/postdrop/postdrop.c index 51f95cfdb..c329bc167 100644 --- a/postfix/src/postdrop/postdrop.c +++ b/postfix/src/postdrop/postdrop.c @@ -203,7 +203,7 @@ int main(int argc, char **argv) * 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); /* diff --git a/postfix/src/postmap/postmap.c b/postfix/src/postmap/postmap.c index 70ee670aa..c269549cf 100644 --- a/postfix/src/postmap/postmap.c +++ b/postfix/src/postmap/postmap.c @@ -23,14 +23,20 @@ /* /* 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 @@ -54,7 +60,8 @@ /* 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 @@ -201,7 +208,7 @@ static void postmap(char *map_type, char *path_name, * 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. @@ -266,7 +273,8 @@ static void postmap(char *map_type, char *path_name, /* 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); @@ -293,6 +301,8 @@ static int postmap_queries(VSTREAM *in, char **maps, const int map_count) * 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 ? @@ -520,7 +530,10 @@ int main(int argc, char **argv) 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); diff --git a/postfix/src/sendmail/sendmail.c b/postfix/src/sendmail/sendmail.c index b87416a97..c18c9e679 100644 --- a/postfix/src/sendmail/sendmail.c +++ b/postfix/src/sendmail/sendmail.c @@ -804,7 +804,7 @@ int main(int argc, char **argv) * 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); diff --git a/postfix/src/util/dict.c b/postfix/src/util/dict.c index 7d07d3be0..62163909f 100644 --- a/postfix/src/util/dict.c +++ b/postfix/src/util/dict.c @@ -394,11 +394,9 @@ void dict_load_fp(const char *dict_name, VSTREAM *fp) 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 */ diff --git a/postfix/src/util/dict_pcre.c b/postfix/src/util/dict_pcre.c index 6d3c6f523..15482013f 100644 --- a/postfix/src/util/dict_pcre.c +++ b/postfix/src/util/dict_pcre.c @@ -257,13 +257,7 @@ DICT *dict_pcre_open(const char *map, int unused_flags, int dict_flags) 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 */ diff --git a/postfix/src/util/dict_regexp.c b/postfix/src/util/dict_regexp.c index 1debbe96f..3c0c7a3bb 100644 --- a/postfix/src/util/dict_regexp.c +++ b/postfix/src/util/dict_regexp.c @@ -356,15 +356,9 @@ DICT *dict_regexp_open(const char *map, int unused_flags, int dict_flags) 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); diff --git a/postfix/src/util/readlline.c b/postfix/src/util/readlline.c index 314d6962b..977db3ed9 100644 --- a/postfix/src/util/readlline.c +++ b/postfix/src/util/readlline.c @@ -6,18 +6,26 @@ /* SYNOPSIS /* #include /* -/* 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 @@ -27,9 +35,11 @@ /* .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 @@ -51,24 +61,55 @@ #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) @@ -76,6 +117,18 @@ VSTRING *readlline(VSTRING *buf, VSTREAM *fp, int *lineno, int stripnl) 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); diff --git a/postfix/src/util/readlline.h b/postfix/src/util/readlline.h index 00658433c..dbeb95e4a 100644 --- a/postfix/src/util/readlline.h +++ b/postfix/src/util/readlline.h @@ -22,8 +22,8 @@ */ 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