diff --git a/postfix/HISTORY b/postfix/HISTORY
index 4df04b0db..6f776cf34 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -6547,6 +6547,31 @@ Apologies for any names omitted.
before and after the filter, with header/body checks turned
off in the second cleanup server.
+20020528
+
+ Feature: strict_7bit_headers and strict_8bitmime_body are
+ now separately available. To to turn on both, use
+ strict_8bitmime.
+
+ Cleanup: abandon the use of isspace(3) in the parsing of
+ RFC822 message headers. Files: global/lex_822.h and lots
+ of little places.
+
+ Documentation: replace domain.name by domain.tld in the
+ example config files. The domain exists. They were getting
+ mail from poorly configured Postfix boxes.
+
+ Bugfix: The Postfix sendmail command did not export the
+ MAIL_CONFIG environment setting to the postdrop command.
+ File: global/mail_config.h.
+
+ Incompatibility: by default, turn on the PCRE_DOTALL flag,
+ so that PCRE patterns will match multi-line message headers
+ without causing pain. Suggested by Michael Tokarev. Also
+ documented all those darned undocumented PCRE flags in the
+ pcre_table(5) manual page. Files: util/dict_pcre.c,
+ proto/pcre_table.
+
Open problems:
Medium: old maildrop files are no longer readable by the
diff --git a/postfix/INSTALL b/postfix/INSTALL
index ac9334f26..b0e551e2a 100644
--- a/postfix/INSTALL
+++ b/postfix/INSTALL
@@ -316,7 +316,7 @@ up virtual interfaces for a variety of UNIX versions.
In the /etc/postfix/main.cf file, I would specify
- myhostname = virtual.host.name
+ myhostname = virtual.host.tld
inet_interfaces = $myhostname
mydestination = $myhostname
@@ -402,7 +402,7 @@ configuration language uses lazy evaluation, and does not look at
a parameter value until it is needed at runtime.
First of all, you must specify what domain will be appended to an
-unqualified address (i.e. an address without @domain.name). The
+unqualified address (i.e. an address without @domain.tld). The
"myorigin" parameter defaults to the local hostname, but that is
probably OK only for very small sites.
diff --git a/postfix/README_FILES/ETRN_README b/postfix/README_FILES/ETRN_README
index c7b18d31d..0dc5d7c12 100644
--- a/postfix/README_FILES/ETRN_README
+++ b/postfix/README_FILES/ETRN_README
@@ -77,7 +77,7 @@ can take a while), you're ready to test the "fast ETRN" service.
Telnet to the Postfix SMTP server from a client that is allowed to
execute ETRN commands (by default, that's every client), and type:
- helo my.client.name
+ helo my.client.tld
etrn some.customer.domain
where "some.customer.domain" is the name of a domain that has a
@@ -99,7 +99,7 @@ Repeat the exercise with another domain that your server is willing
to relay to (domain listed in "relay_domains"), but that has no mail
queued.
- helo my.client.name
+ helo my.client.tld
etrn some.other.customer.domain
This time, the "etrn" command should trigger NO mail deliveries at
@@ -110,7 +110,7 @@ Finally, repeat the exercise with a destination that your mail
server is not willing to relay to. It does not matter if your
server has mail queued for that destination.
- helo my.client.name
+ helo my.client.tld
etrn not.a.customer.domain
If your "fast ETRN" caching policy is left at its default setting,
diff --git a/postfix/README_FILES/FILTER_README b/postfix/README_FILES/FILTER_README
index ff062e8b7..d2c598cdc 100644
--- a/postfix/README_FILES/FILTER_README
+++ b/postfix/README_FILES/FILTER_README
@@ -230,7 +230,7 @@ a dedicated listener on port localhost 10026:
localhost:10026 inet n - n - 10 smtpd
-o content_filter=
-o local_recipient_maps=
- -o myhostname=localhost.domain.name
+ -o myhostname=localhost.domain.tld
-o smtpd_helo_restrictions=
-o smtpd_client_restrictions=
-o smtpd_sender_restrictions=
@@ -245,7 +245,7 @@ The "-o local_recipient_maps=" is a safety in case you have specified
local_recipient_maps in the main.cf file. That could interfere with
content filtering.
-The "-o myhostname=localhost.domain.name" avoids a possible problem
+The "-o myhostname=localhost.domain.tld" avoids a possible problem
if the content filter is picky about the hostname that Postfix
sends in SMTP server replies.
@@ -343,7 +343,7 @@ cleanup unix n - n - 0 cleanup
# ensures that the original envelope recipient is seen by the
# content filter.
#
-scan unix n - n - 10 smtp
+scan unix - - n - 10 smtp
-o disable_dns_lookups=yes
#
# This is the SMTP listener that receives filtered messages from
@@ -368,7 +368,7 @@ scan unix n - n - 10 smtp
#
localhost:10026 inet n - n - - smtpd
-o content_filter=
- -o myhostname=localhost.domain.name
+ -o myhostname=localhost.domain.tld
-o local_recipient_maps=
-o virtual_maps=
-o virtual_mailbox_maps=
@@ -395,7 +395,7 @@ cleanup2 unix n - n - 0 cleanup
# Definitely do not set "disable_dns_lookups = yes" here if you
# send mail to the Internet.
#
-smtp unix n - n - - smtp
+smtp unix - - n - - smtp
This causes Postfix to add one extra content filtering record to
each incoming mail message, with content scan:localhost:10025.
diff --git a/postfix/README_FILES/INSTALL b/postfix/README_FILES/INSTALL
index b3e3b246f..b0e551e2a 100644
--- a/postfix/README_FILES/INSTALL
+++ b/postfix/README_FILES/INSTALL
@@ -135,10 +135,20 @@ and so on. In some cases, optimization is turned off automatically.
In order to build with non-default settings, for example, with a
configuration directory other than /etc/postfix, use:
- % make makefiles CCARGS=-DDEF_CONFIG_DIR=\\\\\\\"/some/where\\\\\\\"
+ % make makefiles CCARGS='-DDEF_CONFIG_DIR=\"/some/where\"'
% make
-That's seven backslashes :-) But at least this works with sh and csh.
+Be sure to get the quotes right. These details matter a lot.
+
+Other parameters whose defaults can be specified in this way are:
+
+ Macro name default value for
+ -------------------------------------
+ DEF_COMMAND_DIR command_directory
+ DEF_DAEMON_DIR daemon_directory
+ DEF_SENDMAIL_PATH sendmail_path
+ DEF_MAILQ_PATH mailq_path
+ DEF_NEWALIAS_PATH newaliases_path
In order to build Postfix for very large applications, where you
expect to run more than 1000 delivery processes, you may need to
@@ -209,16 +219,22 @@ In order to install or upgrade Postfix:
postfix:*:12345:12345:postfix:/no/where:/no/shell
+ Note: there should be no whitespace before "postfix:".
+
- Make sure there is a corresponding alias in /etc/aliases:
postfix: root
+ Note: there should be no whitespace before "postfix:".
+
- Create a group "postdrop" with a group id that is not used by
any other user account. Not even by the postfix user account.
My group file entry looks like:
postdrop:*:54321:
+ Note: there should be no whitespace before "postdrop:".
+
NB: this group was optional with older Postfix releases; it is
now required.
@@ -285,7 +301,7 @@ In order to inspect the mail queue, use
% sendmail -bp
-See also the "Care and feeding" section 13 below.
+See also the "Care and feeding" section 12 below.
8 - Configuring Postfix to send and receive mail (virtual interface)
====================================================================
@@ -300,7 +316,7 @@ up virtual interfaces for a variety of UNIX versions.
In the /etc/postfix/main.cf file, I would specify
- myhostname = virtual.host.name
+ myhostname = virtual.host.tld
inet_interfaces = $myhostname
mydestination = $myhostname
@@ -327,7 +343,7 @@ In order to inspect the mail queue, use
% sendmail -bp
-See also the "Care and feeding" section 13 below.
+See also the "Care and feeding" section 12 below.
9 - Turning off sendmail forever
================================
@@ -357,7 +373,7 @@ and watch the syslog file for any complaints from the mail system.
Typical logfile names are: /var/log/maillog or /var/log/syslog.
See /etc/syslog.conf for actual logfile names.
-See also the "Care and feeding" section 13 below.
+See also the "Care and feeding" section 12 below.
10 - Mandatory configuration file edits
=======================================
@@ -386,7 +402,7 @@ configuration language uses lazy evaluation, and does not look at
a parameter value until it is needed at runtime.
First of all, you must specify what domain will be appended to an
-unqualified address (i.e. an address without @domain.name). The
+unqualified address (i.e. an address without @domain.tld). The
"myorigin" parameter defaults to the local hostname, but that is
probably OK only for very small sites.
diff --git a/postfix/README_FILES/LMTP_README b/postfix/README_FILES/LMTP_README
index ca051466b..06a6878ea 100644
--- a/postfix/README_FILES/LMTP_README
+++ b/postfix/README_FILES/LMTP_README
@@ -265,8 +265,8 @@ to route mail for multiple domains to their respective mail retrieval
/etc/postfix/transport:
- domain1.name lmtp1:unix:/path/name
- domain2.name lmtp2:lmtp2host
+ domain1.tld lmtp1:unix:/path/name
+ domain2.tld lmtp2:lmtp2host
/etc/postfix/master.cf:
@@ -466,8 +466,8 @@ Cyrus 1.6.24 LMTP server:
/etc/postfix/transport:
- domain1.name lmtp1:lmtp1host
- domain2.name lmtp2:lmtp2host
+ domain1.tld lmtp1:lmtp1host
+ domain2.tld lmtp2:lmtp2host
/etc/postfix/master.cf:
diff --git a/postfix/README_FILES/SASL_README b/postfix/README_FILES/SASL_README
index ccc22a2fb..de06bb28b 100644
--- a/postfix/README_FILES/SASL_README
+++ b/postfix/README_FILES/SASL_README
@@ -190,9 +190,9 @@ Testing SASL authentication in the Postfix SMTP server
To test the whole mess, connect to the SMTP server, and you should
be able to have a conversation like this:
- 220 server.host.name ESMTP Postfix
- EHLO client.host.name
- 250-server.host.name
+ 220 server.host.tld ESMTP Postfix
+ EHLO client.host.tld
+ 250-server.host.tld
250-PIPELINING
250-SIZE 10240000
250-ETRN
diff --git a/postfix/README_FILES/VIRTUAL_README b/postfix/README_FILES/VIRTUAL_README
index 0a648ab08..821919026 100644
--- a/postfix/README_FILES/VIRTUAL_README
+++ b/postfix/README_FILES/VIRTUAL_README
@@ -270,11 +270,11 @@ domains):
virtual_maps = hash:/etc/postfix/virtual
/etc/postfix/virtual:
- user@domain.name user@domain.name, user@autoreply.domain.name
+ user@domain.tld user@domain.tld, user@autoreply.domain.tld
This delivers mail to the recipient, and sends a copy of the mail
to the address that produces automatic replies. The address can be
serviced on a different machine, or it can be serviced locally by
setting up a transport map entry that pipes all mail for the
-autoreply.domain.name into some script that sends an automatic
+autoreply.domain.tld into some script that sends an automatic
reply back to the sender.
diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES
index 8c226a12d..4610c389d 100644
--- a/postfix/RELEASE_NOTES
+++ b/postfix/RELEASE_NOTES
@@ -12,6 +12,36 @@ snapshot release). Patches change the patchlevel and the release
date. Snapshots change only the release date, unless they include
the same bugfixes as a patch release.
+Incompatible changes with Postfix snapshot 1.1.11-20020528
+==========================================================
+
+With PCRE pattern matching, the `.' metacharacter now matches all
+characters including newline characters. This makes PCRE pattern
+matching more convenient to use with multi-line message headers,
+and also makes PCRE more compatible with regexp pattern matching.
+The pcre_table(5) manual page has been greatly revised.
+
+Major changes with Postfix snapshot 1.1.11-20020528
+===================================================
+
+Postfix can enforce specific aspects of the MIME standards while
+receiving mail.
+
+* Specify "strict_7bit_headers = yes" to disallow 8-bit characters
+ in message headers. These are always illegal.
+
+* Specify "strict_8bitmime_body = yes" to block mail with 8-bit
+ content that is not properly labeled as 8-bit MIME. This blocks
+ mail from poorly written mail software, including (bounces from
+ qmail, bounces from Postfix before snapshot 20020514, and Majordomo
+ approval requests) that contain valid 8BITMIME mail.
+
+* Specify "strict_8bitmime = yes" to turn on both strict_7bit_headers
+ and strict_8bitmime_body.
+
+* Specify "strict_mime_encoding_domain = yes" to block mail from
+ poorly written mail software. More details in conf/sample-mime.cf.
+
Incompatible changes with Postfix snapshot 1.1.11-20020527
==========================================================
@@ -71,13 +101,6 @@ delivering to an SMTP server that does not announce 8BITMIME support.
To disable, specify "disable_mime_output_conversion = yes". However,
this conversion is required by RFC standards.
-Postfix can enforce some aspects of the MIME standards while
-receiving mail. Specify "strict_8bitmime = yes" to disallow 8-bit
-characters except where allowed by the MIME standard, and specify
-"strict_mime_encoding_domain = yes" to block mail from poorly
-written mail software, including majordomo approval requests that
-contain valid 8BITMIME mail. More details in conf/sample-mime.cf.
-
Incompatible changes with Postfix snapshot 1.1.10-20020514
==========================================================
diff --git a/postfix/conf/access b/postfix/conf/access
index 4bc39ca06..0b1148ed0 100644
--- a/postfix/conf/access
+++ b/postfix/conf/access
@@ -53,16 +53,16 @@
# user@domain
# Matches the specified mail address.
#
-# domain.name
-# Matches domain.name as the domain part of an email
+# domain.tld
+# Matches domain.tld as the domain part of an email
# address.
#
-# The pattern domain.name also matches subdomains,
-# but only when the string smtpd_access_maps is
-# listed in the Postfix parent_domain_matches_subdo-
-# mains configuration setting. Otherwise, specify
-# .domain.name (note the initial dot) in order to
-# match subdomains.
+# The pattern domain.tld also matches subdomains, but
+# only when the string smtpd_access_maps is listed in
+# the Postfix parent_domain_matches_subdomains con-
+# figuration setting. Otherwise, specify .domain.tld
+# (note the initial dot) in order to match subdo-
+# mains.
#
# user@ Matches all mail addresses with the specified user
# part.
@@ -85,15 +85,15 @@
# networked tables such as NIS, LDAP or SQL, the following
# lookup patterns are examined in the order as listed:
#
-# domain.name
-# Matches domain.name.
+# domain.tld
+# Matches domain.tld.
#
-# The pattern domain.name also matches subdomains,
-# but only when the string smtpd_access_maps is
-# listed in the Postfix parent_domain_matches_subdo-
-# mains configuration setting. Otherwise, specify
-# .domain.name (note the initial dot) in order to
-# match subdomains.
+# The pattern domain.tld also matches subdomains, but
+# only when the string smtpd_access_maps is listed in
+# the Postfix parent_domain_matches_subdomains con-
+# figuration setting. Otherwise, specify .domain.tld
+# (note the initial dot) in order to match subdo-
+# mains.
#
# net.work.addr.ess
#
diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf
index de4d7fcf2..76c79866a 100644
--- a/postfix/conf/main.cf
+++ b/postfix/conf/main.cf
@@ -65,15 +65,15 @@ mail_owner = postfix
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#
-#myhostname = host.domain.name
-#myhostname = virtual.domain.name
+#myhostname = host.domain.tld
+#myhostname = virtual.domain.tld
# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
# $mydomain is used as a default value for many other configuration
# parameters.
#
-#mydomain = domain.name
+#mydomain = domain.tld
# SENDING MAIL
#
@@ -436,14 +436,14 @@ mail_owner = postfix
#
# Postfix maintains per-destination logfiles with information about
# deferred mail, so that mail can be flushed quickly with the SMTP
-# "ETRN domain.name" command, or by executing "sendmail -qRdomain.name".
+# "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".
#
# By default, Postfix maintains deferred mail logfile information
# only for destinations that Postfix is willing to relay to (as
# specified in the relay_domains parameter). For other destinations,
# Postfix attempts to deliver ALL queued mail after receiving the
-# SMTP "ETRN domain.name" command, or after execution of "sendmail
-# -qRdomain.name". This can be slow when a lot of mail is queued.
+# SMTP "ETRN domain.tld" command, or after execution of "sendmail
+# -qRdomain.tld". This can be slow when a lot of mail is queued.
#
# The fast_flush_domains parameter controls what destinations are
# eligible for this "fast ETRN/sendmail -qR" service.
diff --git a/postfix/conf/pcre_table b/postfix/conf/pcre_table
index 423a31768..fd020255f 100644
--- a/postfix/conf/pcre_table
+++ b/postfix/conf/pcre_table
@@ -37,28 +37,87 @@
# ally the forward slash is used). The regular expression
# can contain whitespace.
#
-# By default, matching is case-insensitive, although follow-
-# ing the second slash with an `i' flag will reverse this.
-# Other flags are supported, but the only other useful one
-# is `U', which makes matching ungreedy (see PCRE documenta-
-# tion and source for more info).
+# By default, matching is case-insensitive, and newlines are
+# not treated as special characters. The behavior is con-
+# trolled by flags, which are toggled by appending one or
+# more of the following characters after the pattern:
#
-# Each pattern is applied to the entire lookup key string.
-# Depending on the application, that string is an entire
+# i (default: on)
+# Toggles the case sensitivity flag. By default,
+# matching is case insensitive.
+#
+# m (default: off)
+# Toggles the PCRE_MULTILINE flag. When the flag is
+# on, the ^ and $ metacharacters match immediately
+# after and immediately before a newline character,
+# respectively, in addition to matching at the start
+# and end of the subject string.
+#
+# s (default: on)
+# Toggle the PCRE_DOTALL flag. When the flag is on,
+# the . metacharacter matches the newline character.
+# With Postfix versions prior to 20020528, The flag
+# is off by default, which is inconvenient for multi-
+# line message header matching.
+#
+# x (default: off)
+# Toggles the pcre extended flag. When the flag is
+# on, whitespace in the pattern (other than in a
+# character class) and characters between a # outside
+# a character class and the next newline character
+# are ignored. An escaping backslash can be used to
+# include a whitespace or # character as part of the
+# pattern.
+#
+# A (default: off)
+# Toggles the PCRE_ANCHORED flag. When this flag is
+# set, the pattern is forced to be "anchored", that
+# is, it is constrained to match only at the start of
+# the string which is being searched (the "subject
+# string"). This effect can also be achieved by
+# appropriate constructs in the pattern itself.
+#
+# E (default: off)
+# Toggles the PCRE_DOLLAR_ENDONLY flag. When this
+# flag is set, a $ metacharacter in the pattern
+# matches only at the end of the subject string.
+# Without this flag, a dollar also matches immedi-
+# ately before the final character if it is a newline
+# character (but not before any other newline charac-
+# ters). This flag is ignored if PCRE_MULTILINE flag
+# is set.
+#
+# U (default: off)
+# Toggles the ungreedy matching flag. When this flag
+# is set, the pattern matching engine inverts the
+# "greediness" of the quantifiers so that they are
+# not greedy by default, but become greedy if fol-
+# lowed by "?". This flag can also set by a (?U)
+# modifier within the pattern.
+#
+# X (default: off)
+# Toggles the PCRE_EXTRA flag. When this flag is
+# set, any backslash in a pattern that is followed by
+# a letter that has no special meaning causes an
+# error, thus reserving these combinations for future
+# expansion.
+#
+# Each pattern is applied to the entire lookup key string.
+# Depending on the application, 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 user and domain constituent parts,
+# mail address. Thus, 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,
# 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.
#
-# 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
-# string may need to be written as ${n} or $(n) if they
+# 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
+# string may need to be written as ${n} or $(n) if they
# aren't followed by whitespace.
#
# EXAMPLE SMTPD ACCESS MAP
diff --git a/postfix/conf/regexp_table b/postfix/conf/regexp_table
index 162ad09f6..eed807ab7 100644
--- a/postfix/conf/regexp_table
+++ b/postfix/conf/regexp_table
@@ -44,21 +44,22 @@
# By default, matching is case-insensitive, although follow-
# ing the second slash with an `i' flag will reverse this.
# Other flags are `x' (disable extended expression syntax),
-# and `m' (enable multi-line mode).
+# and `m' (enable multi-line mode, that is, treat newline
+# characters as special).
#
-# Each pattern is applied to the entire lookup key string.
-# Depending on the application, that string is an entire
+# Each pattern is applied to the entire lookup key string.
+# Depending on the application, 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 user and domain constituent parts,
+# mail address. Thus, 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,
# 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.
#
-# Substitution of substrings from the matched expression
+# Substitution of substrings from the matched expression
# into the result string is possible using $1, $2, etc.. The
# macros in the result string may need to be written as ${n}
# or $(n) if they aren't followed by whitespace.
diff --git a/postfix/conf/sample-mime.cf b/postfix/conf/sample-mime.cf
index 9cba90f95..687a24ac4 100644
--- a/postfix/conf/sample-mime.cf
+++ b/postfix/conf/sample-mime.cf
@@ -34,16 +34,28 @@ mime_boundary_length_limit = 2048
#
mime_nesting_limit = 20
-# Specify "yes" to reject mail with 8-bit text in message headers,
-# and with 8-bit text in message bodies that either claim to be 7-bit
-# format or that default to 7-bit format. This optional restriction
+# Specify "yes" to reject mail with 8-bit text in message headers.
+# This optional restriction is enforced while receiving mail.
+#
+# This blocks mail from poorly written mail software.
+#
+strict_7bit_headers = no
+
+# Specify "yes" to reject mail with 8-bit text in message bodies that
+# are not sent as valid 8-bit MIME mail. This optional restriction
# is enforced while receiving mail.
#
# This blocks mail from poorly written mail software. Unfortunately,
-# this also blocks approval requests from Majordomo when the included
-# request contains valid 8-bit MIME mail, and it may block 8-bit mail
+# this also blocks (bounces from qmail, bounces from older Postfix
+# versions, and approval requests from Majordomo) when the included
+# message contains valid 8-bit MIME mail, and it may block 8-bit mail
# that is piped into /bin/mail or other MIME challenged software.
#
+strict_8bitmime_body = no
+
+# Specify "yes" to turn on both strict_7bit_headers and
+# strict_8bitmime_body.
+#
strict_8bitmime = no
# Specify "yes" to reject mail with invalid Content-Transfer-Encoding:
diff --git a/postfix/conf/sample-misc.cf b/postfix/conf/sample-misc.cf
index 4f790f0ca..8f7e2ed45 100644
--- a/postfix/conf/sample-misc.cf
+++ b/postfix/conf/sample-misc.cf
@@ -209,14 +209,14 @@ mydestination = $myhostname, localhost.$mydomain
# $mydomain is used as a default value for many other configuration
# parameters.
#
-#mydomain = domain.name
+#mydomain = domain.tld
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#
-#myhostname = host.domain.name
+#myhostname = host.domain.tld
# The myorigin parameter specifies the domain that locally-posted
# mail appears to come from. The default is to append $myhostname,
@@ -300,10 +300,10 @@ delay_notice_recipient = postmaster
error_notice_recipient = postmaster
# The parent_domain_matches_subdomains parameter specifies what
-# Postfix features use "domain.name matches sub.domain.name" style
-# pattern matching instead of requiring ".domain.name". This is
+# Postfix features use "domain.tld matches sub.domain.tld" style
+# pattern matching instead of requiring ".domain.tld". This is
# planned backwards compatibility: eventually, all Postfix features
-# are expected to require ".domain.name" style patterns.
+# are expected to require ".domain.tld" style patterns.
#
parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,
mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,
diff --git a/postfix/conf/transport b/postfix/conf/transport
index 273fee08b..3e5aece89 100644
--- a/postfix/conf/transport
+++ b/postfix/conf/transport
@@ -161,9 +161,9 @@
# command after a configuration change.
#
# parent_domain_matches_subdomains
-# List of Postfix features that use domain.name pat-
-# terns to match sub.domain.name (as opposed to
-# requiring .domain.name patterns).
+# List of Postfix features that use domain.tld pat-
+# terns to match sub.domain.tld (as opposed to
+# requiring .domain.tld patterns).
#
# transport_maps
# List of transport lookup tables.
diff --git a/postfix/html/access.5.html b/postfix/html/access.5.html
index d75975ae2..2e1400596 100644
--- a/postfix/html/access.5.html
+++ b/postfix/html/access.5.html
@@ -54,16 +54,16 @@ ACCESS(5) ACCESS(5)
user@domain
Matches the specified mail address.
- domain.name
- Matches domain.name as the domain part of an email
+ domain.tld
+ Matches domain.tld as the domain part of an email
address.
- The pattern domain.name also matches subdomains,
- but only when the string smtpd_access_maps is
- listed in the Postfix parent_domain_matches_subdo-
- mains configuration setting. Otherwise, specify
- .domain.name (note the initial dot) in order to
- match subdomains.
+ The pattern domain.tld also matches subdomains, but
+ only when the string smtpd_access_maps is listed in
+ the Postfix parent_domain_matches_subdomains con-
+ figuration setting. Otherwise, specify .domain.tld
+ (note the initial dot) in order to match subdo-
+ mains.
user@ Matches all mail addresses with the specified user
part.
@@ -86,15 +86,15 @@ ACCESS(5) ACCESS(5)
networked tables such as NIS, LDAP or SQL, the following
lookup patterns are examined in the order as listed:
- domain.name
- Matches domain.name.
+ domain.tld
+ Matches domain.tld.
- The pattern domain.name also matches subdomains,
- but only when the string smtpd_access_maps is
- listed in the Postfix parent_domain_matches_subdo-
- mains configuration setting. Otherwise, specify
- .domain.name (note the initial dot) in order to
- match subdomains.
+ The pattern domain.tld also matches subdomains, but
+ only when the string smtpd_access_maps is listed in
+ the Postfix parent_domain_matches_subdomains con-
+ figuration setting. Otherwise, specify .domain.tld
+ (note the initial dot) in order to match subdo-
+ mains.
net.work.addr.ess
diff --git a/postfix/html/basic.html b/postfix/html/basic.html
index 7e38a8d6c..26db800a8 100644
--- a/postfix/html/basic.html
+++ b/postfix/html/basic.html
@@ -410,7 +410,7 @@ or you would have a mailer loop.
Host running virtual mailers:
- inet_interfaces = virtual.host.name (virtual domain)
+ inet_interfaces = virtual.host.tld (virtual domain)
inet_interfaces = $myhostname localhost.$mydomain
(non-virtual mailer)
diff --git a/postfix/html/cleanup.8.html b/postfix/html/cleanup.8.html
index ba7f6eb63..028b0e22a 100644
--- a/postfix/html/cleanup.8.html
+++ b/postfix/html/cleanup.8.html
@@ -110,13 +110,24 @@ CLEANUP(8) CLEANUP(8)
nested deeper.
strict_8bitmime
- Reject mail with 8-bit text in message headers, and
- with 8-bit text in content that claims to be 7-bit,
- or that has no explicit content encoding informa-
- tion. This blocks mail mail poorly written mail
- software. Unfortunately, this also breaks majordomo
- approval requests when the included request con-
- tains valid 8-bit MIME mail.
+ Turn on both strict_7bit_headers and strict_8bit-
+ mime_body.
+
+ strict_7bit_headers
+ Reject mail with 8-bit text in message headers.
+ This blocks mail from poorly written applications.
+
+ strict_8bitmime_body
+ Reject mail with 8-bit text in content that claims
+ to be 7-bit, or in content that has no explicit
+ content encoding information. This blocks mail
+ mail poorly written mail software. Unfortunately,
+ this also breaks majordomo approval requests when
+ the included request contains valid 8-bit MIME
+ mail, and it breaks bounces from mailers that do
+ not properly encapsulate 8-bit content (for exam-
+ ple, bounces from qmail or from old versions of
+ Postfix).
strict_mime_domain_encoding
Reject mail with invalid Content-Transfer-Encoding:
diff --git a/postfix/html/faq.html b/postfix/html/faq.html
index 52520d1f8..30a57128f 100644
--- a/postfix/html/faq.html
+++ b/postfix/html/faq.html
@@ -1747,10 +1747,10 @@ all you need:
DNS:
- the.backed-up.domain.name IN MX 100 your.machine.name
+ the.backed-up.domain.tld IN MX 100 your.machine.tld
/etc/postfix/main.cf:
- relay_domains = $mydestination the.backed-up.domain.name
+ relay_domains = $mydestination the.backed-up.domain.tld
smtpd_recipient_restrictions = permit_mynetworks check_relay_domains
@@ -1766,7 +1766,7 @@ need:
transport_maps = hash:/etc/postfix/transport
/etc/postfix/transport:
- the.backed-up.domain.name smtp:[their.mail.host.name]
+ the.backed-up.domain.tld smtp:[their.mail.host.tld]
@@ -2207,14 +2207,14 @@ mail as user@domain
-- In order to send mail as user@domain.name, specify what
+
- In order to send mail as user@domain.tld, specify what
domain is to be appended to addresses that do not have a domain:
/etc/postfix/main.cf:
- myorigin = domain.name
+ myorigin = domain.tld
@@ -2719,7 +2719,7 @@ your system supports, use the command postconf -m.
Postfix logs delivery to virtual
address with the wrong name
-When Postfix delivers mail for a virtual address vuser@vdomain.name
+When Postfix delivers mail for a virtual address vuser@vdomain.tld
that is aliased to a local user, then Postfix logs the local username
instead of the virtual one.
@@ -2742,15 +2742,15 @@ can be expensive if you have many virtual domains.
recipient_delimiter = +
/etc/postfix/virtual_regexp:
- /^vdomain\.name$/ whatever
- /(.*)@vdomain\.name$/ localuser+$1=vdomain.name
+ /^vdomain\.tld$/ whatever
+ /(.*)@vdomain\.tld$/ localuser+$1=vdomain.tld
This delivers the mail as
-localuser+vuser=vdomain.name@your.domain.
+localuser+vuser=vdomain.tld@your.domain.
diff --git a/postfix/html/flush.8.html b/postfix/html/flush.8.html
index 97aefe42a..b62fba9de 100644
--- a/postfix/html/flush.8.html
+++ b/postfix/html/flush.8.html
@@ -136,9 +136,9 @@ FLUSH(8) FLUSH(8)
days).
parent_domain_matches_subdomains
- List of Postfix features that use domain.name pat-
- terns to match sub.domain.name (as opposed to
- requiring .domain.name patterns).
+ List of Postfix features that use domain.tld pat-
+ terns to match sub.domain.tld (as opposed to
+ requiring .domain.tld patterns).
SEE ALSO
smtpd(8) Postfix SMTP server
diff --git a/postfix/html/pcre_table.5.html b/postfix/html/pcre_table.5.html
index 29111019c..bdf83fb85 100644
--- a/postfix/html/pcre_table.5.html
+++ b/postfix/html/pcre_table.5.html
@@ -38,28 +38,87 @@ PCRE_TABLE(5) PCRE_TABLE(5)
ally the forward slash is used). The regular expression
can contain whitespace.
- By default, matching is case-insensitive, although follow-
- ing the second slash with an `i' flag will reverse this.
- Other flags are supported, but the only other useful one
- is `U', which makes matching ungreedy (see PCRE documenta-
- tion and source for more info).
+ By default, matching is case-insensitive, and newlines are
+ not treated as special characters. The behavior is con-
+ trolled by flags, which are toggled by appending one or
+ more of the following characters after the pattern:
- Each pattern is applied to the entire lookup key string.
- Depending on the application, that string is an entire
+ i (default: on)
+ Toggles the case sensitivity flag. By default,
+ matching is case insensitive.
+
+ m (default: off)
+ Toggles the PCRE_MULTILINE flag. When the flag is
+ on, the ^ and $ metacharacters match immediately
+ after and immediately before a newline character,
+ respectively, in addition to matching at the start
+ and end of the subject string.
+
+ s (default: on)
+ Toggle the PCRE_DOTALL flag. When the flag is on,
+ the . metacharacter matches the newline character.
+ With Postfix versions prior to 20020528, The flag
+ is off by default, which is inconvenient for multi-
+ line message header matching.
+
+ x (default: off)
+ Toggles the pcre extended flag. When the flag is
+ on, whitespace in the pattern (other than in a
+ character class) and characters between a # outside
+ a character class and the next newline character
+ are ignored. An escaping backslash can be used to
+ include a whitespace or # character as part of the
+ pattern.
+
+ A (default: off)
+ Toggles the PCRE_ANCHORED flag. When this flag is
+ set, the pattern is forced to be "anchored", that
+ is, it is constrained to match only at the start of
+ the string which is being searched (the "subject
+ string"). This effect can also be achieved by
+ appropriate constructs in the pattern itself.
+
+ E (default: off)
+ Toggles the PCRE_DOLLAR_ENDONLY flag. When this
+ flag is set, a $ metacharacter in the pattern
+ matches only at the end of the subject string.
+ Without this flag, a dollar also matches immedi-
+ ately before the final character if it is a newline
+ character (but not before any other newline charac-
+ ters). This flag is ignored if PCRE_MULTILINE flag
+ is set.
+
+ U (default: off)
+ Toggles the ungreedy matching flag. When this flag
+ is set, the pattern matching engine inverts the
+ "greediness" of the quantifiers so that they are
+ not greedy by default, but become greedy if fol-
+ lowed by "?". This flag can also set by a (?U)
+ modifier within the pattern.
+
+ X (default: off)
+ Toggles the PCRE_EXTRA flag. When this flag is
+ set, any backslash in a pattern that is followed by
+ a letter that has no special meaning causes an
+ error, thus reserving these combinations for future
+ expansion.
+
+ Each pattern is applied to the entire lookup key string.
+ Depending on the application, 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 user and domain constituent parts,
+ mail address. Thus, 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,
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.
- 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
- string may need to be written as ${n} or $(n) if they
+ 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
+ string may need to be written as ${n} or $(n) if they
aren't followed by whitespace.
EXAMPLE SMTPD ACCESS MAP
diff --git a/postfix/html/regexp_table.5.html b/postfix/html/regexp_table.5.html
index f93096c47..a81657af1 100644
--- a/postfix/html/regexp_table.5.html
+++ b/postfix/html/regexp_table.5.html
@@ -45,21 +45,22 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
By default, matching is case-insensitive, although follow-
ing the second slash with an `i' flag will reverse this.
Other flags are `x' (disable extended expression syntax),
- and `m' (enable multi-line mode).
+ and `m' (enable multi-line mode, that is, treat newline
+ characters as special).
- Each pattern is applied to the entire lookup key string.
- Depending on the application, that string is an entire
+ Each pattern is applied to the entire lookup key string.
+ Depending on the application, 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 user and domain constituent parts,
+ mail address. Thus, 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,
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.
- Substitution of substrings from the matched expression
+ Substitution of substrings from the matched expression
into the result string is possible using $1, $2, etc.. The
macros in the result string may need to be written as ${n}
or $(n) if they aren't followed by whitespace.
diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html
index 7c0ae5fe5..1676d4dec 100644
--- a/postfix/html/smtpd.8.html
+++ b/postfix/html/smtpd.8.html
@@ -227,9 +227,9 @@ SMTPD(8) SMTPD(8)
UCE control restrictions
parent_domain_matches_subdomains
- List of Postfix features that use domain.name pat-
- terns to match sub.domain.name (as opposed to
- requiring .domain.name patterns).
+ List of Postfix features that use domain.tld pat-
+ terns to match sub.domain.tld (as opposed to
+ requiring .domain.tld patterns).
smtpd_client_restrictions
Restrict what clients may connect to this mail sys-
diff --git a/postfix/html/transport.5.html b/postfix/html/transport.5.html
index 14692cb4c..096c8f419 100644
--- a/postfix/html/transport.5.html
+++ b/postfix/html/transport.5.html
@@ -162,9 +162,9 @@ TRANSPORT(5) TRANSPORT(5)
command after a configuration change.
parent_domain_matches_subdomains
- List of Postfix features that use domain.name pat-
- terns to match sub.domain.name (as opposed to
- requiring .domain.name patterns).
+ List of Postfix features that use domain.tld pat-
+ terns to match sub.domain.tld (as opposed to
+ requiring .domain.tld patterns).
transport_maps
List of transport lookup tables.
diff --git a/postfix/html/trivial-rewrite.8.html b/postfix/html/trivial-rewrite.8.html
index 3f81b47a5..60284d104 100644
--- a/postfix/html/trivial-rewrite.8.html
+++ b/postfix/html/trivial-rewrite.8.html
@@ -118,9 +118,9 @@ TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8)
details. The :nexthop part is optional.
parent_domain_matches_subdomains
- List of Postfix features that use domain.name pat-
- terns to match sub.domain.name (as opposed to
- requiring .domain.name patterns).
+ List of Postfix features that use domain.tld pat-
+ terns to match sub.domain.tld (as opposed to
+ requiring .domain.tld patterns).
relayhost
The default host to send non-local mail to when no
diff --git a/postfix/man/man5/access.5 b/postfix/man/man5/access.5
index 8f7b99d6c..43846a08b 100644
--- a/postfix/man/man5/access.5
+++ b/postfix/man/man5/access.5
@@ -55,13 +55,13 @@ tables such as NIS, LDAP or SQL, the following lookup patterns are
examined in the order as listed:
.IP \fIuser\fR@\fIdomain\fR
Matches the specified mail address.
-.IP \fIdomain.name\fR
-Matches \fIdomain.name\fR as the domain part of an email address.
+.IP \fIdomain.tld\fR
+Matches \fIdomain.tld\fR as the domain part of an email address.
.sp
-The pattern \fIdomain.name\fR also matches subdomains, but only
+The pattern \fIdomain.tld\fR also matches subdomains, but only
when the string \fBsmtpd_access_maps\fR is listed in the Postfix
\fBparent_domain_matches_subdomains\fR configuration setting.
-Otherwise, specify \fI.domain.name\fR (note the initial dot) in
+Otherwise, specify \fI.domain.tld\fR (note the initial dot) in
order to match subdomains.
.IP \fIuser\fR@
Matches all mail addresses with the specified user part.
@@ -88,13 +88,13 @@ When a mail address localpart contains the optional recipient delimiter
With lookups from indexed files such as DB or DBM, or from networked
tables such as NIS, LDAP or SQL, the following lookup patterns are
examined in the order as listed:
-.IP \fIdomain.name\fR
-Matches \fIdomain.name\fR.
+.IP \fIdomain.tld\fR
+Matches \fIdomain.tld\fR.
.sp
-The pattern \fIdomain.name\fR also matches subdomains, but only
+The pattern \fIdomain.tld\fR also matches subdomains, but only
when the string \fBsmtpd_access_maps\fR is listed in the Postfix
\fBparent_domain_matches_subdomains\fR configuration setting.
-Otherwise, specify \fI.domain.name\fR (note the initial dot) in
+Otherwise, specify \fI.domain.tld\fR (note the initial dot) in
order to match subdomains.
.IP \fInet.work.addr.ess\fR
.IP \fInet.work.addr\fR
diff --git a/postfix/man/man5/pcre_table.5 b/postfix/man/man5/pcre_table.5
index f57d3f2c7..2b1673d01 100644
--- a/postfix/man/man5/pcre_table.5
+++ b/postfix/man/man5/pcre_table.5
@@ -36,12 +36,58 @@ delimiter can be any character, except whitespace or characters
that have special meaning (traditionally the forward slash is used).
The regular expression can contain whitespace.
-By default, matching is case-insensitive, although following
-the second slash with an `i' flag will reverse this. Other flags
-are supported, but the only other useful one is `U', which makes
-matching ungreedy (see PCRE documentation and source for more
-info).
-
+By default, matching is case-insensitive, and newlines are not
+treated as special characters. The behavior is controlled by flags,
+which are toggled by appending one or more of the following
+characters after the pattern:
+.IP "\fBi\fR (default: on)"
+Toggles the case sensitivity flag. By default, matching is case
+insensitive.
+.IP "\fBm\fR (default: off)"
+Toggles the PCRE_MULTILINE flag. When the flag is on, the \fB^\fR
+and \fb$\fR metacharacters match immediately after and immediately
+before a newline character, respectively, in addition to
+matching at the start and end of the subject string.
+.IP "\fBs\fR (default: on)"
+Toggle the PCRE_DOTALL flag. When the flag is on, the \fB.\fR
+metacharacter matches the newline character. With
+Postfix versions prior to 20020528, The flag is off by
+default, which is inconvenient for multi-line message header
+matching.
+.IP "\fBx\fR (default: off)"
+Toggles the pcre extended flag. When the flag is on, whitespace
+in the pattern (other than in a character class) and
+characters between a \fB#\fR outside a character class and
+the next newline character are ignored. An escaping backslash
+can be used to include a whitespace or \fB#\fR character
+as part of the pattern.
+.IP "\fBA\fR (default: off)"
+Toggles the PCRE_ANCHORED flag. When this flag is set,
+the pattern is forced to be "anchored", that is, it is
+constrained to match only at the start of the string which
+is being searched (the "subject string"). This effect can
+also be achieved by appropriate constructs in the pattern
+itself.
+.IP "\fBE\fR (default: off)"
+Toggles the PCRE_DOLLAR_ENDONLY flag. When this flag is set,
+a \fB$\fR metacharacter in the pattern matches only at the
+end of the subject string. Without this flag, a dollar also
+matches immediately before the final character if it is a
+newline character (but not before any other newline
+characters). This flag is ignored if PCRE_MULTILINE
+flag is set.
+.IP "\fBU\fR (default: off)"
+Toggles the ungreedy matching flag. When this flag is set,
+the pattern matching engine inverts the "greediness" of
+the quantifiers so that they are not greedy by default,
+but become greedy if followed by "?". This flag can also
+set by a (?U) modifier within the pattern.
+.IP "\fBX\fR (default: off)"
+Toggles the PCRE_EXTRA flag.
+When this flag is set, any backslash in a pattern that is
+followed by a letter that has no special meaning causes an
+error, thus reserving these combinations for future expansion.
+.PP
Each pattern is applied to the entire lookup key string.
Depending on the application, that string is an entire client
hostname, an entire client IP address, or an entire mail address.
diff --git a/postfix/man/man5/regexp_table.5 b/postfix/man/man5/regexp_table.5
index 209bb8d07..095f21e72 100644
--- a/postfix/man/man5/regexp_table.5
+++ b/postfix/man/man5/regexp_table.5
@@ -42,7 +42,7 @@ slash is used). The regular expression can contain whitespace.
By default, matching is case-insensitive, although following
the second slash with an `i' flag will reverse this. Other flags
are `x' (disable extended expression syntax), and `m' (enable
-multi-line mode).
+multi-line mode, that is, treat newline characters as special).
Each pattern is applied to the entire lookup key string.
Depending on the application, that string is an entire client
diff --git a/postfix/man/man5/transport.5 b/postfix/man/man5/transport.5
index c2363f9a1..a2bc8783c 100644
--- a/postfix/man/man5/transport.5
+++ b/postfix/man/man5/transport.5
@@ -170,9 +170,9 @@ this topic. See the Postfix \fBmain.cf\fR file for syntax details
and for default values. Use the \fBpostfix reload\fR command after
a configuration change.
.IP \fBparent_domain_matches_subdomains\fR
-List of Postfix features that use \fIdomain.name\fR patterns
-to match \fIsub.domain.name\fR (as opposed to
-requiring \fI.domain.name\fR patterns).
+List of Postfix features that use \fIdomain.tld\fR patterns
+to match \fIsub.domain.tld\fR (as opposed to
+requiring \fI.domain.tld\fR patterns).
.IP \fBtransport_maps\fR
List of transport lookup tables.
.PP
diff --git a/postfix/man/man8/cleanup.8 b/postfix/man/man8/cleanup.8
index 835335451..9d556d20b 100644
--- a/postfix/man/man8/cleanup.8
+++ b/postfix/man/man8/cleanup.8
@@ -106,12 +106,18 @@ between boundary strings that do not differ in the first
The maximal nesting level of multipart mail that the MIME
processor can handle. Refuse mail that is nested deeper.
.IP \fBstrict_8bitmime\fR
-Reject mail with 8-bit text in message headers, and with
-8-bit text in content that claims to be 7-bit, or that has
-no explicit content encoding information. This blocks mail
-mail poorly written mail software. Unfortunately, this also
-breaks majordomo approval requests when the included request
-contains valid 8-bit MIME mail.
+Turn on both \fBstrict_7bit_headers\fR and \fBstrict_8bitmime_body\fR.
+.IP \fBstrict_7bit_headers\fR
+Reject mail with 8-bit text in message headers. This blocks
+mail from poorly written applications.
+.IP \fBstrict_8bitmime_body\fR
+Reject mail with 8-bit text in content that claims to be 7-bit,
+or in content that has no explicit content encoding information.
+This blocks mail mail poorly written mail software. Unfortunately,
+this also breaks majordomo approval requests when the included
+request contains valid 8-bit MIME mail, and it breaks bounces from
+mailers that do not properly encapsulate 8-bit content (for example,
+bounces from qmail or from old versions of Postfix).
.IP \fBstrict_mime_domain_encoding\fR
Reject mail with invalid \fBContent-Transfer-Encoding:\fR
information for message/* or multipart/*. This blocks mail
diff --git a/postfix/man/man8/flush.8 b/postfix/man/man8/flush.8
index 4aa4eb46a..61bd122ea 100644
--- a/postfix/man/man8/flush.8
+++ b/postfix/man/man8/flush.8
@@ -127,9 +127,9 @@ a send request for the corresponding destination.
Remove an empty "fast flush" logfile that was not updated in
this amount of time (default time unit: days).
.IP \fBparent_domain_matches_subdomains\fR
-List of Postfix features that use \fIdomain.name\fR patterns
-to match \fIsub.domain.name\fR (as opposed to
-requiring \fI.domain.name\fR patterns).
+List of Postfix features that use \fIdomain.tld\fR patterns
+to match \fIsub.domain.tld\fR (as opposed to
+requiring \fI.domain.tld\fR patterns).
.SH SEE ALSO
.na
.nf
diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8
index 73814beda..c4e690633 100644
--- a/postfix/man/man8/smtpd.8
+++ b/postfix/man/man8/smtpd.8
@@ -195,9 +195,9 @@ it is penalized with tarpit delays.
.ad
.fi
.IP \fBparent_domain_matches_subdomains\fR
-List of Postfix features that use \fIdomain.name\fR patterns
-to match \fIsub.domain.name\fR (as opposed to
-requiring \fI.domain.name\fR patterns).
+List of Postfix features that use \fIdomain.tld\fR patterns
+to match \fIsub.domain.tld\fR (as opposed to
+requiring \fI.domain.tld\fR patterns).
.IP \fBsmtpd_client_restrictions\fR
Restrict what clients may connect to this mail system.
.IP \fBsmtpd_helo_required\fR
diff --git a/postfix/man/man8/trivial-rewrite.8 b/postfix/man/man8/trivial-rewrite.8
index 2fcdf307d..eee387c66 100644
--- a/postfix/man/man8/trivial-rewrite.8
+++ b/postfix/man/man8/trivial-rewrite.8
@@ -115,9 +115,9 @@ The default transport is \fBsmtp\fR.
Syntax is \fItransport\fR:\fInexthop\fR; see \fBtransport\fR(5)
for details. The :\fInexthop\fR part is optional.
.IP \fBparent_domain_matches_subdomains\fR
-List of Postfix features that use \fIdomain.name\fR patterns
-to match \fIsub.domain.name\fR (as opposed to
-requiring \fI.domain.name\fR patterns).
+List of Postfix features that use \fIdomain.tld\fR patterns
+to match \fIsub.domain.tld\fR (as opposed to
+requiring \fI.domain.tld\fR patterns).
.IP \fBrelayhost\fR
The default host to send non-local mail to when no entry is matched
in the \fBtransport\fR(5) table.
diff --git a/postfix/proto/access b/postfix/proto/access
index cd77ecfe9..cdb445966 100644
--- a/postfix/proto/access
+++ b/postfix/proto/access
@@ -45,13 +45,13 @@
# examined in the order as listed:
# .IP \fIuser\fR@\fIdomain\fR
# Matches the specified mail address.
-# .IP \fIdomain.name\fR
-# Matches \fIdomain.name\fR as the domain part of an email address.
+# .IP \fIdomain.tld\fR
+# Matches \fIdomain.tld\fR as the domain part of an email address.
# .sp
-# The pattern \fIdomain.name\fR also matches subdomains, but only
+# The pattern \fIdomain.tld\fR also matches subdomains, but only
# when the string \fBsmtpd_access_maps\fR is listed in the Postfix
# \fBparent_domain_matches_subdomains\fR configuration setting.
-# Otherwise, specify \fI.domain.name\fR (note the initial dot) in
+# Otherwise, specify \fI.domain.tld\fR (note the initial dot) in
# order to match subdomains.
# .IP \fIuser\fR@
# Matches all mail addresses with the specified user part.
@@ -74,13 +74,13 @@
# With lookups from indexed files such as DB or DBM, or from networked
# tables such as NIS, LDAP or SQL, the following lookup patterns are
# examined in the order as listed:
-# .IP \fIdomain.name\fR
-# Matches \fIdomain.name\fR.
+# .IP \fIdomain.tld\fR
+# Matches \fIdomain.tld\fR.
# .sp
-# The pattern \fIdomain.name\fR also matches subdomains, but only
+# The pattern \fIdomain.tld\fR also matches subdomains, but only
# when the string \fBsmtpd_access_maps\fR is listed in the Postfix
# \fBparent_domain_matches_subdomains\fR configuration setting.
-# Otherwise, specify \fI.domain.name\fR (note the initial dot) in
+# Otherwise, specify \fI.domain.tld\fR (note the initial dot) in
# order to match subdomains.
# .IP \fInet.work.addr.ess\fR
# .IP \fInet.work.addr\fR
diff --git a/postfix/proto/pcre_table b/postfix/proto/pcre_table
index 5e6e5d5da..e17cb7fb6 100644
--- a/postfix/proto/pcre_table
+++ b/postfix/proto/pcre_table
@@ -30,12 +30,58 @@
# that have special meaning (traditionally the forward slash is used).
# The regular expression can contain whitespace.
#
-# By default, matching is case-insensitive, although following
-# the second slash with an `i' flag will reverse this. Other flags
-# are supported, but the only other useful one is `U', which makes
-# matching ungreedy (see PCRE documentation and source for more
-# info).
-#
+# By default, matching is case-insensitive, and newlines are not
+# treated as special characters. The behavior is controlled by flags,
+# which are toggled by appending one or more of the following
+# characters after the pattern:
+# .IP "\fBi\fR (default: on)"
+# Toggles the case sensitivity flag. By default, matching is case
+# insensitive.
+# .IP "\fBm\fR (default: off)"
+# Toggles the PCRE_MULTILINE flag. When the flag is on, the \fB^\fR
+# and \fb$\fR metacharacters match immediately after and immediately
+# before a newline character, respectively, in addition to
+# matching at the start and end of the subject string.
+# .IP "\fBs\fR (default: on)"
+# Toggle the PCRE_DOTALL flag. When the flag is on, the \fB.\fR
+# metacharacter matches the newline character. With
+# Postfix versions prior to 20020528, The flag is off by
+# default, which is inconvenient for multi-line message header
+# matching.
+# .IP "\fBx\fR (default: off)"
+# Toggles the pcre extended flag. When the flag is on, whitespace
+# in the pattern (other than in a character class) and
+# characters between a \fB#\fR outside a character class and
+# the next newline character are ignored. An escaping backslash
+# can be used to include a whitespace or \fB#\fR character
+# as part of the pattern.
+# .IP "\fBA\fR (default: off)"
+# Toggles the PCRE_ANCHORED flag. When this flag is set,
+# the pattern is forced to be "anchored", that is, it is
+# constrained to match only at the start of the string which
+# is being searched (the "subject string"). This effect can
+# also be achieved by appropriate constructs in the pattern
+# itself.
+# .IP "\fBE\fR (default: off)"
+# Toggles the PCRE_DOLLAR_ENDONLY flag. When this flag is set,
+# a \fB$\fR metacharacter in the pattern matches only at the
+# end of the subject string. Without this flag, a dollar also
+# matches immediately before the final character if it is a
+# newline character (but not before any other newline
+# characters). This flag is ignored if PCRE_MULTILINE
+# flag is set.
+# .IP "\fBU\fR (default: off)"
+# Toggles the ungreedy matching flag. When this flag is set,
+# the pattern matching engine inverts the "greediness" of
+# the quantifiers so that they are not greedy by default,
+# but become greedy if followed by "?". This flag can also
+# set by a (?U) modifier within the pattern.
+# .IP "\fBX\fR (default: off)"
+# Toggles the PCRE_EXTRA flag.
+# When this flag is set, any backslash in a pattern that is
+# followed by a letter that has no special meaning causes an
+# error, thus reserving these combinations for future expansion.
+# .PP
# Each pattern is applied to the entire lookup key string.
# Depending on the application, that string is an entire client
# hostname, an entire client IP address, or an entire mail address.
diff --git a/postfix/proto/regexp_table b/postfix/proto/regexp_table
index 18578a7e8..c937d895d 100644
--- a/postfix/proto/regexp_table
+++ b/postfix/proto/regexp_table
@@ -36,7 +36,7 @@
# By default, matching is case-insensitive, although following
# the second slash with an `i' flag will reverse this. Other flags
# are `x' (disable extended expression syntax), and `m' (enable
-# multi-line mode).
+# multi-line mode, that is, treat newline characters as special).
#
# Each pattern is applied to the entire lookup key string.
# Depending on the application, that string is an entire client
diff --git a/postfix/proto/transport b/postfix/proto/transport
index abec0c961..a6d71c16c 100644
--- a/postfix/proto/transport
+++ b/postfix/proto/transport
@@ -156,9 +156,9 @@
# and for default values. Use the \fBpostfix reload\fR command after
# a configuration change.
# .IP \fBparent_domain_matches_subdomains\fR
-# List of Postfix features that use \fIdomain.name\fR patterns
-# to match \fIsub.domain.name\fR (as opposed to
-# requiring \fI.domain.name\fR patterns).
+# List of Postfix features that use \fIdomain.tld\fR patterns
+# to match \fIsub.domain.tld\fR (as opposed to
+# requiring \fI.domain.tld\fR patterns).
# .IP \fBtransport_maps\fR
# List of transport lookup tables.
# .PP
diff --git a/postfix/src/bounce/Makefile.in b/postfix/src/bounce/Makefile.in
index 3d2327f38..4c578391c 100644
--- a/postfix/src/bounce/Makefile.in
+++ b/postfix/src/bounce/Makefile.in
@@ -139,6 +139,7 @@ bounce_notify_util.o: ../../include/mail_date.h
bounce_notify_util.o: ../../include/mail_proto.h
bounce_notify_util.o: ../../include/iostuff.h
bounce_notify_util.o: ../../include/attr.h
+bounce_notify_util.o: ../../include/lex_822.h
bounce_notify_util.o: bounce_service.h
bounce_notify_verp.o: bounce_notify_verp.c
bounce_notify_verp.o: ../../include/sys_defs.h
diff --git a/postfix/src/bounce/bounce_notify_util.c b/postfix/src/bounce/bounce_notify_util.c
index d4264d945..1c6485630 100644
--- a/postfix/src/bounce/bounce_notify_util.c
+++ b/postfix/src/bounce/bounce_notify_util.c
@@ -155,6 +155,7 @@
#include
#include
#include
+#include
/* Application-specific. */
@@ -558,7 +559,7 @@ int bounce_original(VSTREAM *bounce, BOUNCE_INFO *bounce_info,
* raw record output here so that we don't throw away binary transparency
* yet.
*/
-#define IS_HEADER(s) (ISSPACE(*(s)) || is_header(s))
+#define IS_HEADER(s) (IS_SPACE_TAB(*(s)) || is_header(s))
bounce_length = 0;
while (status == 0 && (rec_type = rec_get(bounce_info->orig_fp, bounce_info->buf, 0)) > 0) {
diff --git a/postfix/src/cleanup/Makefile.in b/postfix/src/cleanup/Makefile.in
index 493a18a49..4e216c2ba 100644
--- a/postfix/src/cleanup/Makefile.in
+++ b/postfix/src/cleanup/Makefile.in
@@ -298,6 +298,7 @@ cleanup_message.o: ../../include/mail_proto.h
cleanup_message.o: ../../include/iostuff.h
cleanup_message.o: ../../include/attr.h
cleanup_message.o: ../../include/mime_state.h
+cleanup_message.o: ../../include/lex_822.h
cleanup_message.o: cleanup.h
cleanup_message.o: ../../include/maps.h
cleanup_message.o: ../../include/dict.h
diff --git a/postfix/src/cleanup/cleanup.c b/postfix/src/cleanup/cleanup.c
index cdc395568..c1050f28a 100644
--- a/postfix/src/cleanup/cleanup.c
+++ b/postfix/src/cleanup/cleanup.c
@@ -92,12 +92,18 @@
/* The maximal nesting level of multipart mail that the MIME
/* processor can handle. Refuse mail that is nested deeper.
/* .IP \fBstrict_8bitmime\fR
-/* Reject mail with 8-bit text in message headers, and with
-/* 8-bit text in content that claims to be 7-bit, or that has
-/* no explicit content encoding information. This blocks mail
-/* mail poorly written mail software. Unfortunately, this also
-/* breaks majordomo approval requests when the included request
-/* contains valid 8-bit MIME mail.
+/* Turn on both \fBstrict_7bit_headers\fR and \fBstrict_8bitmime_body\fR.
+/* .IP \fBstrict_7bit_headers\fR
+/* Reject mail with 8-bit text in message headers. This blocks
+/* mail from poorly written applications.
+/* .IP \fBstrict_8bitmime_body\fR
+/* Reject mail with 8-bit text in content that claims to be 7-bit,
+/* or in content that has no explicit content encoding information.
+/* This blocks mail mail poorly written mail software. Unfortunately,
+/* this also breaks majordomo approval requests when the included
+/* request contains valid 8-bit MIME mail, and it breaks bounces from
+/* mailers that do not properly encapsulate 8-bit content (for example,
+/* bounces from qmail or from old versions of Postfix).
/* .IP \fBstrict_mime_domain_encoding\fR
/* Reject mail with invalid \fBContent-Transfer-Encoding:\fR
/* information for message/* or multipart/*. This blocks mail
diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c
index 87cf3d33e..313d781f3 100644
--- a/postfix/src/cleanup/cleanup_message.c
+++ b/postfix/src/cleanup/cleanup_message.c
@@ -79,6 +79,7 @@
#include
#include
#include
+#include
/* Application-specific. */
@@ -101,7 +102,7 @@ static void cleanup_out_header(CLEANUP_STATE *state, VSTRING *header_buf)
*/
for (line = start; line; line = next_line) {
next_line = split_at(line, '\n');
- if (line == start || ISSPACE(*line)) {
+ if (line == start || IS_SPACE_TAB(*line)) {
cleanup_out_string(state, REC_TYPE_NORM, line);
} else {
cleanup_out_format(state, REC_TYPE_NORM, "\t%s", line);
@@ -654,9 +655,10 @@ void cleanup_message(CLEANUP_STATE *state, int type, char *buf, int len)
} else {
/* Turn off strict MIME checks if bouncing or forwarding mail. */
if (state->flags & CLEANUP_FLAG_FILTER) {
- if (var_strict_8bitmime)
- mime_options |= (MIME_OPT_REPORT_8BIT_IN_HEADER
- | MIME_OPT_REPORT_8BIT_IN_7BIT_BODY);
+ if (var_strict_8bitmime || var_strict_7bit_hdrs)
+ mime_options |= MIME_OPT_REPORT_8BIT_IN_HEADER;
+ if (var_strict_8bitmime || var_strict_8bit_body)
+ mime_options |= MIME_OPT_REPORT_8BIT_IN_7BIT_BODY;
if (var_strict_encoding)
mime_options |= MIME_OPT_REPORT_ENCODING_DOMAIN;
}
diff --git a/postfix/src/flush/flush.c b/postfix/src/flush/flush.c
index 3541c3117..433432f25 100644
--- a/postfix/src/flush/flush.c
+++ b/postfix/src/flush/flush.c
@@ -111,9 +111,9 @@
/* Remove an empty "fast flush" logfile that was not updated in
/* this amount of time (default time unit: days).
/* .IP \fBparent_domain_matches_subdomains\fR
-/* List of Postfix features that use \fIdomain.name\fR patterns
-/* to match \fIsub.domain.name\fR (as opposed to
-/* requiring \fI.domain.name\fR patterns).
+/* List of Postfix features that use \fIdomain.tld\fR patterns
+/* to match \fIsub.domain.tld\fR (as opposed to
+/* requiring \fI.domain.tld\fR patterns).
/* SEE ALSO
/* smtpd(8) Postfix SMTP server
/* qmgr(8) Postfix queue manager
diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in
index 28d82fd43..db5043003 100644
--- a/postfix/src/global/Makefile.in
+++ b/postfix/src/global/Makefile.in
@@ -57,7 +57,8 @@ HDRS = been_here.h bounce.h canon_addr.h cleanup_user.h clnt_stream.h \
rewrite_clnt.h sent.h smtp_stream.h split_addr.h string_list.h \
sys_exits.h timed_ipc.h tok822.h xtext.h bounce_log.h flush_clnt.h \
mbox_conf.h mbox_open.h abounce.h qmqp_proto.h verp_sender.h \
- match_parent_style.h quote_flags.h mime_state.h header_token.h
+ match_parent_style.h quote_flags.h mime_state.h header_token.h \
+ lex_822.h
TESTSRC = rec2stream.c stream2rec.c recdump.c
WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
-Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
@@ -458,6 +459,7 @@ header_token.o: ../../include/sys_defs.h
header_token.o: ../../include/msg.h
header_token.o: ../../include/vstring.h
header_token.o: ../../include/vbuf.h
+header_token.o: lex_822.h
header_token.o: header_token.h
is_header.o: is_header.c
is_header.o: ../../include/sys_defs.h
@@ -794,6 +796,7 @@ mime_state.o: is_header.h
mime_state.o: header_opts.h
mime_state.o: mail_params.h
mime_state.o: header_token.h
+mime_state.o: lex_822.h
mime_state.o: mime_state.h
mkmap_db.o: mkmap_db.c
mkmap_db.o: ../../include/sys_defs.h
@@ -1076,6 +1079,7 @@ tok822_parse.o: ../../include/sys_defs.h
tok822_parse.o: ../../include/vstring.h
tok822_parse.o: ../../include/vbuf.h
tok822_parse.o: ../../include/msg.h
+tok822_parse.o: lex_822.h
tok822_parse.o: quote_822_local.h
tok822_parse.o: quote_flags.h
tok822_parse.o: tok822.h
diff --git a/postfix/src/global/header_token.c b/postfix/src/global/header_token.c
index 04ab7f2e9..c95207fb3 100644
--- a/postfix/src/global/header_token.c
+++ b/postfix/src/global/header_token.c
@@ -90,16 +90,11 @@
/* Global library. */
+#include
#include
/* Application-specific. */
- /*
- * Special characters and linear white space, as per RFC 822.
- */
-#define RFC822_SPECIALS "()<>@,;:\\\".[]"
-#define RFC822_LWSP(ch) (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r')
-
/*
* Silly little macros.
*/
@@ -127,7 +122,7 @@ int header_token(HEADER_TOKEN *token, int token_len,
cp = CU_CHAR_PTR(*ptr);
tok_count = 0;
if (user_specials == 0)
- user_specials = RFC822_SPECIALS;
+ user_specials = LEX_822_SPECIALS;
/*
* Main parsing loop.
@@ -138,7 +133,7 @@ int header_token(HEADER_TOKEN *token, int token_len,
/*
* Skip RFC 822 linear white space.
*/
- if (RFC822_LWSP(ch))
+ if (IS_SPACE_TAB_CR_LF(ch))
continue;
/*
@@ -182,7 +177,7 @@ int header_token(HEADER_TOKEN *token, int token_len,
break;
if (ch == '\n') { /* unfold */
len = LEN(token_buffer);
- while (len > 0 && RFC822_LWSP(STR(token_buffer)[len - 1]))
+ while (len > 0 && IS_SPACE_TAB_CR_LF(STR(token_buffer)[len - 1]))
len--;
if (len < LEN(token_buffer))
vstring_truncate(token_buffer, len);
@@ -226,7 +221,7 @@ int header_token(HEADER_TOKEN *token, int token_len,
token[tok_count].type = HEADER_TOK_TOKEN;
VSTRING_ADDCH(token_buffer, ch);
}
- while ((ch = *cp) != 0 && !RFC822_LWSP(ch)
+ while ((ch = *cp) != 0 && !IS_SPACE_TAB_CR_LF(ch)
&& !ISCNTRL(ch) && !strchr(user_specials, ch)) {
cp++;
if (tok_count < token_len)
diff --git a/postfix/src/global/lex_822.h b/postfix/src/global/lex_822.h
new file mode 100644
index 000000000..32253faa5
--- /dev/null
+++ b/postfix/src/global/lex_822.h
@@ -0,0 +1,36 @@
+#ifndef _SPACE_822_H_INCLUDED_
+#define _SPACE_822_H_INCLUDED_
+
+/*++
+/* NAME
+/* lex_822 3h
+/* SUMMARY
+/* RFC822 lexicals
+/* SYNOPSIS
+/* #include
+/* DESCRIPTION
+/* .nf
+
+ /*
+ * The predicate macros.
+ */
+#define IS_SPACE_TAB(ch) (ch == ' ' || ch == '\t')
+#define IS_SPACE_TAB_CR_LF(ch) (IS_SPACE_TAB(ch) || ch == '\r' || ch == '\n')
+
+ /*
+ * Special characters as per RFC 822.
+ */
+#define LEX_822_SPECIALS "()<>@,;:\\\".[]"
+
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* Wietse Venema
+/* IBM T.J. Watson Research
+/* P.O. Box 704
+/* Yorktown Heights, NY 10598, USA
+/*--*/
+
+#endif
diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c
index 1350f5eab..28ee3a329 100644
--- a/postfix/src/global/mail_params.c
+++ b/postfix/src/global/mail_params.c
@@ -93,6 +93,8 @@
/* int var_disable_mime_input;
/* int var_disable_mime_oconv;
/* int var_strict_8bitmime;
+/* int var_strict_7bit_hdrs;
+/* int var_strict_8bit_body;
/* int var_strict_encoding;
/*
/* void mail_params_init()
@@ -243,6 +245,8 @@ int var_header_limit;
int var_disable_mime_input;
int var_disable_mime_oconv;
int var_strict_8bitmime;
+int var_strict_7bit_hdrs;
+int var_strict_8bit_body;
int var_strict_encoding;
#define MAIN_CONF_FILE "main.cf"
@@ -501,6 +505,8 @@ void mail_params_init()
VAR_SOFT_BOUNCE, DEF_SOFT_BOUNCE, &var_soft_bounce,
VAR_OWNREQ_SPECIAL, DEF_OWNREQ_SPECIAL, &var_ownreq_special,
VAR_STRICT_8BITMIME, DEF_STRICT_8BITMIME, &var_strict_8bitmime,
+ VAR_STRICT_7BIT_HDRS, DEF_STRICT_7BIT_HDRS, &var_strict_7bit_hdrs,
+ VAR_STRICT_8BIT_BODY, DEF_STRICT_8BIT_BODY, &var_strict_8bit_body,
VAR_STRICT_ENCODING, DEF_STRICT_ENCODING, &var_strict_encoding,
VAR_DISABLE_MIME_INPUT, DEF_DISABLE_MIME_INPUT, &var_disable_mime_input,
VAR_DISABLE_MIME_OCONV, DEF_DISABLE_MIME_OCONV, &var_disable_mime_oconv,
diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h
index d700e409b..c3ef842c6 100644
--- a/postfix/src/global/mail_params.h
+++ b/postfix/src/global/mail_params.h
@@ -1283,7 +1283,7 @@ extern int var_fflush_refresh;
extern char *var_import_environ;
#define VAR_EXPORT_ENVIRON "export_environment"
-#define DEF_EXPORT_ENVIRON "TZ"
+#define DEF_EXPORT_ENVIRON "TZ MAIL_CONFIG"
extern char *var_export_environ;
/*
@@ -1535,6 +1535,14 @@ extern bool var_disable_mime_oconv;
#define DEF_STRICT_8BITMIME 0
extern bool var_strict_8bitmime;
+#define VAR_STRICT_7BIT_HDRS "strict_7bit_headers"
+#define DEF_STRICT_7BIT_HDRS 0
+extern bool var_strict_7bit_hdrs;
+
+#define VAR_STRICT_8BIT_BODY "strict_8bitmime_body"
+#define DEF_STRICT_8BIT_BODY 0
+extern bool var_strict_8bit_body;
+
#define VAR_STRICT_ENCODING "strict_mime_encoding_domain"
#define DEF_STRICT_ENCODING 0
extern bool var_strict_encoding;
diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h
index afc9017ca..727215ba4 100644
--- a/postfix/src/global/mail_version.h
+++ b/postfix/src/global/mail_version.h
@@ -20,7 +20,7 @@
* Patches change the patchlevel and the release date. Snapshots change the
* release date only, unless they include the same bugfix as a patch release.
*/
-#define MAIL_RELEASE_DATE "20020527"
+#define MAIL_RELEASE_DATE "20020528"
#define VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE
diff --git a/postfix/src/global/mime_state.c b/postfix/src/global/mime_state.c
index b895b9f55..0c1193305 100644
--- a/postfix/src/global/mime_state.c
+++ b/postfix/src/global/mime_state.c
@@ -6,7 +6,8 @@
/* SYNOPSIS
/* #include
/*
-/* MIME_STATE *mime_state_alloc(flags, head_out, body_out, context)
+/* MIME_STATE *mime_state_alloc(flags, head_out, head_end,
+/* body_out, body_end, context)
/* int flags;
/* void (*head_out)(void *ptr, int header_class,
/* HEADER_OPTS *header_info, VSTRING *buf);
@@ -159,7 +160,7 @@
/* span multiple input records.
/*
/* This module will not glue together RFC 2231 formatted (boundary)
-/* parameter values. RFC 2231 says claims compatibility with existing
+/* parameter values. RFC 2231 claims compatibility with existing
/* MIME processors. Splitting boundary strings is not backwards
/* compatible.
/*
@@ -226,6 +227,7 @@
#include
#include
#include
+#include
#include
/* Application-specific. */
@@ -269,7 +271,7 @@ struct MIME_STATE {
*/
int static_flags; /* static processing options */
MIME_STATE_HEAD_OUT head_out; /* header output routine */
- MIME_STATE_ANY_END head_end; /* end of prinary header routine */
+ MIME_STATE_ANY_END head_end; /* end of primary header routine */
MIME_STATE_BODY_OUT body_out; /* body output routine */
MIME_STATE_ANY_END body_end; /* end of body output routine */
void *app_context; /* application context */
@@ -590,10 +592,10 @@ static void mime_state_downgrade(MIME_STATE *state, int rec_type,
/*
* Insert a soft line break when the output reaches a critical length
- * before we reach the end of the input line.
+ * before we reach a hard line break.
*/
for (cp = CU_CHAR_PTR(text); cp < CU_CHAR_PTR(text + len); cp++) {
- /* Critical length before the end of the input line. */
+ /* Critical length before hard line break. */
if (LEN(state->output_buffer) > 72) {
VSTRING_ADDCH(state->output_buffer, '=');
state->body_out(state->app_context, REC_TYPE_NORM,
@@ -616,6 +618,8 @@ static void mime_state_downgrade(MIME_STATE *state, int rec_type,
* the output length will grow from 73 characters to 75 characters.
*/
if (rec_type == REC_TYPE_NORM) {
+ if (ch == 0 && LEN(state->output_buffer) > 0)
+ ch = END(state->output_buffer)[-1];
if (ch == ' ' || ch == '\t') {
vstring_truncate(state->output_buffer,
LEN(state->output_buffer) - 1);
@@ -681,7 +685,7 @@ int mime_state_update(MIME_STATE *state, int rec_type,
}
SAVE_PREV_REC_TYPE_AND_RETURN_ERR_FLAGS(state, rec_type);
}
- if (ISSPACE(*text)) {
+ if (IS_SPACE_TAB(*text)) {
if (LEN(state->output_buffer) < var_header_limit) {
vstring_strcat(state->output_buffer, "\n");
vstring_strcat(state->output_buffer, text);
@@ -747,7 +751,7 @@ int mime_state_update(MIME_STATE *state, int rec_type,
*/
if ((header_len = is_header(text)) > 0) {
vstring_strncpy(state->output_buffer, text, header_len);
- for (text += header_len; ISSPACE(*text); text++)
+ for (text += header_len; IS_SPACE_TAB(*text); text++)
/* void */ ;
vstring_strcat(state->output_buffer, text);
SAVE_PREV_REC_TYPE_AND_RETURN_ERR_FLAGS(state, rec_type);
diff --git a/postfix/src/global/tok822_parse.c b/postfix/src/global/tok822_parse.c
index 3555031b2..86567c7f7 100644
--- a/postfix/src/global/tok822_parse.c
+++ b/postfix/src/global/tok822_parse.c
@@ -107,6 +107,7 @@
/* Global library. */
+#include "lex_822.h"
#include "quote_822_local.h"
#include "tok822.h"
@@ -121,7 +122,7 @@
} else if (!(cond)) { \
break; \
} \
- VSTRING_ADDCH(t->vstr, ISSPACE(c) ? ' ' : c); \
+ VSTRING_ADDCH(t->vstr, IS_SPACE_TAB_CR_LF(c) ? ' ' : c); \
s++; \
} \
VSTRING_TERMINATE(t->vstr); \
@@ -155,10 +156,9 @@
/*
* Single-character operators. We include the % and ! operators because not
* all the world is RFC822. XXX Make this operator list configurable when we
- * have a real rewriting language.
+ * have a real rewriting language. Include | for aliases file parsing.
*/
-static char tok822_opchar[] = "|\"(),.:;<>@[]%!";
-
+static char tok822_opchar[] = "|%!" LEX_822_SPECIALS;
static void tok822_quote_atom(TOK822 *);
static const char *tok822_comment(TOK822 *, const char *);
static TOK822 *tok822_group(int, TOK822 *, TOK822 *, int);
@@ -331,7 +331,7 @@ TOK822 *tok822_scan(const char *str, TOK822 **tailp)
* white space as part of the token stream. Thanks a lot, people.
*/
while ((ch = *(unsigned char *) str++) != 0) {
- if (ISSPACE(ch))
+ if (IS_SPACE_TAB_CR_LF(ch))
continue;
if (ch == '(') {
tp = tok822_alloc(TOK822_COMMENT, (char *) 0);
@@ -347,7 +347,7 @@ TOK822 *tok822_scan(const char *str, TOK822 **tailp)
} else {
tp = tok822_alloc(TOK822_ATOM, (char *) 0);
str -= 1; /* \ may be first */
- COLLECT(tp, str, ch, !ISSPACE(ch) && !strchr(tok822_opchar, ch));
+ COLLECT(tp, str, ch, !IS_SPACE_TAB_CR_LF(ch) && !strchr(tok822_opchar, ch));
tok822_quote_atom(tp);
}
if (head == 0) {
@@ -463,7 +463,7 @@ static void tok822_quote_atom(TOK822 *tp)
* (and still passing it on as 8-bit data) we leave 8-bit data alone.
*/
for (cp = vstring_str(tp->vstr); (ch = *(unsigned char *) cp) != 0; cp++) {
- if ( /* !ISASCII(ch) || */ ISSPACE(ch)
+ if ( /* !ISASCII(ch) || */ ch == ' '
|| ISCNTRL(ch) || strchr(tok822_opchar, ch)) {
tp->type = TOK822_QSTRING;
break;
diff --git a/postfix/src/pickup/Makefile.in b/postfix/src/pickup/Makefile.in
index a30d18800..373a9e91f 100644
--- a/postfix/src/pickup/Makefile.in
+++ b/postfix/src/pickup/Makefile.in
@@ -75,4 +75,5 @@ pickup.o: ../../include/mail_params.h
pickup.o: ../../include/mail_conf.h
pickup.o: ../../include/record.h
pickup.o: ../../include/rec_type.h
+pickup.o: ../../include/lex_822.h
pickup.o: ../../include/mail_server.h
diff --git a/postfix/src/pickup/pickup.c b/postfix/src/pickup/pickup.c
index da2ff07c0..6357fd790 100644
--- a/postfix/src/pickup/pickup.c
+++ b/postfix/src/pickup/pickup.c
@@ -106,6 +106,7 @@
#include
#include
#include
+#include
/* Single-threaded server skeleton. */
@@ -223,7 +224,7 @@ static int copy_segment(VSTREAM *qfile, VSTREAM *cleanup, PICKUP_INFO *info,
*/
if (check_first) {
check_first = 0;
- if (VSTRING_LEN(buf) > 0 && ISSPACE(vstring_str(buf)[0]))
+ if (VSTRING_LEN(buf) > 0 && IS_SPACE_TAB(vstring_str(buf)[0]))
rec_put(cleanup, REC_TYPE_NORM, "", 0);
}
if ((REC_PUT_BUF(cleanup, type, buf)) < 0)
diff --git a/postfix/src/qmqpd/Makefile.in b/postfix/src/qmqpd/Makefile.in
index 53703cb95..77fb1bf14 100644
--- a/postfix/src/qmqpd/Makefile.in
+++ b/postfix/src/qmqpd/Makefile.in
@@ -94,6 +94,7 @@ qmqpd.o: ../../include/match_ops.h
qmqpd.o: ../../include/quote_822_local.h
qmqpd.o: ../../include/quote_flags.h
qmqpd.o: ../../include/match_parent_style.h
+qmqpd.o: ../../include/lex_822.h
qmqpd.o: ../../include/mail_server.h
qmqpd.o: qmqpd.h
qmqpd_peer.o: qmqpd_peer.c
diff --git a/postfix/src/qmqpd/qmqpd.c b/postfix/src/qmqpd/qmqpd.c
index e0cf6834f..dbcfcb4f0 100644
--- a/postfix/src/qmqpd/qmqpd.c
+++ b/postfix/src/qmqpd/qmqpd.c
@@ -136,6 +136,7 @@
#include
#include
#include
+#include
/* Single-threaded server skeleton. */
@@ -380,7 +381,7 @@ static void qmqpd_write_content(QMQPD_STATE *state)
continue;
}
first = 0;
- if (len > 0 && ISSPACE(start[0]))
+ if (len > 0 && IS_SPACE_TAB(start[0]))
rec_put(state->cleanup, REC_TYPE_NORM, "", 0);
}
if (rec_put(state->cleanup, rec_type, start, len) < 0) {
diff --git a/postfix/src/smtpd/Makefile.in b/postfix/src/smtpd/Makefile.in
index 0da6928fd..e881b28f4 100644
--- a/postfix/src/smtpd/Makefile.in
+++ b/postfix/src/smtpd/Makefile.in
@@ -132,6 +132,7 @@ smtpd.o: ../../include/match_list.h
smtpd.o: ../../include/match_ops.h
smtpd.o: ../../include/quote_822_local.h
smtpd.o: ../../include/quote_flags.h
+smtpd.o: ../../include/lex_822.h
smtpd.o: ../../include/mail_server.h
smtpd.o: smtpd_token.h
smtpd.o: smtpd.h
diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c
index ac0f79f6e..cf2adfb46 100644
--- a/postfix/src/smtpd/smtpd.c
+++ b/postfix/src/smtpd/smtpd.c
@@ -181,9 +181,9 @@
/* .ad
/* .fi
/* .IP \fBparent_domain_matches_subdomains\fR
-/* List of Postfix features that use \fIdomain.name\fR patterns
-/* to match \fIsub.domain.name\fR (as opposed to
-/* requiring \fI.domain.name\fR patterns).
+/* List of Postfix features that use \fIdomain.tld\fR patterns
+/* to match \fIsub.domain.tld\fR (as opposed to
+/* requiring \fI.domain.tld\fR patterns).
/* .IP \fBsmtpd_client_restrictions\fR
/* Restrict what clients may connect to this mail system.
/* .IP \fBsmtpd_helo_required\fR
@@ -313,6 +313,7 @@
#include
#include
#include
+#include
/* Single-threaded server skeleton. */
@@ -1011,7 +1012,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
continue;
}
first = 0;
- if (len > 0 && ISSPACE(start[0]))
+ if (len > 0 && IS_SPACE_TAB(start[0]))
rec_put(state->cleanup, REC_TYPE_NORM, "", 0);
}
if (prev_rec_type != REC_TYPE_CONT
diff --git a/postfix/src/trivial-rewrite/trivial-rewrite.c b/postfix/src/trivial-rewrite/trivial-rewrite.c
index 7cc9a44d0..ae18f612b 100644
--- a/postfix/src/trivial-rewrite/trivial-rewrite.c
+++ b/postfix/src/trivial-rewrite/trivial-rewrite.c
@@ -99,9 +99,9 @@
/* Syntax is \fItransport\fR:\fInexthop\fR; see \fBtransport\fR(5)
/* for details. The :\fInexthop\fR part is optional.
/* .IP \fBparent_domain_matches_subdomains\fR
-/* List of Postfix features that use \fIdomain.name\fR patterns
-/* to match \fIsub.domain.name\fR (as opposed to
-/* requiring \fI.domain.name\fR patterns).
+/* List of Postfix features that use \fIdomain.tld\fR patterns
+/* to match \fIsub.domain.tld\fR (as opposed to
+/* requiring \fI.domain.tld\fR patterns).
/* .IP \fBrelayhost\fR
/* The default host to send non-local mail to when no entry is matched
/* in the \fBtransport\fR(5) table.
diff --git a/postfix/src/util/dict_pcre.c b/postfix/src/util/dict_pcre.c
index 1cc0f19f9..abea856a4 100644
--- a/postfix/src/util/dict_pcre.c
+++ b/postfix/src/util/dict_pcre.c
@@ -283,7 +283,7 @@ DICT *dict_pcre_open(const char *map, int unused_flags, int dict_flags)
*p++ = '\0'; /* Null term the regexp */
/* Now parse any regexp options */
- re_options = PCRE_CASELESS;
+ re_options = PCRE_CASELESS | PCRE_DOTALL;
while (*p && !ISSPACE(*p)) {
switch (*p) {
case 'i':