]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-1.1.11-20020528
authorWietse Venema <wietse@porcupine.org>
Tue, 28 May 2002 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:28:00 +0000 (06:28 +0000)
60 files changed:
postfix/HISTORY
postfix/INSTALL
postfix/README_FILES/ETRN_README
postfix/README_FILES/FILTER_README
postfix/README_FILES/INSTALL
postfix/README_FILES/LMTP_README
postfix/README_FILES/SASL_README
postfix/README_FILES/VIRTUAL_README
postfix/RELEASE_NOTES
postfix/conf/access
postfix/conf/main.cf
postfix/conf/pcre_table
postfix/conf/regexp_table
postfix/conf/sample-mime.cf
postfix/conf/sample-misc.cf
postfix/conf/transport
postfix/html/access.5.html
postfix/html/basic.html
postfix/html/cleanup.8.html
postfix/html/faq.html
postfix/html/flush.8.html
postfix/html/pcre_table.5.html
postfix/html/regexp_table.5.html
postfix/html/smtpd.8.html
postfix/html/transport.5.html
postfix/html/trivial-rewrite.8.html
postfix/man/man5/access.5
postfix/man/man5/pcre_table.5
postfix/man/man5/regexp_table.5
postfix/man/man5/transport.5
postfix/man/man8/cleanup.8
postfix/man/man8/flush.8
postfix/man/man8/smtpd.8
postfix/man/man8/trivial-rewrite.8
postfix/proto/access
postfix/proto/pcre_table
postfix/proto/regexp_table
postfix/proto/transport
postfix/src/bounce/Makefile.in
postfix/src/bounce/bounce_notify_util.c
postfix/src/cleanup/Makefile.in
postfix/src/cleanup/cleanup.c
postfix/src/cleanup/cleanup_message.c
postfix/src/flush/flush.c
postfix/src/global/Makefile.in
postfix/src/global/header_token.c
postfix/src/global/lex_822.h [new file with mode: 0644]
postfix/src/global/mail_params.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/global/mime_state.c
postfix/src/global/tok822_parse.c
postfix/src/pickup/Makefile.in
postfix/src/pickup/pickup.c
postfix/src/qmqpd/Makefile.in
postfix/src/qmqpd/qmqpd.c
postfix/src/smtpd/Makefile.in
postfix/src/smtpd/smtpd.c
postfix/src/trivial-rewrite/trivial-rewrite.c
postfix/src/util/dict_pcre.c

index 4df04b0db8111a1dd27bf8b3c763ebfc55d26005..6f776cf3444ae0cc5ce1d1947975f07b538b8f2e 100644 (file)
@@ -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
index ac9334f26bc2d1b8be4a432dc019a0b00614ed95..b0e551e2a4defd1069697e8f1277b0dbf92a9bc1 100644 (file)
@@ -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.
 
index c7b18d31daec152ce70f768be99efc0525e08a98..0dc5d7c12d1eeef315dc85e29eb442fa7ac3c87c 100644 (file)
@@ -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,
index ff062e8b76d2e308b374fd3e2ed2005dc010855e..d2c598cdcf34d854d779de641590879e2873d6b9 100644 (file)
@@ -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.
index b3e3b246f9e194de7bddcf169aa069888839a8ce..b0e551e2a4defd1069697e8f1277b0dbf92a9bc1 100644 (file)
@@ -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.
 
index ca051466b77257cf780d935667a02992c9dfb129..06a6878eafc9a8d2099c8518f63c279aed416d56 100644 (file)
@@ -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:
 
index ccc22a2fb3773dd862c80be6a563e3dc2b30a6ef..de06bb28bd6465c38c112e0f116f5bb583faf9c1 100644 (file)
@@ -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
index 0a648ab086112f81152a1047879a5801efe48697..821919026a95a993f951c059d2687f6b7808e540 100644 (file)
@@ -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.
index 8c226a12dcb716100c3e8a707940d1979bb2e46a..4610c389d21bebe0b4f6f36f668cc5fd46d4e433 100644 (file)
@@ -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
 ==========================================================
 
index 4bc39ca06264d46f4da3ce425bd87c9e5ab78eb7..0b1148ed08d6e2702ece0868cfe2882554dd2b9c 100644 (file)
 #        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.
 #        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
 # 
index de4d7fcf2cf3102b7b6c821337cc3cffbb896a43..76c79866a02fb3f54538bfe034b17894d9e42a42 100644 (file)
@@ -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.
index 423a31768228456bf180841ce02eb2f2a3fe340b..fd020255fcd5275bb87da8dbb3ea94ca5390c20d 100644 (file)
 #        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).
-# 
-#        Each pattern is applied to the entire lookup  key  string.
-#        Depending  on  the  application,  that string is an entire
+#        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:
+# 
+#        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
index 162ad09f68765f4a519e17bf69972f01ce20a354..eed807ab7f0d6baa9d84beea86642c34af4ee518 100644 (file)
 #        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.
index 9cba90f9576412a72e9db6d31f06c5fc90f2a775..687a24ac48972896aaea01629328da69f20e3f5a 100644 (file)
@@ -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:
index 4f790f0ca4f16309292caf8bf284ac937245b739..8f7e2ed45d271e301cfa13edd7f60970575e8147 100644 (file)
@@ -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,
index 273fee08b32421ac6ef53dc4fdfc33c7a0b78882..3e5aece89461f94ef7694d6e4f7c532700737534 100644 (file)
 #        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.
index d75975ae23b8262464d68770e61fa78c757963e0..2e14005965168ac60e5bf96730e8d006de87ff6a 100644 (file)
@@ -54,16 +54,16 @@ ACCESS(5)                                               ACCESS(5)
        <i>user</i>@<i>domain</i>
               Matches the specified mail address.
 
-       <i>domain.name</i>
-              Matches  <i>domain.name</i> as the domain part of an email
+       <i>domain.tld</i>
+              Matches  <i>domain.tld</i>  as the domain part of an email
               address.
 
-              The pattern <i>domain.name</i>  also  matches  subdomains,
-              but  only  when  the  string  <b>smtpd</b><i>_</i><b>access</b><i>_</i><b>maps</b>  is
-              listed in the Postfix  <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdo-</b>
-              <b>mains</b>  configuration  setting.   Otherwise, specify
-              <i>.domain.name</i> (note the initial  dot)  in  order  to
-              match subdomains.
+              The pattern <i>domain.tld</i> also matches subdomains, but
+              only when the string <b>smtpd</b><i>_</i><b>access</b><i>_</i><b>maps</b> is listed in
+              the Postfix  <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>  con-
+              figuration setting.  Otherwise, specify <i>.domain.tld</i>
+              (note the initial dot) in  order  to  match  subdo-
+              mains.
 
        <i>user</i>@  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:
 
-       <i>domain.name</i>
-              Matches <i>domain.name</i>.
+       <i>domain.tld</i>
+              Matches <i>domain.tld</i>.
 
-              The pattern <i>domain.name</i>  also  matches  subdomains,
-              but  only  when  the  string  <b>smtpd</b><i>_</i><b>access</b><i>_</i><b>maps</b>  is
-              listed in the Postfix  <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdo-</b>
-              <b>mains</b>  configuration  setting.   Otherwise, specify
-              <i>.domain.name</i> (note the initial  dot)  in  order  to
-              match subdomains.
+              The pattern <i>domain.tld</i> also matches subdomains, but
+              only when the string <b>smtpd</b><i>_</i><b>access</b><i>_</i><b>maps</b> is listed in
+              the Postfix  <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>  con-
+              figuration setting.  Otherwise, specify <i>.domain.tld</i>
+              (note the initial dot) in  order  to  match  subdo-
+              mains.
 
        <i>net.work.addr.ess</i>
 
index 7e38a8d6c454cdf33c7d1eb185bbf747aba00db9..26db800a86150d1480de3baa0a36673e4f4d4c34 100644 (file)
@@ -410,7 +410,7 @@ or you would have a mailer loop.
 
 <dt> Host running virtual mailers:
 
-<dd> <b>inet_interfaces = virtual.host.name</b> (virtual domain)
+<dd> <b>inet_interfaces = virtual.host.tld</b> (virtual domain)
 
 <dd> <b>inet_interfaces = $myhostname localhost.$mydomain</b>
 (non-virtual mailer)
index ba7f6eb635cb63702c93c36e20d643a582a6d0aa..028b0e22afb9793f6017a648bfa262d0d1a0d920 100644 (file)
@@ -110,13 +110,24 @@ CLEANUP(8)                                             CLEANUP(8)
               nested deeper.
 
        <b>strict</b><i>_</i><b>8bitmime</b>
-              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 <b>strict</b><i>_</i><b>7bit</b><i>_</i><b>headers</b> and <b>strict</b><i>_</i><b>8bit-</b>
+              <b>mime</b><i>_</i><b>body</b>.
+
+       <b>strict</b><i>_</i><b>7bit</b><i>_</i><b>headers</b>
+              Reject mail with 8-bit  text  in  message  headers.
+              This  blocks mail from poorly written applications.
+
+       <b>strict</b><i>_</i><b>8bitmime</b><i>_</i><b>body</b>
+              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).
 
        <b>strict</b><i>_</i><b>mime</b><i>_</i><b>domain</b><i>_</i><b>encoding</b>
               Reject mail with invalid <b>Content-Transfer-Encoding:</b>
index 52520d1f888b476d8d93a8c92d6f08f77f988a24..30a57128f15768f38b20ef66ef7285de4fb3b8dd 100644 (file)
@@ -1747,10 +1747,10 @@ all you need:
 
 <pre>
     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
 </pre>
 
@@ -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]
 </pre>
 
 <p>
@@ -2207,14 +2207,14 @@ mail as user@domain</h3></a>
 
 <ul>
 
-<li>In order to send mail as <i>user@domain.name</i>, specify what
+<li>In order to send mail as <i>user@domain.tld</i>, specify what
 domain is to be appended to addresses that do not have a domain:
 
 <p>
 
 <pre>
 /etc/postfix/main.cf:
-    myorigin = domain.name
+    myorigin = domain.tld
 </pre>
 
 <p>
@@ -2719,7 +2719,7 @@ your system supports, use the command <b>postconf -m</b>.
 <a name="virtual_logging"><h3>Postfix logs delivery to virtual
 address with the wrong name</h3></a>
 
-When Postfix delivers mail for a virtual address <i>vuser@vdomain.name</i>
+When Postfix delivers mail for a virtual address <i>vuser@vdomain.tld</i>
 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
 </pre>
 </blockquote>
 
 <p>
 
 This delivers the mail as
-<i>localuser+vuser=vdomain.name@your.domain</i>.
+<i>localuser+vuser=vdomain.tld@your.domain</i>.
 
 <hr>
 
index 97aefe42a73e13386b73076c42ffdf76b1e5a0a9..b62fba9de8b99ed4b71387de53bdd35ea1b40111 100644 (file)
@@ -136,9 +136,9 @@ FLUSH(8)                                                 FLUSH(8)
               days).
 
        <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>
-              List of Postfix features that use <i>domain.name</i>  pat-
-              terns  to  match  <i>sub.domain.name</i>  (as  opposed  to
-              requiring <i>.domain.name</i> patterns).
+              List of Postfix features that use  <i>domain.tld</i>  pat-
+              terns   to  match  <i>sub.domain.tld</i>  (as  opposed  to
+              requiring <i>.domain.tld</i> patterns).
 
 <b>SEE</b> <b>ALSO</b>
        <a href="smtpd.8.html">smtpd(8)</a> Postfix SMTP server
index 29111019cc85f1104a72b846722d8c367901032a..bdf83fb8574daccf085a2b9cd439304e0eb2f07d 100644 (file)
@@ -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).
-
-       Each pattern is applied to the entire lookup  key  string.
-       Depending  on  the  application,  that string is an entire
+       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:
+
+       <b>i</b> (default: on)
+              Toggles  the  case  sensitivity  flag.  By default,
+              matching is case insensitive.
+
+       <b>m</b> (default: off)
+              Toggles the PCRE_MULTILINE flag. When the  flag  is
+              on,  the  <b>^</b>  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.
+
+       <b>s</b> (default: on)
+              Toggle the PCRE_DOTALL flag. When the flag  is  on,
+              the <b>.</b>  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.
+
+       <b>x</b> (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 <b>#</b> outside
+              a  character  class  and the next newline character
+              are ignored. An escaping backslash can be  used  to
+              include  a whitespace or <b>#</b> character as part of the
+              pattern.
+
+       <b>A</b> (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.
+
+       <b>E</b> (default: off)
+              Toggles  the  PCRE_DOLLAR_ENDONLY  flag.  When this
+              flag is set,  a  <b>$</b>  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.
+
+       <b>U</b> (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.
+
+       <b>X</b> (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 <i>user@domain</i>  mail  addresses  are  not
-       broken  up  into  their <i>user</i> and <i>domain</i> constituent parts,
+       mail address.  Thus, no parent domain  or  parent  network
+       search  is  done,  and  <i>user@domain</i> mail addresses are not
+       broken up into their <i>user</i> and  <i>domain</i>  constituent  parts,
        nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
 
-       Patterns are applied in the  order  as  specified  in  the
-       table,  until  a  pattern is found that matches the search
+       Patterns  are  applied  in  the  order as specified in the
+       table, until a pattern is found that  matches  the  search
        string.
 
-       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.
 
 <b>EXAMPLE</b> <b>SMTPD</b> <b>ACCESS</b> <b>MAP</b>
index f93096c47310a7f00c9a6496b1da9ffb2830828c..a81657af1bca15ddf0ad5a2e0c64834ac4cceff8 100644 (file)
@@ -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 <i>user@domain</i>  mail  addresses  are  not
-       broken  up  into  their <i>user</i> and <i>domain</i> constituent parts,
+       mail address.  Thus, no parent domain  or  parent  network
+       search  is  done,  and  <i>user@domain</i> mail addresses are not
+       broken up into their <i>user</i> and  <i>domain</i>  constituent  parts,
        nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
 
-       Patterns are applied in the  order  as  specified  in  the
-       table,  until  a  pattern is found that matches the search
+       Patterns  are  applied  in  the  order as specified in the
+       table, until a pattern is found that  matches  the  search
        string.
 
-       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.
index 7c0ae5fe56bfe204c15433de18aa3b1a3d52eb1c..1676d4dec9e3531f25eacda9ff009e3b670fd522 100644 (file)
@@ -227,9 +227,9 @@ SMTPD(8)                                                 SMTPD(8)
 
 <b>UCE</b> <b>control</b> <b>restrictions</b>
        <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>
-              List of Postfix features that use <i>domain.name</i>  pat-
-              terns  to  match  <i>sub.domain.name</i>  (as  opposed  to
-              requiring <i>.domain.name</i> patterns).
+              List of Postfix features that use  <i>domain.tld</i>  pat-
+              terns   to  match  <i>sub.domain.tld</i>  (as  opposed  to
+              requiring <i>.domain.tld</i> patterns).
 
        <b>smtpd</b><i>_</i><b>client</b><i>_</i><b>restrictions</b>
               Restrict what clients may connect to this mail sys-
index 14692cb4c029667b7bae00b39f93fe2a96acf4f2..096c8f4195798557bcc33a7b4ac1d0eed85c199c 100644 (file)
@@ -162,9 +162,9 @@ TRANSPORT(5)                                         TRANSPORT(5)
        command after a configuration change.
 
        <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>
-              List  of Postfix features that use <i>domain.name</i> pat-
-              terns  to  match  <i>sub.domain.name</i>  (as  opposed  to
-              requiring <i>.domain.name</i> patterns).
+              List  of  Postfix features that use <i>domain.tld</i> pat-
+              terns  to  match  <i>sub.domain.tld</i>  (as  opposed   to
+              requiring <i>.domain.tld</i> patterns).
 
        <b>transport</b><i>_</i><b>maps</b>
               List of transport lookup tables.
index 3f81b47a50b2d6acad0d77895c90e115aec2b528..60284d1040fde6d29ec6e0ec5f4b972426dbe9ae 100644 (file)
@@ -118,9 +118,9 @@ TRIVIAL-REWRITE(8)                             TRIVIAL-REWRITE(8)
               details. The :<i>nexthop</i> part is optional.
 
        <b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>
-              List of Postfix features that use <i>domain.name</i>  pat-
-              terns  to  match  <i>sub.domain.name</i>  (as  opposed  to
-              requiring <i>.domain.name</i> patterns).
+              List of Postfix features that use  <i>domain.tld</i>  pat-
+              terns   to  match  <i>sub.domain.tld</i>  (as  opposed  to
+              requiring <i>.domain.tld</i> patterns).
 
        <b>relayhost</b>
               The default host to send non-local mail to when  no
index 8f7b99d6c1edfa7746d14db359f335ea435f0fcd..43846a08b17400574779c91993cf27dac71ccbdb 100644 (file)
@@ -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
index f57d3f2c75c06fd9729f07853070321491deff5d..2b1673d01293aaf27db237abb273a90924aa776c 100644 (file)
@@ -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.
index 209bb8d07ef32583fa26cd928605c1b62acdd2ae..095f21e722694d6cdf15d1696557f0ea0d5535d9 100644 (file)
@@ -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
index c2363f9a14db14891ad3b13b4760277cad518636..a2bc8783c26e76e2bf478f1a274cfc23e2048dd8 100644 (file)
@@ -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
index 835335451dc8543acdbc837aa92f7964cb8972e9..9d556d20b90f3338dc2444c94e541ba8ea8b4170 100644 (file)
@@ -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
index 4aa4eb46ac0f9c0c50e73764aa05af89dda28195..61bd122ea5cff9f27087c9a4e19d697f5930b694 100644 (file)
@@ -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
index 73814bedab6a853e8e396d8803225cc6c0e5c374..c4e690633307201bd58c8478e85d4ca7639ba8d0 100644 (file)
@@ -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
index 2fcdf307d3852aa55228ed4a8938faaf3eda0dde..eee387c6694aa0575c314b9c26dfa0551b20c9e4 100644 (file)
@@ -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.
index cd77ecfe935fbd7cfdb610d2c6da154feb22a29c..cdb44596633909b72c359bffada6e6a99be03f28 100644 (file)
 #      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.
 #      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
index 5e6e5d5da8a56e33beac387e9ad0bf264e134dcd..e17cb7fb66dbae920e50e8e636b9e9e0d3e667bf 100644 (file)
 #      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.
index 18578a7e84e43740c72f02f53e7c11112e89b4ad..c937d895d6def7bfc08ef00640066fea993b9de8 100644 (file)
@@ -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
index abec0c96126430d3b65f2f5d653672e3ea721ab3..a6d71c16cefb4be959b01b0039d17e25ca3c7957 100644 (file)
 #      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
index 3d2327f38ea0c8a36586d312d356e13bdd622bab..4c578391cd15053374a0fc0b13f3fede6af0b62a 100644 (file)
@@ -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
index d4264d945e18d6a679e64dac4bafa1c3e725d4d3..1c6485630271cabe529a31fff69691cc71a16114 100644 (file)
 #include <bounce_log.h>
 #include <mail_date.h>
 #include <mail_proto.h>
+#include <lex_822.h>
 
 /* 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) {
index 493a18a496fe6472b655277383e6de14198fcecd..4e216c2baa59ccb9a4e763b6965e775e25dd57ff 100644 (file)
@@ -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
index cdc395568ae6117c1daa6cc4b1c02b49273a4d8e..c1050f28ae46db31a7fee3705b2cadecf6209a4c 100644 (file)
 /*     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
index 87cf3d33e7f9c9e04c0d538ef2524cd8c99b9bbb..313d781f36736544718b10f6deb3c5d51d2c57df 100644 (file)
@@ -79,6 +79,7 @@
 #include <ext_prop.h>
 #include <mail_proto.h>
 #include <mime_state.h>
+#include <lex_822.h>
 
 /* 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;
        }
index 3541c3117b1de86eea6c7ef6603cf483e495c9de..433432f251e54a4c59ba78fe1ca137a954bd86f4 100644 (file)
 /*     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
index 28d82fd4380fba128139160d8686f9f06c777543..db5043003472d3b11df838f7487209d703a45e56 100644 (file)
@@ -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
index 04ab7f2e9636967a087e14585f8fa430bea7f027..c95207fb3cb3c85ea64863ef2f413413bc2d5c78 100644 (file)
 
 /* Global library. */
 
+#include <lex_822.h>
 #include <header_token.h>
 
 /* 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 (file)
index 0000000..32253fa
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef _SPACE_822_H_INCLUDED_
+#define _SPACE_822_H_INCLUDED_
+
+/*++
+/* NAME
+/*     lex_822 3h
+/* SUMMARY
+/*     RFC822 lexicals
+/* SYNOPSIS
+/*     #include <lex_822.h>
+/* 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
index 1350f5eabecfd1febcf326eefa217a973500ce3e..28ee3a32934ea89e7213edd1b2fb75b2195a59b8 100644 (file)
@@ -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,
index d700e409b13dcb14a9cbd2a41912f78617bbd4f6..c3ef842c671e5c412e455a748f606ff17ad0cbb0 100644 (file)
@@ -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;
index afc9017cabef8d4cc1e1f205704bd784783e60d3..727215ba48e8cf61df6bef7a58450b07c752c9e4 100644 (file)
@@ -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
index b895b9f55747a921a65986ceddf03b41d47c36e6..0c1193305bbc7f26f7d1ba0fc68d03ac5a83b85f 100644 (file)
@@ -6,7 +6,8 @@
 /* SYNOPSIS
 /*     #include <mime_state.h>
 /*
-/*     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);
 /*     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.
 /*
 #include <header_opts.h>
 #include <mail_params.h>
 #include <header_token.h>
+#include <lex_822.h>
 #include <mime_state.h>
 
 /* 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);
index 3555031b2ba49e9991be5d2237fd4b71e7a584bb..86567c7f7fbcdb37480ddcd8115dcf3eda9cad3e 100644 (file)
 
 /* Global library. */
 
+#include "lex_822.h"
 #include "quote_822_local.h"
 #include "tok822.h"
 
            } 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); \
  /*
   * 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;
index a30d1880022d01cd0f83e90f869e2a7a7c771fdf..373a9e91f058597698a981849253097d14529070 100644 (file)
@@ -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
index da2ff07c037b5d4e71a57cf1cf8b7db9a872977f..6357fd79083215a0ee1a6a1d917e5cff4dbe9df4 100644 (file)
 #include <mail_conf.h>
 #include <record.h>
 #include <rec_type.h>
+#include <lex_822.h>
 
 /* 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)
index 53703cb95fe9ea4d81c20d3131f4403af5225891..77fb1bf1482e89b696d4789306c37ce524c8dca7 100644 (file)
@@ -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
index e0cf6834f0229c7b2866d3842af169aff50f846f..dbcfcb4f0c5fa47f835cb7b27a2922173db4e314 100644 (file)
 #include <namadr_list.h>
 #include <quote_822_local.h>
 #include <match_parent_style.h>
+#include <lex_822.h>
 
 /* 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) {
index 0da6928fd1d7f05e15f1f26cbe50daad995237f7..e881b28f45d677aafef58d83dd6e05efa22b97df 100644 (file)
@@ -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
index ac0f79f6e82a94ebc4b433ca7504a7989bf52300..cf2adfb46ddea5052388aaea58562f0dec0e8247 100644 (file)
 /* .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
 #include <verp_sender.h>
 #include <string_list.h>
 #include <quote_822_local.h>
+#include <lex_822.h>
 
 /* 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
index 7cc9a44d0f2192eacb52c28f8ce132e4fd79ab64..ae18f612ba8f4609494f5b26e110640965311990 100644 (file)
@@ -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.
index 1cc0f19f9461acea09aa830c2504e4a12749116a..abea856a446ae1a3908f43dc81146aa06d15a599 100644 (file)
@@ -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':