]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-1.1.11-20021108
authorWietse Venema <wietse@porcupine.org>
Fri, 8 Nov 2002 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:28:25 +0000 (06:28 +0000)
29 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/conf/canonical
postfix/conf/main.cf
postfix/conf/relocated
postfix/conf/sample-local.cf
postfix/conf/sample-misc.cf
postfix/conf/virtual
postfix/html/basic.html
postfix/html/canonical.5.html
postfix/html/local.8.html
postfix/html/master.8.html
postfix/html/relocated.5.html
postfix/html/virtual.5.html
postfix/man/man5/canonical.5
postfix/man/man5/relocated.5
postfix/man/man5/virtual.5
postfix/man/man8/local.8
postfix/man/man8/master.8
postfix/proto/canonical
postfix/proto/relocated
postfix/proto/virtual
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/local/local.c
postfix/src/master/master.c
postfix/src/smtpd/smtpd.h
postfix/src/smtpd/smtpd_check.c
postfix/src/smtpd/smtpd_state.c

index c934dc62c5f9a8ad5f53d5b104276063f95ed47a..05e51cb5ea4e746c6d233d6e0ee04c29630c33ad 100644 (file)
@@ -7165,15 +7165,20 @@ Apologies for any names omitted.
        indices in replacement text, and silently treated $text as
        $0. Found by Michael Tokarev. File: dict_pcre.c.
 
-20021107
+20021108
 
-       The behavior of the SMTP server's defer_if_permit flag has
-       changed.  The flag is still set when an UCE reject restriction
-       fails due to a temporary (DNS) problem, to prevent unwanted
-       mail from slipping through. However, the flag is no longer
-       tested at the end of client, helo or sender restrictions.
-       Instead, the flag is now tested at the end of the ETRN and
-       recipient restrictions only.
+       Cleanup: the behavior of the SMTP server's defer_if_permit
+       flag was changed, in order to maximize the opportunity to
+       permanently reject mail without opening opportunities for
+       losing legitimate mail. This was done in cooperation with
+       Victor Duchovni, Morgan Stanley. File: smtpd/smtpd_check.c.
+
+       The defer_if_permit flag is still set when an UCE reject
+       restriction fails due to a temporary (e.g., DNS) problem,
+       to prevent unwanted mail from slipping through. However,
+       the flag is no longer tested at the end of client, helo or
+       sender restrictions.  Instead, the flag is now tested at
+       the end of the ETRN and recipient restrictions only.
 
        The behavior of the warn_if_reject restriction has changed.
        It no longer activates any already made defer_if_permit or
@@ -7181,9 +7186,9 @@ Apologies for any names omitted.
        when some UCE permit restriction fails due to a temporary
        (DNS) problem, to avoid loss of legitimate mail).
 
-       Instead of setting the defer_if_permit flag, a failing
-       reject restriction after warn_if_reject now merely logs
-       that it would have caused mail to be deferred. 
+       Bugfix: instead of setting the defer_if_permit flag, a
+       failing reject restriction after warn_if_reject now merely
+       logs that it would have caused mail to be deferred.
 
        A failing permit restriction after warn_if_reject still
        raises the defer_if_reject flag, to avoid loss of legitimate
index d70c61e9aadfda5816a0ca4c236330607df80201..58d244fee653dd452fbef9357eb994cc7e0a54d0 100644 (file)
@@ -12,10 +12,13 @@ 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-20021107
+Incompatible changes with Postfix snapshot 1.1.11-20021108
 ==========================================================
 
-The behavior of the SMTP server's defer_if_permit flag has changed.
+The behavior of the SMTP server's defer_if_permit flag has changed,
+in order to maximize the opportunity to permanently reject mail
+without opening opportunities for losing legitimate mail.
+
 The flag is still set when an UCE reject restriction fails due to
 a temporary (DNS) problem, to prevent unwanted mail from slipping
 through. However, the flag is no longer tested at the end of client,
index 82214a0b017888789eb651d79df1141737e0753e..2ffb81e53a95aef87ca315eb8a91aa44969d8bc3 100644 (file)
 # 
 #        inet_interfaces
 #               The  network  interface  addresses that this system
-#               receives mail on.
+#               receives mail on.  You need to stop and start Post-
+#               fix when this parameter changes.
 # 
 #        masquerade_classes
-#               List of address classes  subject  to  masquerading:
-#               zero  or  more of envelope_sender, envelope_recipi-
+#               List  of  address  classes subject to masquerading:
+#               zero or more of  envelope_sender,  envelope_recipi-
 #               ent, header_sender, header_recipient.
 # 
 #        masquerade_domains
-#               List of domains that hide  their  subdomain  struc-
+#               List  of  domains  that hide their subdomain struc-
 #               ture.
 # 
 #        masquerade_exceptions
-#               List  of user names that are not subject to address
+#               List of user names that are not subject to  address
 #               masquerading.
 # 
 #        mydestination
-#               List of domains that  this  mail  system  considers
+#               List  of  domains  that  this mail system considers
 #               local.
 # 
 #        myorigin
 #        regexp_table(5) format of POSIX regular expression tables
 # 
 # LICENSE
-#        The  Secure  Mailer  license must be distributed with this
+#        The Secure Mailer license must be  distributed  with  this
 #        software.
 # 
 # AUTHOR(S)
index fcdc43fbc9d290900784c17af8f278979c2f2629..10aa6c426e8eabb6cef17ca37ff668e8f6b4d55f 100644 (file)
@@ -100,6 +100,8 @@ mail_owner = postfix
 # See also the proxy_interfaces parameter, for network addresses that
 # are forwarded to us via a proxy or network address translator.
 #
+# Note: you need to stop/start Postfix when this parameter changes.
+#
 #inet_interfaces = all
 #inet_interfaces = $myhostname
 #inet_interfaces = $myhostname, localhost
index 28ec6afa1dd82fd2986581f1da00e5da8d15d613..791dd50ce85d3181b1512744287814ab6d47be6f 100644 (file)
@@ -1,4 +1,3 @@
-# 
 # RELOCATED(5)                                         RELOCATED(5)
 # 
 # NAME
 # 
 #        inet_interfaces
 #               The network interface addresses  that  this  system
-#               receives mail on.
+#               receives mail on.  You need to stop and start Post-
+#               fix when this parameter changes.
 # 
 #        mydestination
-#               List  of  domains  that  this mail system considers
+#               List of domains that  this  mail  system  considers
 #               local.
 # 
 #        myorigin
 #        regexp_table(5) format of POSIX regular expression tables
 # 
 # LICENSE
-#        The  Secure  Mailer  license must be distributed with this
+#        The Secure Mailer license must be  distributed  with  this
 #        software.
 # 
 # AUTHOR(S)
 #        P.O. Box 704
 #        Yorktown Heights, NY 10598, USA
 # 
-#                                                                 1
-# 
+#                                                      RELOCATED(5)
index 84f19d223a91f2ee0d1d6b2afc6948c0fcc40946..b5e932707f08357f816aab230bd68af311bb3a0c 100644 (file)
@@ -149,7 +149,7 @@ home_mailbox =
 # 
 # Other environment variables of interest: USER (recipient username),
 # EXTENSION (address extension), DOMAIN (domain part of address),
-# and LOCAL (the address localpart).
+# LOCAL (the address localpart), RECIPIENT and SENDER.
 #
 # Unlike other Postfix configuration parameters, the mailbox_command
 # parameter is not subjected to $parameter substitutions. This is to
index ed098b77b3009782ae825bad764a658c1b71ee5b..ea626cb96a73c17c2b8a6c289708618a9d1d8e4b 100644 (file)
@@ -122,6 +122,8 @@ import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY
 # See also the proxy_interfaces parameter, for network addresses that
 # are forwarded to us by way of a proxy or address translator.
 #
+# Note: you need to stop and start Postfix when this parameter changes.
+#
 inet_interfaces = all
 
 # The proxy_interfaces parameter specifies the network interface
index 37f762ab17510266520ae39b7d268d39d3ee74f6..8c8d4a29282f593c591317c3251e2b7b90989aac 100644 (file)
 # 
 #        inet_interfaces
 #               The  network  interface  addresses that this system
-#               receives mail on.
+#               receives mail on.  You need to stop and start Post-
+#               fix when this parameter changes.
 # 
 #        mydestination
-#               List of domains that  this  mail  system  considers
+#               List  of  domains  that  this mail system considers
 #               local.
 # 
 #        myorigin
 #        regexp_table(5) format of POSIX regular expression tables
 # 
 # LICENSE
-#        The  Secure  Mailer  license must be distributed with this
+#        The Secure Mailer license must be  distributed  with  this
 #        software.
 # 
 # AUTHOR(S)
index 553f87299b1a696b853211d5665dbc9dcc5581f5..30f42997917e85c7c183ad960114501b079ea6b8 100644 (file)
@@ -473,6 +473,10 @@ or you would have a mailer loop.
 
 </dl>
 
+<p>
+
+<b>Note: you need to stop and start Postfix when this parameter changes.</b>
+
 <hr>
 
 <a href="index.html">Up one level</a> | Basic Configuration | <a
index 569d1ff2e0624bb9443f1dc7c14013ed04f6c7da..d830aa05e66fdda888b02183ab1ea5ab6e7475e1 100644 (file)
@@ -144,23 +144,24 @@ CANONICAL(5)                                         CANONICAL(5)
 
        <b>inet</b><i>_</i><b>interfaces</b>
               The  network  interface  addresses that this system
-              receives mail on.
+              receives mail on.  You need to stop and start Post-
+              fix when this parameter changes.
 
        <b>masquerade</b><i>_</i><b>classes</b>
-              List of address classes  subject  to  masquerading:
-              zero  or  more of <b>envelope</b><i>_</i><b>sender</b>, <b>envelope</b><i>_</i><b>recipi-</b>
+              List  of  address  classes subject to masquerading:
+              zero or more of  <b>envelope</b><i>_</i><b>sender</b>,  <b>envelope</b><i>_</i><b>recipi-</b>
               <b>ent</b>, <b>header</b><i>_</i><b>sender</b>, <b>header</b><i>_</i><b>recipient</b>.
 
        <b>masquerade</b><i>_</i><b>domains</b>
-              List of domains that hide  their  subdomain  struc-
+              List  of  domains  that hide their subdomain struc-
               ture.
 
        <b>masquerade</b><i>_</i><b>exceptions</b>
-              List  of user names that are not subject to address
+              List of user names that are not subject to  address
               masquerading.
 
        <b>mydestination</b>
-              List of domains that  this  mail  system  considers
+              List  of  domains  that  this mail system considers
               local.
 
        <b>myorigin</b>
@@ -178,7 +179,7 @@ CANONICAL(5)                                         CANONICAL(5)
        <a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
index 2fd88869d00436935ac1adccfdbcdc6dd3463d39..0bc2940d1dfa5e18464d7ad565f72200bb818042 100644 (file)
@@ -169,6 +169,8 @@ LOCAL(8)                                                 LOCAL(8)
        <b>RECIPIENT</b>
               The entire recipient address.
 
+       <b>SENDER</b> The entire sender address.
+
        The <b>PATH</b> environment variable is always reset to a system-
        dependent default path, and the <b>TZ</b> (time zone) environment
        variable is always passed on without change.
index 3f9526b3a9a780df58507c92671fe7363c056a42..211c6b1487308881725a1b8f2bc01252b39b4dbd 100644 (file)
@@ -113,6 +113,11 @@ MASTER(8)                                               MASTER(8)
               also the root directory of Postfix daemons that run
               chrooted.
 
+       <b>inet</b><i>_</i><b>interfaces</b>
+              The  network  interface  addresses that this system
+              receives mail on.  You need to stop and start Post-
+              fix when this parameter changes.
+
 <b>Resource</b> <b>controls</b>
        <b>default</b><i>_</i><b>process</b><i>_</i><b>limit</b>
               Default  limit for the number of simultaneous child
index 5ad6c76fcb75b9f453fd21e92a6357792b517306..f76aa9f4fc37a0373e4eeb4847ca0ff2eab1a5c2 100644 (file)
@@ -1,5 +1,4 @@
 <html> <head> </head> <body> <pre>
-
 RELOCATED(5)                                         RELOCATED(5)
 
 <b>NAME</b>
@@ -106,10 +105,11 @@ RELOCATED(5)                                         RELOCATED(5)
 
        <b>inet</b><i>_</i><b>interfaces</b>
               The network interface addresses  that  this  system
-              receives mail on.
+              receives mail on.  You need to stop and start Post-
+              fix when this parameter changes.
 
        <b>mydestination</b>
-              List  of  domains  that  this mail system considers
+              List of domains that  this  mail  system  considers
               local.
 
        <b>myorigin</b>
@@ -121,7 +121,7 @@ RELOCATED(5)                                         RELOCATED(5)
        <a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
@@ -130,6 +130,5 @@ RELOCATED(5)                                         RELOCATED(5)
        P.O. Box 704
        Yorktown Heights, NY 10598, USA
 
-                                                                1
-
+                                                     RELOCATED(5)
 </pre> </body> </html>
index 772b59483778842384d5181c4c4a8072525067fb..6086e836a2258e461442004c108f32d3b8a08b52 100644 (file)
@@ -191,10 +191,11 @@ VIRTUAL(5)                                             VIRTUAL(5)
 
        <b>inet</b><i>_</i><b>interfaces</b>
               The  network  interface  addresses that this system
-              receives mail on.
+              receives mail on.  You need to stop and start Post-
+              fix when this parameter changes.
 
        <b>mydestination</b>
-              List of domains that  this  mail  system  considers
+              List  of  domains  that  this mail system considers
               local.
 
        <b>myorigin</b>
@@ -211,7 +212,7 @@ VIRTUAL(5)                                             VIRTUAL(5)
        <a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
index cd731797b145467cd60a47c4d124ab299cc7b40b..9259187df9993cc2236ab9f89bed23a579dd82c7 100644 (file)
@@ -143,6 +143,7 @@ addresses.
 Other parameters of interest:
 .IP \fBinet_interfaces\fR
 The network interface addresses that this system receives mail on.
+You need to stop and start Postfix when this parameter changes.
 .IP \fBmasquerade_classes\fR
 List of address classes subject to masquerading: zero or more of
 \fBenvelope_sender\fR, \fBenvelope_recipient\fR, \fBheader_sender\fR,
index ddb318fc6d04228c34c51ad6b3d2a79b07780c3d..d16b331a49282680d5c309b442c370f8e7de46a5 100644 (file)
@@ -112,6 +112,7 @@ List of lookup tables for relocated users or sites.
 Other parameters of interest:
 .IP \fBinet_interfaces\fR
 The network interface addresses that this system receives mail on.
+You need to stop and start Postfix when this parameter changes.
 .IP \fBmydestination\fR
 List of domains that this mail system considers local.
 .IP \fBmyorigin\fR
index ce5d3af85e6cf5bbe84eebe3e35f86487831c5db..9d2566f88e834c7e09de76b92f3ddf7c0bb68212 100644 (file)
@@ -207,6 +207,7 @@ List of virtual mapping tables.
 Other parameters of interest:
 .IP \fBinet_interfaces\fR
 The network interface addresses that this system receives mail on.
+You need to stop and start Postfix when this parameter changes.
 .IP \fBmydestination\fR
 List of domains that this mail system considers local.
 .IP \fBmyorigin\fR
index 5e044b6daa3da04b1aa0fd170ea1ab508fea932b..668f5ce820ede110dcd55b21bf062a9af13435e8 100644 (file)
@@ -178,6 +178,8 @@ The entire recipient address localpart (text to the left of the
 rightmost @ character).
 .IP \fBRECIPIENT\fR
 The entire recipient address.
+.IP \fBSENDER\fR
+The entire sender address.
 .PP
 The \fBPATH\fR environment variable is always reset to a
 system-dependent default path, and the \fBTZ\fR (time zone)
index 7729c2957d3a73b6eddfc52d3b3180b588f7b5aa..b1379e199e3cb772b0a18b94ad35688d5a955e6a 100644 (file)
@@ -110,6 +110,9 @@ Directory with Postfix daemon programs.
 .IP \fBqueue_directory\fR
 Top-level directory of the Postfix queue. This is also the root
 directory of Postfix daemons that run chrooted.
+.IP \fBinet_interfaces\fR
+The network interface addresses that this system receives mail on.
+You need to stop and start Postfix when this parameter changes.
 .SH "Resource controls"
 .ad
 .fi
index f696a3aefb3b5aaa5252c67a28b770ffe15088d4..afc29f3cb552e0b0ce10f1c8d272c5868743d497 100644 (file)
 #      Other parameters of interest:
 # .IP \fBinet_interfaces\fR
 #      The network interface addresses that this system receives mail on.
+#      You need to stop and start Postfix when this parameter changes.
 # .IP \fBmasquerade_classes\fR
 #      List of address classes subject to masquerading: zero or more of
 #      \fBenvelope_sender\fR, \fBenvelope_recipient\fR, \fBheader_sender\fR, 
index ba1b00726c0d8d63d1944cdcc6b419c426a63fc2..2c245fdda4288f4c7806bfb9c17aa84864b51970 100644 (file)
@@ -96,6 +96,7 @@
 #      Other parameters of interest:
 # .IP \fBinet_interfaces\fR
 #      The network interface addresses that this system receives mail on.
+#      You need to stop and start Postfix when this parameter changes.
 # .IP \fBmydestination\fR
 #      List of domains that this mail system considers local.
 # .IP \fBmyorigin\fR
index 1d1f16b198b44e058b02a985a42c39f62637276d..50941547883be49fc4e932d347b822d9389640af 100644 (file)
 #      Other parameters of interest:
 # .IP \fBinet_interfaces\fR
 #      The network interface addresses that this system receives mail on.
+#      You need to stop and start Postfix when this parameter changes.
 # .IP \fBmydestination\fR
 #      List of domains that this mail system considers local.
 # .IP \fBmyorigin\fR
index 738414c4f9babfbec8f346f21c946a4e76bcfac0..227c165109c0d6d654c0e195a6cec00a0910ba41 100644 (file)
@@ -437,7 +437,7 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 extern char *var_cmd_exp_filter;
 
 #define VAR_FWD_EXP_FILTER     "forward_expansion_filter"
-#define DEF_FWD_EXP_FILTER     "1234567890!@%-_=+:,./\
+#define DEF_FWD_EXP_FILTER     "1234567890!@%-_=+:,.\
 abcdefghijklmnopqrstuvwxyz\
 ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 extern char *var_fwd_exp_filter;
@@ -1152,6 +1152,9 @@ extern int var_reject_code;
 #define DEF_DEFER_CODE         450
 extern int var_defer_code;
 
+#define DEFER_IF_PERMIT                "defer_if_permit"
+#define DEFER_IF_REJECT                "defer_if_reject"
+
 #define REJECT_UNKNOWN_CLIENT  "reject_unknown_client"
 #define VAR_UNK_CLIENT_CODE    "unknown_client_reject_code"
 #define DEF_UNK_CLIENT_CODE    450
index 4e106f1befc0ac826b0919e34b9550332c9c56ea..2fbb1aa42d0438b6dfa6bb95827914e514eaf0d7 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      "20021107"
+#define MAIL_RELEASE_DATE      "20021108"
 
 #define VAR_MAIL_VERSION       "mail_version"
 #define DEF_MAIL_VERSION       "1.1.11-" MAIL_RELEASE_DATE
index 187a932e1089e925e717feb64aa464130d60e30c..74cc47c1b425dd867d175872e4fc6debf31e6b3c 100644 (file)
 /*     rightmost @ character).
 /* .IP \fBRECIPIENT\fR
 /*     The entire recipient address.
+/* .IP \fBSENDER\fR
+/*     The entire sender address.
 /* .PP
 /*     The \fBPATH\fR environment variable is always reset to a
 /*     system-dependent default path, and the \fBTZ\fR (time zone)
index b5c7e961717db7c982d959068e35ca247fc1bc89..9071f34e7a8189c7f02046e508fd2a9eb7922ba7 100644 (file)
@@ -96,6 +96,9 @@
 /* .IP \fBqueue_directory\fR
 /*     Top-level directory of the Postfix queue. This is also the root
 /*     directory of Postfix daemons that run chrooted.
+/* .IP \fBinet_interfaces\fR
+/*     The network interface addresses that this system receives mail on.
+/*     You need to stop and start Postfix when this parameter changes.
 /* .SH "Resource controls"
 /* .ad
 /* .fi
index c76bb9d9a671814aaa203b82f819c8d5f91f5362..8d52fc86b235e3259e425a8ed8eb575030f002d5 100644 (file)
@@ -89,6 +89,9 @@ typedef struct SMTPD_STATE {
     int     warn_if_reject;            /* force reject into warning */
     SMTPD_DEFER defer_if_reject;       /* force reject into deferral */
     SMTPD_DEFER defer_if_permit;       /* force permit into deferral */
+    int     defer_if_permit_client;    /* force permit into warning */
+    int     defer_if_permit_helo;      /* force permit into warning */
+    int     defer_if_permit_sender;    /* force permit into warning */
     VSTRING *expand_buf;               /* scratch space for $name expansion */
 } SMTPD_STATE;
 
index 57f9f323dffa634448e08ee32c318ddb5cd74a13..b2ab5ebd36f12390999cc7434581de47e8363c1d 100644 (file)
@@ -436,13 +436,13 @@ static int generic_checks(SMTPD_STATE *, ARGV *, const char *, const char *, con
   * 
   * reject_unknown_client, hostname-based white-list, reject
   * 
-  * XXX Don't raise the defer_if_permit flag with a failing reject-style
-  * restriction that follows warn_if_reject. Instead, log the warning for the
+  * XXX With warn_if_reject, don't raise the defer_if_permit flag when a
+  * reject-style restriction fails. Instead, log the warning for the
   * resulting defer message.
   * 
-  * XXX Do raise the defer_if_reject flag with a failing permit-style
-  * restriction that follows warn_if_reject. Otherwise, we could reject
-  * legitimate mail.
+  * XXX With warn_if_reject, do raise the defer_if_reject flag when a
+  * permit-style restriction fails. Otherwise, we could reject legitimate
+  * mail.
   */
 static void PRINTFLIKE(3, 4) defer_if(SMTPD_DEFER *, int, const char *,...);
 
@@ -2608,6 +2608,14 @@ static int generic_checks(SMTPD_STATE *state, ARGV *restrictions,
                         cpp[1], REJECT_ALL);
        } else if (strcasecmp(name, REJECT_UNAUTH_PIPE) == 0) {
            status = reject_unauth_pipelining(state, reply_name, reply_class);
+       } else if (strcasecmp(name, DEFER_IF_PERMIT) == 0) {
+           DEFER_IF_PERMIT2(state, MAIL_ERROR_POLICY,
+                        "450 <%s>: %s rejected: defer_if_permit requested",
+                            reply_name, reply_class);
+       } else if (strcasecmp(name, DEFER_IF_REJECT) == 0) {
+           DEFER_IF_REJECT2(state, MAIL_ERROR_POLICY,
+                        "450 <%s>: %s rejected: defer_if_reject requested",
+                            reply_name, reply_class);
        }
 
        /*
@@ -2843,8 +2851,7 @@ char   *smtpd_check_client(SMTPD_STATE *state)
     }
 
     /*
-     * This is cleared before client restrictions, and is tested after
-     * recipient and etrn restrictions.
+     * Reset the defer_if_permit flag.
      */
     state->defer_if_permit.active = 0;
 
@@ -2856,6 +2863,7 @@ char   *smtpd_check_client(SMTPD_STATE *state)
     if (status == 0 && client_restrctions->argc)
        status = generic_checks(state, client_restrctions, state->namaddr,
                                SMTPD_NAME_CLIENT, CHECK_CLIENT_ACL);
+    state->defer_if_permit_client = state->defer_if_permit.active;
 
     return (status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
 }
@@ -2894,6 +2902,13 @@ char   *smtpd_check_helo(SMTPD_STATE *state, char *helohost)
        return (x); \
     }
 
+    /*
+     * Restore the defer_if_permit flag to its value before HELO/EHLO, and do
+     * not set the flag when it was already raised by a previous protocol
+     * stage.
+     */
+    state->defer_if_permit.active = state->defer_if_permit_client;
+
     /*
      * Apply restrictions in the order as specified.
      */
@@ -2902,6 +2917,7 @@ char   *smtpd_check_helo(SMTPD_STATE *state, char *helohost)
     if (status == 0 && helo_restrctions->argc)
        status = generic_checks(state, helo_restrctions, state->helo_name,
                                SMTPD_NAME_HELO, CHECK_HELO_ACL);
+    state->defer_if_permit_helo = state->defer_if_permit.active;
 
     SMTPD_CHECK_HELO_RETURN(status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
 }
@@ -2930,6 +2946,14 @@ char   *smtpd_check_mail(SMTPD_STATE *state, char *sender)
        return (x); \
     }
 
+    /*
+     * Restore the defer_if_permit flag to its value before MAIL FROM, and do
+     * not set the flag when it was already raised by a previous protocol
+     * stage. The client may skip the helo/ehlo.
+     */
+    state->defer_if_permit.active = state->defer_if_permit_client
+       | state->defer_if_permit_helo;
+
     /*
      * Apply restrictions in the order as specified.
      */
@@ -2938,6 +2962,7 @@ char   *smtpd_check_mail(SMTPD_STATE *state, char *sender)
     if (status == 0 && mail_restrctions->argc)
        status = generic_checks(state, mail_restrctions, sender,
                                SMTPD_NAME_SENDER, CHECK_SENDER_ACL);
+    state->defer_if_permit_sender = state->defer_if_permit.active;
 
     SMTPD_CHECK_MAIL_RETURN(status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
 }
@@ -2983,6 +3008,13 @@ char   *smtpd_check_rcpt(SMTPD_STATE *state, char *recipient)
            || (err = smtpd_check_mail(state, state->sender)) != 0)
            SMTPD_CHECK_RCPT_RETURN(err);
 
+    /*
+     * Restore the defer_if_permit flag to its value before RCPT TO, and do
+     * not set the flag when it was already raised by a previous protocol
+     * stage.
+     */
+    state->defer_if_permit.active = state->defer_if_permit_sender;
+
     /*
      * Apply restrictions in the order as specified.
      */
@@ -3036,6 +3068,14 @@ char   *smtpd_check_etrn(SMTPD_STATE *state, char *domain)
            || (err = smtpd_check_helo(state, state->helo_name)) != 0)
            SMTPD_CHECK_ETRN_RETURN(err);
 
+    /*
+     * Restore the defer_if_permit flag to its value before ETRN, and do not
+     * set the flag when it was already raised by a previous protocol stage.
+     * The client may skip the helo/ehlo.
+     */
+    state->defer_if_permit.active = state->defer_if_permit_client
+       | state->defer_if_permit_helo;
+
     /*
      * Apply restrictions in the order as specified.
      */
@@ -3228,6 +3268,12 @@ char   *smtpd_check_data(SMTPD_STATE *state)
        state->recipient = 0;
     }
 
+    /*
+     * Reset the defer_if_permit flag. This should not be necessary but we do
+     * it just in case.
+     */
+    state->defer_if_permit.active = 0;
+
     /*
      * Apply restrictions in the order as specified.
      * 
index b1d217f87a5f26f1366f609d3bcf66f3395e1793..53ef2758085bbe62707ee5ae1baf7ed1dc378661 100644 (file)
@@ -92,9 +92,10 @@ void    smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream)
     state->recursion = 0;
     state->msg_size = 0;
     state->junk_cmds = 0;
-    state->defer_if_reject.active = 0;
+    state->defer_if_permit_client = 0;
+    state->defer_if_permit_helo = 0;
+    state->defer_if_permit_sender = 0;
     state->defer_if_reject.reason = 0;
-    state->defer_if_permit.active = 0;
     state->defer_if_permit.reason = 0;
     state->expand_buf = 0;