[exim-cvs] Fix smtp transport response to close after all rc…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] Fix smtp transport response to close after all rcpt fates determined. Bug 3059
Gitweb: https://git.exim.org/exim.git/commitdiff/d0e4bb183c038fe38ee249c1bd096f49120e908a
Commit:     d0e4bb183c038fe38ee249c1bd096f49120e908a
Parent:     35aacb69f5c839a4b77158464e401d86eb422ed6
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Fri Jan 26 21:18:01 2024 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Fri Jan 26 22:01:31 2024 +0000


        Fix smtp transport response to close after all rcpt fates determined.  Bug 3059
---
 doc/doc-txt/ChangeLog        | 12 ++++++
 src/src/transports/smtp.c    | 96 +++++++++++++++++++++++++-------------------
 test/README                  |  2 +-
 test/confs/0900              |  8 ++++
 test/log/0905                | 45 ++++++++++++---------
 test/rejectlog/0905          |  3 ++
 test/scripts/0000-Basic/0905 | 51 +++++++++++++++++++----
 test/stdout/0905             | 14 +++----
 8 files changed, 155 insertions(+), 76 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 48cc62910..4287e41e5 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -102,6 +102,18 @@ JH/20 Bug 3047: A recent (somewhere between 10.34 and 10.42) version of the
       The same issue arises with the ACL regex condition, which is applied
       to every line of a received message.


+JH/21 Bug 3059: Fix crash in smtp transport. When running for a message for
+      which all recipients had been handled (itself an issue) a null-pointer
+      deref was done on trying to write a retry record. Fix that by counting
+      the outstanding recipients before trying to transmit the message.
+      The situation arose for a second MX try within a transport run, when the
+      first had perm-rejected a recipient (the only one for the connection, in
+      the case seen) during pipelining, and then closed the TCP connection.
+      The transport classified that as an I/O error, leaving the message
+      outstanding but having marked up the recipient as dealt-with. It then
+      tried another MX because of the I/O error. Fix this by converting the
+      message-level status to ok if there was a close but all recipients were
+      dealt with.  Thanks to Wolfgand Breyha for debug runs.


 Exim version 4.97
 -----------------
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 817d729a7..c205145a7 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -4518,7 +4518,26 @@ if (!sx->ok)
     break;


       case ERRNO_SMTPCLOSED:
-    message_error = Ustrncmp(smtp_command,"end ",4) == 0;
+    /* If the peer closed the TCP connection after end-of-data, but before
+    we could send QUIT, do TLS close, etc - call it a message error.
+    Otherwise, if all the recipients have been dealt with, call a close no
+    error at all; each address_item should have a suitable result already
+    (2xx: PENDING_OK, 4xx: DEFER, 5xx: FAIL) */
+
+    if (!(message_error = Ustrncmp(smtp_command,"end ",4) == 0))
+      {
+      address_item * addr;
+      for (addr = sx->addrlist; addr; addr = addr->next)
+        if (addr->transport_return == PENDING_DEFER)
+          break;
+      if (!addr)    /* all rcpts fates determined */
+        {
+        log_write(0, LOG_MAIN, "peer close after all rcpt responses;"
+          " converting i/o-error to no-error");
+        sx->ok = TRUE;
+        goto happy;
+        }
+      }
     break;


 #ifndef DISABLE_DKIM
@@ -4542,7 +4561,8 @@ if (!sx->ok)
     break;
       }


-    /* Handle the cases that are treated as message errors. These are:
+    /* Handle the cases that are treated as message errors (as opposed to
+    host-errors). These are:


       (a) negative response or timeout after MAIL
       (b) negative response after DATA
@@ -4646,6 +4666,8 @@ connection to a new process. However, not all servers can handle this (Exim
 can), so we do not pass such a connection on if the host matches
 hosts_nopass_tls. */


+happy:
+
 DEBUG(D_transport)
   debug_printf("ok=%d send_quit=%d send_rset=%d continue_more=%d "
     "yield=%d first_address is %sNULL\n", sx->ok, sx->send_quit,
@@ -5063,16 +5085,16 @@ Returns:       the first address for this delivery
 */


 static address_item *
-prepare_addresses(address_item *addrlist, host_item *host)
+prepare_addresses(address_item * addrlist, host_item * host)
 {
-address_item *first_addr = NULL;
+address_item * first_addr = NULL;
 for (address_item * addr = addrlist; addr; addr = addr->next)
   if (addr->transport_return == DEFER)
     {
     if (!first_addr) first_addr = addr;
     addr->transport_return = PENDING_DEFER;
     addr->basic_errno = 0;
-    addr->more_errno = (host->mx >= 0)? 'M' : 'A';
+    addr->more_errno = host->mx >= 0 ? 'M' : 'A';
     addr->message = NULL;
 #ifndef DISABLE_TLS
     addr->cipher = NULL;
@@ -5104,24 +5126,17 @@ FALSE. */


 BOOL
 smtp_transport_entry(
-  transport_instance *tblock,      /* data for this instantiation */
-  address_item *addrlist)          /* addresses we are working on */
+  transport_instance * tblock,      /* data for this instantiation */
+  address_item * addrlist)          /* addresses we are working on */
 {
 int defport;
-int hosts_defer = 0;
-int hosts_fail  = 0;
-int hosts_looked_up = 0;
-int hosts_retry = 0;
-int hosts_serial = 0;
-int hosts_total = 0;
-int total_hosts_tried = 0;
+int hosts_defer = 0, hosts_fail  = 0, hosts_looked_up = 0;
+int hosts_retry = 0, hosts_serial = 0, hosts_total = 0, total_hosts_tried = 0;
 BOOL expired = TRUE;
-uschar *expanded_hosts = NULL;
-uschar *pistring;
-uschar *tid = string_sprintf("%s transport", tblock->name);
-smtp_transport_options_block *ob = SOB tblock->options_block;
-host_item *hostlist = addrlist->host_list;
-host_item *host = NULL;
+uschar * expanded_hosts = NULL, * pistring;
+uschar * tid = string_sprintf("%s transport", tblock->name);
+smtp_transport_options_block * ob = SOB tblock->options_block;
+host_item * hostlist = addrlist->host_list, * host = NULL;


DEBUG(D_transport)
{
@@ -5161,7 +5176,7 @@ database if the delivery fails temporarily or if we are running with
queue_smtp or a 2-stage queue run. This gets unset for certain
kinds of error, typically those that are specific to the message. */

-update_waiting = TRUE;
+update_waiting = TRUE;

 /* If a host list is not defined for the addresses - they must all have the
 same one in order to be passed to a single transport - or if the transport has
@@ -5349,16 +5364,12 @@ retry_non_continued:
        && total_hosts_tried < ob->hosts_max_try_hardlimit;
        host = nexthost)
     {
-    int rc;
-    int host_af;
-    BOOL host_is_expired = FALSE;
-    BOOL message_defer = FALSE;
-    BOOL some_deferred = FALSE;
-    address_item *first_addr = NULL;
-    uschar *interface = NULL;
-    uschar *retry_host_key = NULL;
-    uschar *retry_message_key = NULL;
-    uschar *serialize_key = NULL;
+    int rc, host_af;
+    BOOL host_is_expired = FALSE, message_defer = FALSE, some_deferred = FALSE;
+    address_item * first_addr = NULL;
+    uschar * interface = NULL;
+    uschar * retry_host_key = NULL, * retry_message_key = NULL;
+    uschar * serialize_key = NULL;


     /* Deal slightly better with a possible Linux kernel bug that results
     in intermittent TFO-conn fails deep into the TCP flow.  Bug 2907 tracks.
@@ -5665,7 +5676,14 @@ retry_non_continued:
     out the result of previous attempts, and finding the first address that
     is still to be delivered. */


-    first_addr = prepare_addresses(addrlist, host);
+    if (!(first_addr = prepare_addresses(addrlist, host)))
+      {
+      /* Obscure situation; at least one case (bug 3059, fixed) where
+      a previous host try returned DEFER, but having moved all
+      recipients away from DEFER (the waiting-to-be-done state). */
+      DEBUG(D_transport) debug_printf("no pending recipients\n");
+      goto END_TRANSPORT;
+      }


     DEBUG(D_transport) debug_printf("delivering %s to %s [%s] (%s%s)\n",
       message_id, host->name, host->address, addrlist->address,
@@ -5717,7 +5735,7 @@ retry_non_continued:
       {
       host_item * thost;
       /* Make a copy of the host if it is local to this invocation
-       of the transport. */
+      of the transport. */


       if (expanded_hosts)
     {
@@ -5911,20 +5929,14 @@ retry_non_continued:
     if (rc == OK)
       for (address_item * addr = addrlist; addr; addr = addr->next)
         if (addr->transport_return == DEFER)
-          {
-          some_deferred = TRUE;
-          break;
-          }
+          { some_deferred = TRUE; break; }


     /* If no addresses deferred or the result was ERROR, return. We do this for
     ERROR because a failing filter set-up or add_headers expansion is likely to
     fail for any host we try. */


     if (rc == ERROR || (rc == OK && !some_deferred))
-      {
-      DEBUG(D_transport) debug_printf("Leaving %s transport\n", tblock->name);
-      return TRUE;    /* Each address has its status */
-      }
+      goto END_TRANSPORT;


     /* If the result was DEFER or some individual addresses deferred, let
     the loop run to try other hosts with the deferred addresses, except for the
@@ -5944,7 +5956,7 @@ retry_non_continued:
     if ((rc == DEFER || some_deferred) && nexthost)
       {
       BOOL timedout;
-      retry_config *retry = retry_find_config(host->name, NULL, 0, 0);
+      retry_config * retry = retry_find_config(host->name, NULL, 0, 0);


       if (retry && retry->rules)
         {
diff --git a/test/README b/test/README
index c0bfa04f1..67df47453 100644
--- a/test/README
+++ b/test/README
@@ -1155,7 +1155,7 @@ are of the following kinds:
     before proceeding.


 (3) A line containing "*data" and a number specifies that the client is
-    expected to send that many byte; the server discards them
+    expected to send that many bytes; the server discards them


 (4) A line containing "*eof" specifies that the client is expected to close
     the connection at this point.
diff --git a/test/confs/0900 b/test/confs/0900
index 219751ec1..80c0211a9 100644
--- a/test/confs/0900
+++ b/test/confs/0900
@@ -57,6 +57,10 @@ ALLOW
 begin acl


 check_recipient:
+.ifdef RETRY2
+  drop     condition = ${if eq {SERVER}{server}}
+     message = 550 we really do not like you
+.endif
   accept hosts = :
   accept domains = +local_domains
   deny   message = relay not permitted
@@ -108,7 +112,11 @@ local_delivery:


 remote_smtp:
   driver = smtp
+.ifdef RETRY2
+  hosts =    127.0.0.1 : HOSTIPV4
+.else
   hosts =    127.0.0.1
+.endif
   port =    PORT_S
   hosts_try_fastopen = :
 .ifdef _HAVE_TLS
diff --git a/test/log/0905 b/test/log/0905
index 5f0c49bfa..d53fe9dbf 100644
--- a/test/log/0905
+++ b/test/log/0905
@@ -1,24 +1,33 @@
-2017-07-30 18:51:05.712 10HmaX-000000005vi-0000 <= sender@??? U=root Ci=p1234 P=local-bsmtp S=sss for p@???
-2017-07-30 18:51:05.712 10HmaX-000000005vi-0000 => p@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] K C="250 OK bdat"
+2017-07-30 18:51:05.712 10HmaX-000000005vi-0000 <= sender@??? U=root Ci=p1235 P=local-bsmtp S=sss for a@???
+2017-07-30 18:51:05.712 10HmaX-000000005vi-0000 => a@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] K C="250 OK bdat"
 2017-07-30 18:51:05.712 10HmaX-000000005vi-0000 Completed
-2017-07-30 18:51:05.712 10HmaY-000000005vi-0000 <= sender@??? U=root Ci=p1235 P=local-bsmtp S=sss for r@???
-2017-07-30 18:51:05.712 10HmaY-000000005vi-0000 => r@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] K C="250 OK bdat"
+2017-07-30 18:51:05.712 10HmaY-000000005vi-0000 <= sender@??? U=root Ci=p1236 P=local-bsmtp S=sss for c@???
+2017-07-30 18:51:05.712 10HmaY-000000005vi-0000 => c@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] K C="250 OK bdat"
 2017-07-30 18:51:05.712 10HmaY-000000005vi-0000 Completed
-2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 <= sender@??? U=root Ci=p1236 P=local-bsmtp S=sss for s@???
-2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 ** s@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 550 unacceptable mail-from
-2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 s@???: error ignored
+2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 <= sender@??? U=root Ci=p1237 P=local-bsmtp S=sss for d@???
+2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 ** d@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 550 unacceptable mail-from
+2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 d@???: error ignored
 2017-07-30 18:51:05.712 10HmaZ-000000005vi-0000 Completed
-2017-07-30 18:51:05.712 10HmbA-000000005vi-0000 <= sender@??? U=root Ci=p1237 P=local-bsmtp S=sss for s1@???
+2017-07-30 18:51:05.712 10HmbA-000000005vi-0000 <= sender@??? U=root Ci=p1238 P=local-bsmtp S=sss for c1@???
 2017-07-30 18:51:05.712 10HmbA-000000005vi-0000 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 450 greylisted mail-from
-2017-07-30 18:51:05.712 10HmbA-000000005vi-0000 == s1@??? R=to_server T=remote_smtp defer (-45) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 450 greylisted mail-from
-2017-07-30 18:51:05.712 10HmbB-000000005vi-0000 <= sender@??? U=root Ci=p1238 P=local-bsmtp S=sss for t@???
-2017-07-30 18:51:05.712 10HmbB-000000005vi-0000 ** t@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<t@???>: 550 no such recipient
-2017-07-30 18:51:05.712 10HmbB-000000005vi-0000 t@???: error ignored
+2017-07-30 18:51:05.712 10HmbA-000000005vi-0000 == c1@??? R=to_server T=remote_smtp defer (-45) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 450 greylisted mail-from
+2017-07-30 18:51:05.712 10HmbB-000000005vi-0000 <= sender@??? U=root Ci=p1239 P=local-bsmtp S=sss for e@???
+2017-07-30 18:51:05.712 10HmbB-000000005vi-0000 ** e@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<e@???>: 550 no such recipient
+2017-07-30 18:51:05.712 10HmbB-000000005vi-0000 e@???: error ignored
 2017-07-30 18:51:05.712 10HmbB-000000005vi-0000 Completed
-2017-07-30 18:51:05.712 10HmbC-000000005vi-0000 <= sender@??? U=root Ci=p1239 P=local-bsmtp S=sss for u@???
-2017-07-30 18:51:05.712 10HmbC-000000005vi-0000 ** u@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 500 oops bdat
-2017-07-30 18:51:05.712 10HmbC-000000005vi-0000 u@???: error ignored
+2017-07-30 18:51:05.712 10HmbC-000000005vi-0000 <= sender@??? U=root Ci=p1240 P=local-bsmtp S=sss for f1@???
+2017-07-30 18:51:05.712 10HmbC-000000005vi-0000 peer close after all rcpt responses; converting i/o-error to no-error
+2017-07-30 18:51:05.712 10HmbC-000000005vi-0000 ** f1@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] X=TLS1.x:ke-RSA-AES256-SHAnnn:xxx CV=yes: SMTP error from remote mail server after RCPT TO:<f1@???>: 550 we really do not like you
+2017-07-30 18:51:05.712 10HmbC-000000005vi-0000 f1@???: error ignored
 2017-07-30 18:51:05.712 10HmbC-000000005vi-0000 Completed
-2017-07-30 18:51:05.712 10HmbD-000000005vi-0000 <= sender@??? U=root Ci=p1240 P=local-bsmtp S=sss for v@???
-2017-07-30 18:51:05.712 10HmbD-000000005vi-0000 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 400 not right now bdat
-2017-07-30 18:51:05.712 10HmbD-000000005vi-0000 == v@??? R=to_server T=remote_smtp defer (-46) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 400 not right now bdat
+2017-07-30 18:51:05.712 10HmbD-000000005vi-0000 <= sender@??? U=root Ci=p1241 P=local-bsmtp S=sss for g@???
+2017-07-30 18:51:05.712 10HmbD-000000005vi-0000 ** g@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 500 oops bdat
+2017-07-30 18:51:05.712 10HmbD-000000005vi-0000 g@???: error ignored
+2017-07-30 18:51:05.712 10HmbD-000000005vi-0000 Completed
+2017-07-30 18:51:05.712 10HmbE-000000005vi-0000 <= sender@??? U=root Ci=p1242 P=local-bsmtp S=sss for h@???
+2017-07-30 18:51:05.712 10HmbE-000000005vi-0000 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 400 not right now bdat
+2017-07-30 18:51:05.712 10HmbE-000000005vi-0000 == h@??? R=to_server T=remote_smtp defer (-46) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 400 not right now bdat
+
+******** SERVER ********
+2017-07-30 18:51:05.712 exim x.yz daemon started: pid=p1243, no queue runs, listening for SMTP on port PORT_S
+2017-07-30 18:51:05.712 H=localhost (testhost.test.ex) [127.0.0.1] Ci=p1234 X=TLS1.x:ke-RSA-AES256-SHAnnn:xxx CV=no F=<> rejected RCPT <f1@???>: 550 we really do not like you
diff --git a/test/rejectlog/0905 b/test/rejectlog/0905
new file mode 100644
index 000000000..d1aa48b11
--- /dev/null
+++ b/test/rejectlog/0905
@@ -0,0 +1,3 @@
+
+******** SERVER ********
+2017-07-30 18:51:05.712 H=localhost (testhost.test.ex) [127.0.0.1] Ci=p1234 X=TLS1.x:ke-RSA-AES256-SHAnnn:xxx CV=no F=<> rejected RCPT <f1@???>: 550 we really do not like you
diff --git a/test/scripts/0000-Basic/0905 b/test/scripts/0000-Basic/0905
index 48f9574db..390b19c2e 100644
--- a/test/scripts/0000-Basic/0905
+++ b/test/scripts/0000-Basic/0905
@@ -23,7 +23,7 @@ QUIT
 sudo exim -odf -bS
 EHLO test
 MAIL FROM:<sender@???>
-RCPT TO:<p@???>
+RCPT TO:<a@???>
 DATA
 Subject: foo


@@ -53,7 +53,7 @@ QUIT
#sudo exim -odf -bS
#EHLO test
#MAIL FROM:<sender@???>
-#RCPT TO:<q@???>
+#RCPT TO:<b@???>
#DATA
#Subject: foo
#
@@ -84,7 +84,7 @@ QUIT
sudo exim -odf -bS
EHLO test
MAIL FROM:<sender@???>
-RCPT TO:<r@???>
+RCPT TO:<c@???>
DATA
Subject: foo

@@ -115,7 +115,7 @@ QUIT
sudo exim -odf -bS
EHLO test
MAIL FROM:<sender@???>
-RCPT TO:<s@???>
+RCPT TO:<d@???>
DATA
Subject: foo

@@ -144,7 +144,7 @@ QUIT
sudo exim -odf -bS
EHLO test
MAIL FROM:<sender@???>
-RCPT TO:<s1@???>
+RCPT TO:<c1@???>
DATA
Subject: foo

@@ -173,7 +173,7 @@ QUIT
sudo exim -odf -bS
EHLO test
MAIL FROM:<sender@???>
-RCPT TO:<t@???>
+RCPT TO:<e@???>
DATA
Subject: foo

@@ -182,6 +182,41 @@ data
QUIT
****
#
+# server rejects RCPT cmd, and immediately drops the TCP conn
+sudo rm DIR/spool/db/retry
+exim -bd -DSERVER=server -DRETRY2 -DSRV=tls -oX PORT_S
+****
+sudo exim -DRETRY2 -odf -bS
+EHLO test
+MAIL FROM:<sender@???>
+RCPT TO:<f1@???>
+DATA
+Subject: foo
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+BigHeader_500: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345
+
+data
+.
+QUIT
+****
+killdaemon
+#
# server rejects BDAT cmd
server PORT_S
220 Greetings
@@ -202,7 +237,7 @@ QUIT
sudo exim -odf -bS
EHLO test
MAIL FROM:<sender@???>
-RCPT TO:<u@???>
+RCPT TO:<g@???>
DATA
Subject: foo

@@ -231,7 +266,7 @@ QUIT
sudo exim -odf -bS
EHLO test
MAIL FROM:<sender@???>
-RCPT TO:<v@???>
+RCPT TO:<h@???>
DATA
Subject: foo

diff --git a/test/stdout/0905 b/test/stdout/0905
index 09c997ebf..7e687e780 100644
--- a/test/stdout/0905
+++ b/test/stdout/0905
@@ -8,7 +8,7 @@ EHLO testhost.test.ex
250-PIPELINING
250 CHUNKING
MAIL FROM:<>
-RCPT TO:<p@???>
+RCPT TO:<a@???>
BDAT 345 LAST
250 OK mail
250 OK rcpt
@@ -25,7 +25,7 @@ EHLO testhost.test.ex
250-PIPELINING
250 CHUNKING
MAIL FROM:<>
-RCPT TO:<r@???>
+RCPT TO:<c@???>
BDAT 345 LAST
250 OK mail
250 OK rcpt
@@ -41,7 +41,7 @@ EHLO testhost.test.ex
250-PIPELINING
250 CHUNKING
MAIL FROM:<>
-RCPT TO:<s@???>
+RCPT TO:<d@???>
BDAT 345 LAST
550 unacceptable mail-from
550 rcpt ungood lacking mail-from
@@ -57,7 +57,7 @@ EHLO testhost.test.ex
250-PIPELINING
250 CHUNKING
MAIL FROM:<>
-RCPT TO:<s1@???>
+RCPT TO:<c1@???>
BDAT 346 LAST
450 greylisted mail-from
550 rcpt ungood lacking mail-from
@@ -73,7 +73,7 @@ EHLO testhost.test.ex
250-PIPELINING
250 CHUNKING
MAIL FROM:<>
-RCPT TO:<t@???>
+RCPT TO:<e@???>
BDAT 345 LAST
250 OK mail
550 no such recipient
@@ -89,7 +89,7 @@ EHLO testhost.test.ex
250-PIPELINING
250 CHUNKING
MAIL FROM:<>
-RCPT TO:<u@???>
+RCPT TO:<g@???>
BDAT 345 LAST
250 OK mail
250 OK rcpt
@@ -105,7 +105,7 @@ EHLO testhost.test.ex
250-PIPELINING
250 CHUNKING
MAIL FROM:<>
-RCPT TO:<v@???>
+RCPT TO:<h@???>
BDAT 345 LAST
250 OK mail
250 OK rcpt

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/