Merge branch 'master' of ssh://git.exim.org/home/git/exim
authorTodd Lyons <tlyons@exim.org>
Tue, 13 May 2014 15:36:22 +0000 (08:36 -0700)
committerTodd Lyons <tlyons@exim.org>
Tue, 13 May 2014 15:36:22 +0000 (08:36 -0700)
18 files changed:
doc/doc-docbook/spec.xfpt
doc/doc-txt/ChangeLog
doc/doc-txt/NewStuff
doc/doc-txt/experimental-spec.txt
src/src/EDITME
src/src/acl.c
src/src/deliver.c
src/src/exim.c
src/src/globals.c
src/src/globals.h
src/src/macros.h
src/src/readconf.c
src/src/receive.c
src/src/smtp_in.c
src/src/structs.h
src/src/transports/smtp.c
src/src/transports/smtp.h
test/scripts/5500-PRDR/REQUIRES

index cbe5c1851ad17da735b270c181c9b0ad4cb2bafe..7c34bbbc78fb158fe552dbf43a4b348caa7c136a 100644 (file)
@@ -13135,6 +13135,7 @@ listed in more than one group.
 .row &%acl_smtp_auth%&               "ACL for AUTH"
 .row &%acl_smtp_connect%&            "ACL for connection"
 .row &%acl_smtp_data%&               "ACL for DATA"
+.row &%acl_smtp_data_prdr%&          "ACL for DATA, per-recipient"
 .row &%acl_smtp_dkim%&               "ACL for DKIM verification"
 .row &%acl_smtp_etrn%&               "ACL for ETRN"
 .row &%acl_smtp_expn%&               "ACL for EXPN"
@@ -13290,6 +13291,7 @@ See also the &'Policy controls'& section above.
 .row &%ignore_fromline_hosts%&       "allow &""From ""& from these hosts"
 .row &%ignore_fromline_local%&       "allow &""From ""& from local SMTP"
 .row &%pipelining_advertise_hosts%&  "advertise pipelining to these hosts"
+.row &%prdr_enable%&                 "advertise PRDR to all hosts"
 .row &%tls_advertise_hosts%&         "advertise TLS to these hosts"
 .endtable
 
@@ -13441,6 +13443,16 @@ This option defines the ACL that is run after an SMTP DATA command has been
 processed and the message itself has been received, but before the final
 acknowledgment is sent. See chapter &<<CHAPACL>>& for further details.
 
+.option acl_smtp_data_prdr main string&!! unset
+.cindex "DATA" "ACL for"
+.cindex "&ACL;" "PRDR-related"
+.cindex "&ACL;" "per-user data processing"
+This option defines the ACL that,
+if the PRDR feature has been negotiated,
+is run for each recipient after an SMTP DATA command has been
+processed and the message itself has been received, but before the
+acknowledgment is sent. See chapter &<<CHAPACL>>& for further details.
+
 .option acl_smtp_etrn main string&!! unset
 .cindex "ETRN" "ACL for"
 This option defines the ACL that is run when an SMTP ETRN command is
@@ -15083,6 +15095,15 @@ that clients will use it; &"out of order"& commands that are &"expected"& do
 not count as protocol errors (see &%smtp_max_synprot_errors%&).
 
 
+.option prdr_enable main boolean false
+.cindex "PRDR" "enabling on server"
+This option can be used to enable the Per-Recipient Data Response extension
+to SMTP, defined by Eric Hall.
+If the option is set, PRDR is advertised by Exim when operating as a server.
+If the client requests PRDR, and more than one recipient, for a message 
+an additional ACL is called for each recipient after the message content
+is recieved.  See section &<<SECTPRDRACL>>&.
+
 .option preserve_message_logs main boolean false
 .cindex "message logs" "preserving"
 If this option is set, message log files are not deleted when messages are
@@ -22973,6 +22994,12 @@ connects. If authentication fails, Exim will try to transfer the message
 unauthenticated. See also &%hosts_require_auth%&, and chapter
 &<<CHAPSMTPAUTH>>& for details of authentication.
 
+.option hosts_try_prdr smtp "host list&!!" unset
+.cindex "PRDR" "enabling, optional in client"
+This option provides a list of servers to which, provided they announce
+PRDR support, Exim will attempt to negotiate PRDR
+for multi-recipient messages.
+
 .option interface smtp "string list&!!" unset
 .cindex "bind IP address"
 .cindex "IP address" "binding"
@@ -26460,6 +26487,7 @@ options in the main part of the configuration. These options are:
 .cindex "SMTP" "connection, ACL for"
 .cindex "non-SMTP messages" "ACLs for"
 .cindex "MIME content scanning" "ACL for"
+.cindex "PRDR" "ACL for"
 
 .table2 140pt
 .irow &%acl_not_smtp%&         "ACL for non-SMTP messages"
@@ -26468,6 +26496,7 @@ options in the main part of the configuration. These options are:
 .irow &%acl_smtp_auth%&        "ACL for AUTH"
 .irow &%acl_smtp_connect%&     "ACL for start of SMTP connection"
 .irow &%acl_smtp_data%&        "ACL after DATA is complete"
+.irow &%acl_smtp_data_prdr%&   "ACL for each recipient, after DATA is complete"
 .irow &%acl_smtp_etrn%&        "ACL for ETRN"
 .irow &%acl_smtp_expn%&        "ACL for EXPN"
 .irow &%acl_smtp_helo%&        "ACL for HELO or EHLO"
@@ -26582,8 +26611,10 @@ before or after the data) correctly &-- they keep the message on their queues
 and try again later, but that is their problem, though it does waste some of
 your resources.
 
-The &%acl_smtp_data%& ACL is run after both the &%acl_smtp_dkim%& and
-the &%acl_smtp_mime%& ACLs.
+The &%acl_smtp_data%& ACL is run after
+the &%acl_smtp_data_prdr%&,
+the &%acl_smtp_dkim%&
+and the &%acl_smtp_mime%& ACLs.
 
 .section "The SMTP DKIM ACL" "SECTDKIMACL"
 The &%acl_smtp_dkim%& ACL is available only when Exim is compiled with DKIM support
@@ -26605,6 +26636,34 @@ content-scanning extension. For details, see chapter &<<CHAPexiscan>>&.
 This ACL is evaluated after &%acl_smtp_dkim%& but before &%acl_smtp_data%&.
 
 
+.section "The SMTP PRDR ACL" "SECTPRDRACL"
+.oindex "&%prdr_enable%&"
+The &%acl_smtp_data_prdr%& ACL is available only when Exim is compiled
+with PRDR support enabled (which is the default).
+It becomes active only when the PRDR feature is negotiated between
+client and server for a message, and more than one recipient
+has been accepted.
+
+The ACL test specfied by &%acl_smtp_data_prdr%& happens after a message
+has been recieved, and is executed for each recipient of the message.
+The test may accept or deny for inividual recipients.
+The &%acl_smtp_data%& will still be called after this ACL and
+can reject the message overall, even if this ACL has accepted it
+for some or all recipients.
+
+PRDR may be used to support per-user content filtering.  Without it
+one must defer any recipient after the first that has a different
+content-filter configuration.  With PRDR, the RCPT-time check
+for this can be disabled when the MAIL-time $smtp_command included
+"PRDR".  Any required difference in behaviour of the main DATA-time
+ACL should however depend on the PRDR-time ACL having run, as Exim
+will avoid doing so in some situations (eg.  single-recipient mails).
+
+See also the &%prdr_enable%& global option
+and the &%hosts_try_prdr%& smtp transport option.
+
+This ACL is evaluated after &%acl_smtp_dkim%& but before &%acl_smtp_data%&.
+
 .section "The QUIT ACL" "SECTQUITACL"
 .cindex "QUIT, ACL for"
 The ACL for the SMTP QUIT command is anomalous, in that the outcome of the ACL
index 33e43b196232adf0a667bd4758c9ff587a1d492f..276876fe66d1d4f2a85e5a100efd735f3acc72af 100644 (file)
@@ -115,6 +115,8 @@ JH/22 Expansion operators ${md5:string} and ${sha1::string} can now
       operate on certificate variables to give certificate fingerprints
       Also new ${sha256:cert_variable}.
 
+JH/23 The PRDR feature is moved from being Experimental into the mainline.
+
 
 Exim version 4.82
 -----------------
index 9eebd089f95b1dffe74ef3e0ec9bf24a9b847cb1..ac06ebfc6eb6fe832eb7c84898d5c93fa360b5cd 100644 (file)
@@ -49,6 +49,8 @@ Version 4.83
     work over them for generating fingerprints, and a new sha256 operator
     for them added.
 
+11. PRDR is now supported dy default.
+
 
 Version 4.82
 ------------
index 1ec323433b70263e948603b2c754236152748c4c..018bfddb92496796f53be1ee56b3f598768c1ec7 100644 (file)
@@ -6,34 +6,6 @@ about experimental  features, all  of which  are unstable and
 liable to incompatible change.
 
 
-PRDR support
---------------------------------------------------------------
-
-Per-Recipient Data Reponse is an SMTP extension proposed by Eric Hall
-in a (now-expired) IETF draft from 2007.  It's not hit mainstream
-use, but has apparently been implemented in the META1 MTA.
-
-There is mention at http://mail.aegee.org/intern/sendmail.html
-of a patch to sendmail "to make it PRDR capable".
-
- ref: http://www.eric-a-hall.com/specs/draft-hall-prdr-00.txt
-
-If Exim is built with EXPERIMENTAL_PRDR there is a new config
-boolean "prdr_enable" which controls whether PRDR is advertised
-as part of an EHLO response, a new "acl_data_smtp_prdr" ACL
-(called for each recipient, after data arrives but before the
-data ACL), and a new smtp transport option "hosts_try_prdr".
-
-PRDR may be used to support per-user content filtering.  Without it
-one must defer any recipient after the first that has a different
-content-filter configuration.  With PRDR, the RCPT-time check
-for this can be disabled when the MAIL-time $smtp_command included
-"PRDR".  Any required difference in behaviour of the main DATA-time
-ACL should however depend on the PRDR-time ACL having run, as Exim
-will avoid doing so in some situations (eg.  single-recipient mails).
-
-
-
 OCSP Stapling support
 --------------------------------------------------------------
 
index d13b1b13aec9d39d5e481da3cf3afe3b574a9494..7d58af74418bccc5c81cc2cc5a730b60603bce21 100644 (file)
@@ -410,6 +410,10 @@ EXIM_MONITOR=eximon.bin
 
 # DISABLE_DKIM=yes
 
+#------------------------------------------------------------------------------
+# Uncomment the following line to remove Per-Recipient-Data-Response support.
+
+# DISABLE_PRDR=yes
 
 #------------------------------------------------------------------------------
 # By default, Exim has support for checking the AD bit in a DNS response, to
@@ -466,8 +470,6 @@ EXIM_MONITOR=eximon.bin
 # CFLAGS += -I/usr/local/include
 # LDFLAGS += -lopendmarc
 
-# Uncomment the following line to add Per-Recipient-Data-Response support.
-# EXPERIMENTAL_PRDR=yes
 
 # Uncomment the following line to support Transport post-delivery actions,
 # eg. for logging to a database.
index 42b9091c3af4d9fae0de85fe70325899d7c25f93..e8a0657f2f6787fa4719b1392fcabd7fd7b715aa 100644 (file)
@@ -397,7 +397,7 @@ static unsigned int cond_forbids[] = {
   (unsigned int)
   ~((1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_RCPT)|       /* add_header */
     (1<<ACL_WHERE_PREDATA)|(1<<ACL_WHERE_DATA)|
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
   #endif
     (1<<ACL_WHERE_MIME)|(1<<ACL_WHERE_NOTSMTP)|
@@ -412,7 +412,7 @@ static unsigned int cond_forbids[] = {
   (1<<ACL_WHERE_AUTH)|                             /* bmi_optin */
     (1<<ACL_WHERE_CONNECT)|(1<<ACL_WHERE_HELO)|
     (1<<ACL_WHERE_DATA)|(1<<ACL_WHERE_MIME)|
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
   #endif
     (1<<ACL_WHERE_ETRN)|(1<<ACL_WHERE_EXPN)|
@@ -434,9 +434,9 @@ static unsigned int cond_forbids[] = {
   #ifdef EXPERIMENTAL_DCC
   (unsigned int)
   ~((1<<ACL_WHERE_DATA)|                           /* dcc */
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
-  #endif /* EXPERIMENTAL_PRDR */
+  #endif
     (1<<ACL_WHERE_NOTSMTP)),
   #endif
 
@@ -450,9 +450,9 @@ static unsigned int cond_forbids[] = {
   #ifdef WITH_OLD_DEMIME
   (unsigned int)
   ~((1<<ACL_WHERE_DATA)|                           /* demime */
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
-  #endif /* EXPERIMENTAL_PRDR */
+  #endif
     (1<<ACL_WHERE_NOTSMTP)),
   #endif
 
@@ -474,7 +474,7 @@ static unsigned int cond_forbids[] = {
 
   (unsigned int)
   ~((1<<ACL_WHERE_RCPT)                            /* domains */
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     |(1<<ACL_WHERE_PRDR)
   #endif
     ),
@@ -505,9 +505,9 @@ static unsigned int cond_forbids[] = {
   #ifdef WITH_CONTENT_SCAN
   (unsigned int)
   ~((1<<ACL_WHERE_DATA)|                           /* malware */
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
-  #endif /* EXPERIMENTAL_PRDR */
+  #endif
     (1<<ACL_WHERE_NOTSMTP)),
   #endif
 
@@ -526,9 +526,9 @@ static unsigned int cond_forbids[] = {
   #ifdef WITH_CONTENT_SCAN
   (unsigned int)
   ~((1<<ACL_WHERE_DATA)|                           /* regex */
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
-  #endif /* EXPERIMENTAL_PRDR */
+  #endif
     (1<<ACL_WHERE_NOTSMTP)|
     (1<<ACL_WHERE_MIME)),
   #endif
@@ -536,7 +536,7 @@ static unsigned int cond_forbids[] = {
   (unsigned int)
   ~((1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_RCPT)|       /* remove_header */
     (1<<ACL_WHERE_PREDATA)|(1<<ACL_WHERE_DATA)|
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
   #endif
     (1<<ACL_WHERE_MIME)|(1<<ACL_WHERE_NOTSMTP)|
@@ -559,9 +559,9 @@ static unsigned int cond_forbids[] = {
   #ifdef WITH_CONTENT_SCAN
   (unsigned int)
   ~((1<<ACL_WHERE_DATA)|                           /* spam */
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
-  #endif /* EXPERIMENTAL_PRDR */
+  #endif
     (1<<ACL_WHERE_NOTSMTP)),
   #endif
 
@@ -608,9 +608,9 @@ static unsigned int control_forbids[] = {
 
   #ifndef DISABLE_DKIM
   (1<<ACL_WHERE_DATA)|(1<<ACL_WHERE_NOTSMTP)|      /* dkim_disable_verify */
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
-  #endif /* EXPERIMENTAL_PRDR */
+  #endif
     (1<<ACL_WHERE_NOTSMTP_START),
   #endif
 
@@ -674,17 +674,17 @@ static unsigned int control_forbids[] = {
   (unsigned int)
   ~((1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_RCPT)|       /* fakedefer */
     (1<<ACL_WHERE_PREDATA)|(1<<ACL_WHERE_DATA)|
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
-  #endif /* EXPERIMENTAL_PRDR */
+  #endif
     (1<<ACL_WHERE_MIME)),
 
   (unsigned int)
   ~((1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_RCPT)|       /* fakereject */
     (1<<ACL_WHERE_PREDATA)|(1<<ACL_WHERE_DATA)|
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
     (1<<ACL_WHERE_PRDR)|
-  #endif /* EXPERIMENTAL_PRDR */
+  #endif
     (1<<ACL_WHERE_MIME)),
 
   (1<<ACL_WHERE_NOTSMTP)|                          /* no_multiline */
@@ -4319,7 +4319,7 @@ sender_verified_failed = NULL;
 ratelimiters_cmd = NULL;
 log_reject_target = LOG_MAIN|LOG_REJECT;
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 if (where == ACL_WHERE_RCPT || where == ACL_WHERE_PRDR )
 #else
 if (where == ACL_WHERE_RCPT )
@@ -4363,7 +4363,7 @@ If conn-failure, no action (and keep the spooled copy).
 switch (where)
 {
 case ACL_WHERE_RCPT:
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 case ACL_WHERE_PRDR:
 #endif
   if( rcpt_count > 1 )
index 777ff8dc75ea7c6bab103d73e2a7ae8715482d9b..6bdfbd4da9894642cab94e3955ea82e39af5b8e4 100644 (file)
@@ -830,7 +830,7 @@ else
       }
     }
 
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
   if (addr->flags & af_prdr_used)
     s = string_append(s, &size, &ptr, 1, US" PRDR");
   #endif
@@ -3043,9 +3043,10 @@ while (!done)
     while (*ptr++);
     break;
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
     case 'P':
-    addr->flags |= af_prdr_used; break;
+    addr->flags |= af_prdr_used;
+    break;
 #endif
 
     case 'A':
@@ -6280,7 +6281,7 @@ if (addr_remote != NULL)
     regex_must_compile(US"\\n250[\\s\\-]STARTTLS(\\s|\\n|$)", FALSE, TRUE);
   #endif
 
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
   if (regex_PRDR == NULL) regex_PRDR =
     regex_must_compile(US"\\n250[\\s\\-]PRDR(\\s|\\n|$)", FALSE, TRUE);
   #endif
index fa0cf4940d8420c04484f72d107f583170333e4b..ded12fa34d62a5735d396b0ad122192d9152a3a9 100644 (file)
@@ -822,9 +822,6 @@ fprintf(f, "Support for:");
 #ifdef EXPERIMENTAL_OCSP
   fprintf(f, " Experimental_OCSP");
 #endif
-#ifdef EXPERIMENTAL_PRDR
-  fprintf(f, " Experimental_PRDR");
-#endif
 #ifdef EXPERIMENTAL_PROXY
   fprintf(f, " Experimental_Proxy");
 #endif
index a2cc5031315ceda28b1ee498d0c84a4bb8285550..a25b06a05cc3f48bd8b66813c8594b270ea854a1 100644 (file)
@@ -155,7 +155,7 @@ uschar *tls_verify_certificates= NULL;
 uschar *tls_verify_hosts       = NULL;
 #endif
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 /* Per Recipient Data Response variables */
 BOOL    prdr_enable            = FALSE;
 BOOL    prdr_requested         = FALSE;
@@ -218,7 +218,7 @@ uschar *acl_removed_headers    = NULL;
 uschar *acl_smtp_auth          = NULL;
 uschar *acl_smtp_connect       = NULL;
 uschar *acl_smtp_data          = NULL;
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 uschar *acl_smtp_data_prdr     = NULL;
 #endif
 #ifndef DISABLE_DKIM
@@ -254,7 +254,7 @@ uschar *acl_wherenames[]       = { US"RCPT",
                                    US"MIME",
                                    US"DKIM",
                                    US"DATA",
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
                                    US"PRDR",
 #endif
                                    US"non-SMTP",
@@ -279,7 +279,7 @@ uschar *acl_wherecodes[]       = { US"550",     /* RCPT */
                                    US"550",     /* MIME */
                                    US"550",     /* DKIM */
                                    US"550",     /* DATA */
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
                                    US"550",    /* RCPT PRDR */
 #endif
                                    US"0",       /* not SMTP; not relevant */
index 8b55321f91c7d7872cb5f1d921138487b2bc94a7..3d4cd3981f86233b4c8e4485e6d8e235b89d3edb 100644 (file)
@@ -160,7 +160,7 @@ extern uschar *acl_removed_headers;    /* Headers deleted by an ACL */
 extern uschar *acl_smtp_auth;          /* ACL run for AUTH */
 extern uschar *acl_smtp_connect;       /* ACL run on SMTP connection */
 extern uschar *acl_smtp_data;          /* ACL run after DATA received */
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 extern uschar *acl_smtp_data_prdr;     /* ACL run after DATA received if in PRDR mode*/
 const extern pcre *regex_PRDR;         /* For recognizing PRDR settings */
 #endif
@@ -592,7 +592,7 @@ extern uschar *percent_hack_domains;   /* Local domains for which '% operates */
 extern uschar *pid_file_path;          /* For writing daemon pids */
 extern uschar *pipelining_advertise_hosts; /* As it says */
 extern BOOL    pipelining_enable;      /* As it says */
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 extern BOOL    prdr_enable;            /* As it says */
 extern BOOL    prdr_requested;         /* Connecting mail server wants PRDR */
 #endif
index fc3776c849212376331f7a804f964df89aeff0a3..53c0e3e271b040d28f45627278bf678dcb103b9a 100644 (file)
@@ -826,7 +826,7 @@ enum { ACL_WHERE_RCPT,       /* Some controls are for RCPT only */
        ACL_WHERE_MIME,       /* ) implemented by <= WHERE_NOTSMTP           */
        ACL_WHERE_DKIM,       /* )                                           */
        ACL_WHERE_DATA,       /* )                                           */
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
        ACL_WHERE_PRDR,       /* )                                           */
 #endif
        ACL_WHERE_NOTSMTP,    /* )                                           */
index f213b2c57f41112200468f1cc68fa0ed3b932cb7..db1d766b0d5caa909641afcc60b12bc809634c40 100644 (file)
@@ -140,7 +140,7 @@ static optionlist optionlist_config[] = {
   { "acl_smtp_auth",            opt_stringptr,   &acl_smtp_auth },
   { "acl_smtp_connect",         opt_stringptr,   &acl_smtp_connect },
   { "acl_smtp_data",            opt_stringptr,   &acl_smtp_data },
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   { "acl_smtp_data_prdr",       opt_stringptr,   &acl_smtp_data_prdr },
 #endif
 #ifndef DISABLE_DKIM
@@ -324,7 +324,7 @@ static optionlist optionlist_config[] = {
 #endif
   { "pid_file_path",            opt_stringptr,   &pid_file_path },
   { "pipelining_advertise_hosts", opt_stringptr, &pipelining_advertise_hosts },
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   { "prdr_enable",              opt_bool,        &prdr_enable },
 #endif
   { "preserve_message_logs",    opt_bool,        &preserve_message_logs },
index 407af58f84c1720e6ddd11d7040fcbe10195ab18..af8e6de4c6487077886e9e445fc9dec32fb428a3 100644 (file)
@@ -519,7 +519,7 @@ Arguments:
 Returns:       nothing
 */
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 static void
 smtp_user_msg(uschar *code, uschar *user_msg)
 {
@@ -3276,8 +3276,8 @@ else
     dmarc_up = dmarc_store_data(from_header);
 #endif /* EXPERIMENTAL_DMARC */
 
-#ifdef EXPERIMENTAL_PRDR
-    if (prdr_requested && recipients_count > 1 && acl_smtp_data_prdr != NULL )
+#ifndef DISABLE_PRDR
+    if (prdr_requested && recipients_count > 1 && acl_smtp_data_prdr)
       {
       unsigned int c;
       int all_pass = OK;
@@ -3345,7 +3345,7 @@ else
       }
     else
       prdr_requested = FALSE;
-#endif /* EXPERIMENTAL_PRDR */
+#endif /* !DISABLE_PRDR */
 
     /* Check the recipients count again, as the MIME ACL might have changed
     them. */
@@ -3738,21 +3738,20 @@ if (message_reference != NULL)
 s = add_host_info_for_log(s, &size, &sptr);
 
 #ifdef SUPPORT_TLS
-if ((log_extra_selector & LX_tls_cipher) != 0 && tls_in.cipher != NULL)
+if (log_extra_selector & LX_tls_cipher && tls_in.cipher)
   s = string_append(s, &size, &sptr, 2, US" X=", tls_in.cipher);
-if ((log_extra_selector & LX_tls_certificate_verified) != 0 &&
-     tls_in.cipher != NULL)
+if (log_extra_selector & LX_tls_certificate_verified && tls_in.cipher)
   s = string_append(s, &size, &sptr, 2, US" CV=",
     tls_in.certificate_verified? "yes":"no");
-if ((log_extra_selector & LX_tls_peerdn) != 0 && tls_in.peerdn != NULL)
+if (log_extra_selector & LX_tls_peerdn && tls_in.peerdn)
   s = string_append(s, &size, &sptr, 3, US" DN=\"",
     string_printing(tls_in.peerdn), US"\"");
-if ((log_extra_selector & LX_tls_sni) != 0 && tls_in.sni != NULL)
+if (log_extra_selector & LX_tls_sni && tls_in.sni)
   s = string_append(s, &size, &sptr, 3, US" SNI=\"",
     string_printing(tls_in.sni), US"\"");
 #endif
 
-if (sender_host_authenticated != NULL)
+if (sender_host_authenticated)
   {
   s = string_append(s, &size, &sptr, 2, US" A=", sender_host_authenticated);
   if (authenticated_id != NULL)
@@ -3763,16 +3762,14 @@ if (sender_host_authenticated != NULL)
     }
   }
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 if (prdr_requested)
   s = string_append(s, &size, &sptr, 1, US" PRDR");
 #endif
+
 #ifdef EXPERIMENTAL_PROXY
-if (proxy_session &&
-    (log_extra_selector & LX_proxy) != 0)
-  {
+if (proxy_session &&  log_extra_selector & LX_proxy)
   s = string_append(s, &size, &sptr, 2, US" PRX=", proxy_host_address);
-  }
 #endif
 
 sprintf(CS big_buffer, "%d", msg_size);
@@ -3990,11 +3987,11 @@ if(cutthrough_fd >= 0)
     }
   }
 
-if(smtp_reply == NULL
-#ifdef EXPERIMENTAL_PRDR
-                     || prdr_requested
+#ifndef DISABLE_PRDR
+if(!smtp_reply || prdr_requested)
+#else
+if(!smtp_reply)
 #endif
-  )
   {
   log_write(0, LOG_MAIN |
     (((log_extra_selector & LX_received_recipients) != 0)? LOG_RECIPIENTS : 0) |
index 82a805a21a0f03703b6d838aa87c035b27f2a16c..aad778eefc4360176396b34dcded05092e43b961 100644 (file)
@@ -214,7 +214,7 @@ static uschar *protocols[] = {
 /* Sanity check and validate optional args to MAIL FROM: envelope */
 enum {
   ENV_MAIL_OPT_SIZE, ENV_MAIL_OPT_BODY, ENV_MAIL_OPT_AUTH,
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   ENV_MAIL_OPT_PRDR,
 #endif
   ENV_MAIL_OPT_NULL
@@ -229,7 +229,7 @@ static env_mail_type_t env_mail_type_list[] = {
     { US"SIZE",   ENV_MAIL_OPT_SIZE,   TRUE  },
     { US"BODY",   ENV_MAIL_OPT_BODY,   TRUE  },
     { US"AUTH",   ENV_MAIL_OPT_AUTH,   TRUE  },
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
     { US"PRDR",   ENV_MAIL_OPT_PRDR,   FALSE },
 #endif
     { US"NULL",   ENV_MAIL_OPT_NULL,   FALSE }
@@ -2637,7 +2637,7 @@ uschar *what =
 #endif
   (where == ACL_WHERE_PREDATA)? US"DATA" :
   (where == ACL_WHERE_DATA)? US"after DATA" :
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   (where == ACL_WHERE_PRDR)? US"after DATA PRDR" :
 #endif
   (smtp_cmd_data == NULL)?
@@ -3628,12 +3628,13 @@ while (done <= 0)
         }
       #endif
 
-      #ifdef EXPERIMENTAL_PRDR
+      #ifndef DISABLE_PRDR
       /* Per Recipient Data Response, draft by Eric A. Hall extending RFC */
-      if (prdr_enable) {
+      if (prdr_enable)
+        {
         s = string_cat(s, &size, &ptr, smtp_code, 3);
         s = string_cat(s, &size, &ptr, US"-PRDR\r\n", 7);
-      }
+       }
       #endif
 
       /* Finish off the multiline reply with one that is always available. */
@@ -3862,9 +3863,9 @@ while (done <= 0)
             }
             break;
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
         case ENV_MAIL_OPT_PRDR:
-          if ( prdr_enable )
+          if (prdr_enable)
             prdr_requested = TRUE;
           break;
 #endif
@@ -3989,29 +3990,32 @@ while (done <= 0)
     when pipelining is not advertised, do another sync check in case the ACL
     delayed and the client started sending in the meantime. */
 
-    if (acl_smtp_mail == NULL) rc = OK; else
+    if (acl_smtp_mail)
       {
       rc = acl_check(ACL_WHERE_MAIL, NULL, acl_smtp_mail, &user_msg, &log_msg);
       if (rc == OK && !pipelining_advertised && !check_sync())
         goto SYNC_FAILURE;
       }
+    else
+      rc = OK;
 
     if (rc == OK || rc == DISCARD)
       {
-      if (user_msg == NULL) 
+      if (!user_msg)
         smtp_printf("%s%s%s", US"250 OK",
-                  #ifdef EXPERIMENTAL_PRDR
-                    prdr_requested == TRUE ? US", PRDR Requested" :
-                  #endif
+                  #ifndef DISABLE_PRDR
+                    prdr_requested ? US", PRDR Requested" : US"",
+                 #else
                     US"",
+                  #endif
                     US"\r\n");
       else 
         {
-      #ifdef EXPERIMENTAL_PRDR
-        if ( prdr_requested == TRUE )
+      #ifndef DISABLE_PRDR
+        if (prdr_requested)
            user_msg = string_sprintf("%s%s", user_msg, US", PRDR Requested");
       #endif
-        smtp_user_msg(US"250",user_msg);
+        smtp_user_msg(US"250", user_msg);
         }
       smtp_delay_rcpt = smtp_rlr_base;
       recipients_discarded = (rc == DISCARD);
index 989653e30c60494691aa4618ea9f456b7d4bb9a8..a9edb4670bf7ec90d1c7a8288b86118391951b09 100644 (file)
@@ -488,7 +488,7 @@ typedef struct address_item_propagated {
 #define af_cert_verified       0x01000000 /* delivered with verified TLS cert */
 #define af_pass_message        0x02000000 /* pass message in bounces */
 #define af_bad_reply           0x04000000 /* filter could not generate autoreply */
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 # define af_prdr_used          0x08000000 /* delivery used SMTP PRDR */
 #endif
 #define af_force_command       0x10000000 /* force_command in pipe transport */
index 020f76cac1305f5d5da2bb7b94ab993ec32b04c5..71a9f23760feac72e949c55a6f49f36289c0024a 100644 (file)
@@ -118,7 +118,7 @@ optionlist smtp_transport_options[] = {
 #endif
   { "hosts_try_auth",       opt_stringptr,
       (void *)offsetof(smtp_transport_options_block, hosts_try_auth) },
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   { "hosts_try_prdr",       opt_stringptr,
       (void *)offsetof(smtp_transport_options_block, hosts_try_prdr) },
 #endif
@@ -196,7 +196,7 @@ smtp_transport_options_block smtp_transport_option_defaults = {
   NULL,                /* serialize_hosts */
   NULL,                /* hosts_try_auth */
   NULL,                /* hosts_require_auth */
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   NULL,                /* hosts_try_prdr */
 #endif
 #ifdef EXPERIMENTAL_OCSP
@@ -1185,7 +1185,7 @@ BOOL completed_address = FALSE;
 BOOL esmtp = TRUE;
 BOOL pending_MAIL;
 BOOL pass_message = FALSE;
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 BOOL prdr_offered = FALSE;
 BOOL prdr_active;
 #endif
@@ -1386,7 +1386,7 @@ goto SEND_QUIT;
       PCRE_EOPT, NULL, 0) >= 0;
   #endif
 
-  #ifdef EXPERIMENTAL_PRDR
+  #ifndef DISABLE_PRDR
   prdr_offered = esmtp &&
     (pcre_exec(regex_PRDR, NULL, CS buffer, Ustrlen(buffer), 0,
       PCRE_EOPT, NULL, 0) >= 0) &&
@@ -1585,7 +1585,7 @@ if (continue_hostname == NULL
   DEBUG(D_transport) debug_printf("%susing PIPELINING\n",
     smtp_use_pipelining? "" : "not ");
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   prdr_offered = esmtp &&
     pcre_exec(regex_PRDR, NULL, CS buffer, Ustrlen(CS buffer), 0,
       PCRE_EOPT, NULL, 0) >= 0 &&
@@ -1673,7 +1673,7 @@ if (smtp_use_size)
   while (*p) p++;
   }
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
 prdr_active = FALSE;
 if (prdr_offered)
   {
@@ -1909,7 +1909,7 @@ if (!ok) ok = TRUE; else
 
   smtp_command = US"end of data";
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   /* For PRDR we optionally get a partial-responses warning
    * followed by the individual responses, before going on with
    * the overall response.  If we don't get the warning then deal
@@ -2004,7 +2004,7 @@ if (!ok) ok = TRUE; else
       address. For temporary errors, add a retry item for the address so that
       it doesn't get tried again too soon. */
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
       if (lmtp || prdr_active)
 #else
       if (lmtp)
@@ -2015,7 +2015,7 @@ if (!ok) ok = TRUE; else
           {
           if (errno != 0 || buffer[0] == 0) goto RESPONSE_FAILED;
           addr->message = string_sprintf(
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
            "%s error after %s: %s", prdr_active ? "PRDR":"LMTP",
 #else
            "LMTP error after %s: %s",
@@ -2029,7 +2029,7 @@ if (!ok) ok = TRUE; else
             errno = ERRNO_DATA4XX;
             addr->more_errno |= ((buffer[1] - '0')*10 + buffer[2] - '0') << 8;
             addr->transport_return = DEFER;
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
             if (!prdr_active)
 #endif
               retry_add_item(addr, addr->address_retry_key, 0);
@@ -2052,12 +2052,12 @@ if (!ok) ok = TRUE; else
       addr->host_used = thost;
       addr->special_action = flag;
       addr->message = conf;
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
       if (prdr_active) addr->flags |= af_prdr_used;
 #endif
       flag = '-';
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
       if (!prdr_active)
 #endif
         {
@@ -2079,7 +2079,7 @@ if (!ok) ok = TRUE; else
         }
       }
 
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
       if (prdr_active)
         {
        /* PRDR - get the final, overall response.  For any non-success
index 900542564524c53f93c205b5f52350644e63157c..c7de0091ae23a0aa38f95ce0c72d520cb55733e3 100644 (file)
@@ -21,7 +21,7 @@ typedef struct {
   uschar *serialize_hosts;
   uschar *hosts_try_auth;
   uschar *hosts_require_auth;
-#ifdef EXPERIMENTAL_PRDR
+#ifndef DISABLE_PRDR
   uschar *hosts_try_prdr;
 #endif
 #ifdef EXPERIMENTAL_OCSP
index b3c99396ab86d7ee48d8625c6b82f182a0644197..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-support Experimental_PRDR