Callouts: fix recipient verify/random
authorJeremy Harris <jgh146exb@wizmail.org>
Tue, 31 Jan 2017 16:00:54 +0000 (16:00 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 31 Jan 2017 16:13:42 +0000 (16:13 +0000)
Broken-by: e9166683487c
src/src/verify.c
test/stderr/0476
test/stdout/0473

index 3dd2d3a39c9c850ee6bf196f6ec0194c8495bdce..96c2b66cc0b16a0a95117043a785c24eeedd1f0a 100644 (file)
@@ -778,6 +778,9 @@ tls_retry_connection:
       need another return code filtering out to here.
       */
 
+      /* Remember when we last did a random test */
+      new_domain_record.random_stamp = time(NULL);
+
       if (smtp_write_mail_and_rcpt_cmds(&sx, &yield) == 0)
        switch(addr->transport_return)
          {
@@ -810,13 +813,15 @@ tls_retry_connection:
            (void) event_raise(addr->transport->event_action,
                              US"tcp:close", NULL);
 #endif
+           addr->address = main_address;
+           addr->transport_return = PENDING_DEFER;
+           sx.first_addr = sx.sync_addr = addr;
+           sx.ok = FALSE;
+           sx.send_rset = TRUE;
+           sx.completed_addr = FALSE;
            goto tls_retry_connection;
          }
 
-      /* Remember when we last did a random test */
-
-      new_domain_record.random_stamp = time(NULL);
-
       /* Re-setup for main verify, or for the error message when failing */
       addr->address = main_address;
       addr->transport_return = PENDING_DEFER;
index 6868a902c7b786874c26e5928338c676e682f937..1ecd54d003a1762bf672095a57d3b5e709759357 100644 (file)
@@ -33,6 +33,7 @@ not using DSN
 cmd buf flush ddd bytes
   SMTP<< 250 OK
   SMTP<< 550 NO
+  SMTP(closed)<<
 Remote host closed connection in response to pipelined DATA
 error for DATA ignored: pipelining is in use and there were no good recipients
 ok=1 send_quit=1 send_rset=1 continue_more=0 yield=0 first_address is NULL
@@ -40,6 +41,7 @@ transport_check_waiting entered
   sequence=1 local_max=500 global_max=-1
   SMTP>> RSET
 cmd buf flush ddd bytes
+  SMTP(closed)<<
 H=127.0.0.1 [127.0.0.1] Remote host closed connection in response to RSET
   SMTP(close)>>
 set_process_info: pppp delivering 10HmaX-0005vi-00: just tried 127.0.0.1 [127.0.0.1] for userx@test.ex: result OK
index 6199bf9bc2553eed417410cf645eaa3ac3e5ae35..eda29bd92fd3c38ae9e10015d5d3d7c70c9aa368 100644 (file)
@@ -253,7 +253,7 @@ EHLO the.local.host.name
 250 OK
 MAIL FROM:<>
 250 OK
-RCPT TO:<the.local.host.name--testing@three.test.ex>
+RCPT TO:<r12@three.test.ex>
 250 OK
 QUIT
 250 OK