[exim-cvs] Add testcase for callout fallback from ESMTP to S…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Add testcase for callout fallback from ESMTP to SMTP.
Gitweb: http://git.exim.org/exim.git/commitdiff/24f66b4d1c46e638edbd1af06d3705cf0767a3c7
Commit:     24f66b4d1c46e638edbd1af06d3705cf0767a3c7
Parent:     2e5b33cdf3591080e44862951f7c2ac9eced16de
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon May 7 21:15:33 2012 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Jun 4 14:57:03 2012 +0100


    Add testcase for callout fallback from ESMTP to SMTP.
---
 src/src/smtp_in.c                 |    2 +-
 test/confs/5400                   |   10 ++++-
 test/log/5400                     |   10 +++++
 test/scripts/5400-cutthrough/5400 |   32 ++++++++++++++-
 test/stderr/5400                  |   82 +++++++++++++++++++++++++++++++++----
 test/stdout/5400                  |   46 +++++++++++++++++++--
 6 files changed, 167 insertions(+), 15 deletions(-)


diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 9c81579..db7f133 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -3991,7 +3991,7 @@ while (done <= 0)
         break;


         /* It is perhaps arguable as to which exit ACL should be called here,
-        but as it is probably a situtation that almost never arises, it
+        but as it is probably a situation that almost never arises, it
         probably doesn't matter. We choose to call the real QUIT ACL, which in
         some sense is perhaps "right". */


diff --git a/test/confs/5400 b/test/confs/5400
index 15690b7..8f2e8b5 100644
--- a/test/confs/5400
+++ b/test/confs/5400
@@ -13,9 +13,17 @@ gecos_name = CALLER_NAME

domainlist local_domains = test.ex : *.test.ex

-acl_smtp_rcpt = accept control = cutthrough_delivery
+acl_smtp_rcpt = ar


+# ----- ACLs -----
+
+begin acl
+
+ar:
+    accept control = cutthrough_delivery
+    logwrite = rcpt for $local_part@$domain
+
 # ----- Routers -----


begin routers
diff --git a/test/log/5400 b/test/log/5400
index 69f769c..2f049f7 100644
--- a/test/log/5400
+++ b/test/log/5400
@@ -1,4 +1,14 @@
+1999-03-02 09:44:33 rcpt for userx@???
1999-03-02 09:44:33 10HmaX-0005vi-00 >> userx@??? R=all T=smtp H=127.0.0.1 [127.0.0.1]
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@??? U=CALLER P=local-esmtp S=sss
1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 rcpt for userz@???
+1999-03-02 09:44:33 10HmaY-0005vi-00 >> userz@??? R=all T=smtp H=127.0.0.1 [127.0.0.1]
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@??? U=CALLER P=local-esmtp S=sss
+1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
+1999-03-02 09:44:33 rcpt for usery@???
+1999-03-02 09:44:33 rcpt for userx@???
+1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@??? U=CALLER P=local-esmtp S=sss
+1999-03-02 09:44:33 10HmaZ-0005vi-00 => usery@??? R=all T=smtp H=127.0.0.1 [127.0.0.1]
+1999-03-02 09:44:33 10HmaZ-0005vi-00 -> userx@??? R=all T=smtp H=127.0.0.1 [127.0.0.1]
+1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
diff --git a/test/scripts/5400-cutthrough/5400 b/test/scripts/5400-cutthrough/5400
index 843e24b..ccf5e74 100644
--- a/test/scripts/5400-cutthrough/5400
+++ b/test/scripts/5400-cutthrough/5400
@@ -25,6 +25,35 @@ DATA
.
QUIT
****
+# cutthrough_delivery into HELO-only server
+need_ipv4
+#
+server PORT_S
+220 SMTP only spoken here
+EHLO
+550 Not here, mate
+HELO
+250 OK
+MAIL FROM:
+250 Sender OK
+RCPT TO:
+250 Recipient OK
+DATA
+354 Send data
+.
+250 OK
+QUIT
+250 OK
+****
+exim -d-all+acl+transport -bs
+EHLO myhost.test.ex
+MAIL FROM:<eximtest@???>
+RCPT TO:<userz@???>
+DATA
+
+.
+QUIT
+****
# cutthrough cancelled by multiple recipients
server PORT_S 2
220 ESMTP
@@ -56,9 +85,10 @@ exim -d-all+acl+transport -bs
EHLO myhost.test.ex
MAIL FROM:<eximtest@???>
RCPT TO:<usery@???>
-RCPT TO:<userz@???>
+RCPT TO:<userx@???>
DATA

 .
 QUIT
 ****
+sleep 1
diff --git a/test/stderr/5400 b/test/stderr/5400
index c32d902..11c861b 100644
--- a/test/stderr/5400
+++ b/test/stderr/5400
@@ -3,9 +3,15 @@ configuration file is TESTSUITE/test-config
 admin user
 LOG: smtp_connection MAIN
   SMTP connection from CALLER
+using ACL "ar"
 processing "accept"
 check control = cutthrough_delivery
-accept: condition test succeeded in inline ACL
+check logwrite = rcpt for $local_part@$domain
+               = rcpt for userx@???
+LOG: MAIN
+  rcpt for userx@???
+created log directory TESTSUITE/spool/log
+accept: condition test succeeded in ACL "ar"
 ----------- start cutthrough setup ------------
 Connecting to 127.0.0.1 [127.0.0.1]:1224 from ip4.ip4.ip4.ip4 ... connected
   SMTP<< 220 ESMTP
@@ -25,9 +31,8 @@ accept: condition test succeeded in inline ACL
   SMTP<< 250 OK
 LOG: MAIN
   >> userx@??? R=all T=smtp H=127.0.0.1 [127.0.0.1]
-created log directory TESTSUITE/spool/log
   SMTP>> QUIT
------------ cutthrough shutdown ------------
+----------- cutthrough shutdown (delivered) ------------
 LOG: MAIN
   <= CALLER@??? U=CALLER P=local-esmtp S=sss
 LOG: MAIN
@@ -40,9 +45,57 @@ configuration file is TESTSUITE/test-config
 admin user
 LOG: smtp_connection MAIN
   SMTP connection from CALLER
+using ACL "ar"
 processing "accept"
 check control = cutthrough_delivery
+check logwrite = rcpt for $local_part@$domain
+               = rcpt for userz@???
+LOG: MAIN
+  rcpt for userz@???
+accept: condition test succeeded in ACL "ar"
+----------- start cutthrough setup ------------
+Connecting to 127.0.0.1 [127.0.0.1]:1224 from ip4.ip4.ip4.ip4 ... connected
+  SMTP<< 220 SMTP only spoken here
+  SMTP>> EHLO myhost.test.ex
+  SMTP<< 550 Not here, mate
+  SMTP>> HELO myhost.test.ex
+  SMTP<< 250 OK
+  SMTP>> MAIL FROM:<CALLER@???>
+  SMTP<< 250 Sender OK
+  SMTP>> RCPT TO:<userz@???>
+  SMTP<< 250 Recipient OK
+----------- end cutthrough setup ------------
+processing "accept"
 accept: condition test succeeded in inline ACL
+  SMTP>> DATA
+  SMTP<< 354 Send data
+  SMTP>>(nl)
+  SMTP>> .
+  SMTP<< 250 OK
+LOG: MAIN
+  >> userz@??? R=all T=smtp H=127.0.0.1 [127.0.0.1]
+  SMTP>> QUIT
+----------- cutthrough shutdown (delivered) ------------
+LOG: MAIN
+  <= CALLER@??? U=CALLER P=local-esmtp S=sss
+LOG: MAIN
+  Completed
+LOG: smtp_connection MAIN
+  SMTP connection from CALLER closed by QUIT
+>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
+Exim version x.yz ....
+configuration file is TESTSUITE/test-config
+admin user
+LOG: smtp_connection MAIN
+  SMTP connection from CALLER
+using ACL "ar"
+processing "accept"
+check control = cutthrough_delivery
+check logwrite = rcpt for $local_part@$domain
+               = rcpt for usery@???
+LOG: MAIN
+  rcpt for usery@???
+accept: condition test succeeded in ACL "ar"
 ----------- start cutthrough setup ------------
 Connecting to 127.0.0.1 [127.0.0.1]:1224 from ip4.ip4.ip4.ip4 ... connected
   SMTP<< 220 ESMTP
@@ -53,11 +106,16 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 from ip4.ip4.ip4.ip4 ... connected
   SMTP>> RCPT TO:<usery@???>
   SMTP<< 250 Recipient OK
 ----------- end cutthrough setup ------------
+using ACL "ar"
 processing "accept"
 check control = cutthrough_delivery
-accept: condition test succeeded in inline ACL
+check logwrite = rcpt for $local_part@$domain
+               = rcpt for userx@???
+LOG: MAIN
+  rcpt for userx@???
+accept: condition test succeeded in ACL "ar"
   SMTP>> QUIT
------------ cutthrough shutdown ------------
+----------- cutthrough shutdown (more than one recipient) ------------
 LOG: MAIN
   <= CALLER@??? U=CALLER P=local-esmtp S=sss
 LOG: smtp_connection MAIN
@@ -67,14 +125,15 @@ Exim version x.yz ....
 configuration file is TESTSUITE/test-config
 trusted user
 admin user
+skipping ACL configuration - not needed

>>>>>>>>>>>>>>>> Remote deliveries >>>>>>>>>>>>>>>>

--------> usery@??? <--------
smtp transport entered
usery@???
- userz@???
+ userx@???
checking status of 127.0.0.1
127.0.0.1 [127.0.0.1]:1111 status = usable
-delivering 10HmaY-0005vi-00 to 127.0.0.1 [127.0.0.1] (usery@???, ...)
+delivering 10HmaZ-0005vi-00 to 127.0.0.1 [127.0.0.1] (usery@???, ...)
Connecting to 127.0.0.1 [127.0.0.1]:1224 from ip4.ip4.ip4.ip4 ... connected
SMTP<< 220 ESMTP
SMTP>> EHLO myhost.test.ex
@@ -84,7 +143,7 @@ not using PIPELINING
SMTP<< 250 Sender OK
SMTP>> RCPT TO:<usery@???>
SMTP<< 250 Recipient OK
- SMTP>> RCPT TO:<userz@???>
+ SMTP>> RCPT TO:<userx@???>
SMTP<< 250 Recipient OK
SMTP>> DATA
SMTP<< 354 Send data
@@ -97,3 +156,10 @@ transport_check_waiting entered
no messages waiting for 127.0.0.1
SMTP>> QUIT
Leaving smtp transport
+LOG: MAIN
+ => usery@??? R=all T=smtp H=127.0.0.1 [127.0.0.1]
+LOG: MAIN
+ -> userx@??? R=all T=smtp H=127.0.0.1 [127.0.0.1]
+LOG: MAIN
+ Completed
+>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
diff --git a/test/stdout/5400 b/test/stdout/5400
index b8cd59a..74c2d23 100644
--- a/test/stdout/5400
+++ b/test/stdout/5400
@@ -17,10 +17,21 @@
250 HELP
250 OK
250 Accepted
-250 Accepted
354 Enter message, ending with "." on a line by itself
250 OK id=10HmaY-0005vi-00
221 myhost.test.ex closing connection
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250-myhost.test.ex Hello CALLER at myhost.test.ex
+250-SIZE 52428800
+250-8BITMIME
+250-PIPELINING
+250 HELP
+250 OK
+250 Accepted
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaZ-0005vi-00
+221 myhost.test.ex closing connection

 ******** SERVER ********
 Listening on port 1224 ... 
@@ -50,6 +61,33 @@ QUIT
 End of script
 Listening on port 1224 ... 
 Connection request from [ip4.ip4.ip4.ip4]
+220 SMTP only spoken here
+EHLO myhost.test.ex
+550 Not here, mate
+HELO myhost.test.ex
+250 OK
+MAIL FROM:<CALLER@???>
+250 Sender OK
+RCPT TO:<userz@???>
+250 Recipient OK
+DATA
+354 Send data
+Received: from CALLER (helo=myhost.test.ex)
+    by myhost.test.ex with local-esmtp (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmaY-0005vi-00
+    for userz@???; Tue, 2 Mar 1999 09:44:33 +0000
+Message-Id: <E10HmaY-0005vi-00@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+.
+250 OK
+QUIT
+250 OK
+End of script
+Listening on port 1224 ... 
+Connection request from [ip4.ip4.ip4.ip4]
 220 ESMTP
 EHLO myhost.test.ex
 250 OK
@@ -68,15 +106,15 @@ MAIL FROM:<CALLER@???>
 250 Sender OK
 RCPT TO:<usery@???>
 250 Recipient OK
-RCPT TO:<userz@???>
+RCPT TO:<userx@???>
 250 Recipient OK
 DATA
 354 Send data
 Received: from CALLER (helo=myhost.test.ex)
     by myhost.test.ex with local-esmtp (Exim x.yz)
     (envelope-from <CALLER@???>)
-    id 10HmaY-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmaY-0005vi-00@???>
+    id 10HmaZ-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000
+Message-Id: <E10HmaZ-0005vi-00@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000