Testsuite: cutthrough vs. callout cache
authorJeremy Harris <jgh146exb@wizmail.org>
Thu, 7 Jul 2016 20:51:13 +0000 (21:51 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Fri, 8 Jul 2016 00:13:42 +0000 (01:13 +0100)
12 files changed:
test/confs/5402
test/confs/5403 [changed from symlink to file mode: 0644]
test/confs/5404 [new symlink]
test/log/5402 [new file with mode: 0644]
test/log/5404 [moved from test/log/5403 with 100% similarity]
test/scripts/5400-cutthrough/5402
test/scripts/5400-cutthrough/5403
test/scripts/5400-cutthrough/5404 [new file with mode: 0644]
test/stderr/5403 [moved from test/stderr/5402 with 100% similarity]
test/stdout/5402
test/stdout/5403
test/stdout/5404 [new file with mode: 0644]

index e480b64..2c10380 100644 (file)
@@ -1,4 +1,4 @@
-# Exim test configuration 5400
+# Exim test configuration 5402
 
 exim_path = EXIM_PATH
 keep_environment =
@@ -10,44 +10,33 @@ gecos_pattern = ""
 gecos_name = CALLER_NAME
 tls_advertise_hosts =
 
-log_selector = +received_recipients
-
 # ----- Main settings -----
 
 domainlist local_domains = test.ex : *.test.ex
 
-acl_smtp_rcpt = ar
-
+acl_smtp_rcpt = acl_rcpt
 
-# ----- ACLs -----
+# ----- ACLs -------
 
 begin acl
 
-ar:
-  warn control =       cutthrough_delivery
-       logwrite =      rcpt for $local_part@$domain
-  warn condition =     ${if eq {verify}{$local_part}}
-       verify =        recipient/callout=use_sender
-  accept
+acl_rcpt:
+.ifdef OPT
+    warn       control = cutthrough_delivery
+.endif
+    accept     verify = recipient/callout=use_sender
+
 
 # ----- Routers -----
 
 begin routers
 
-dns:
-  driver = dnslookup
-  domains = localhost.test.ex : localhost4.test.ex : thishost.test.ex
-  self = send
-  transport = smtp
-
 all:
   driver = manualroute
   domains = ! +local_domains
-  route_list = special.com HOSTIPV4 ; * 127.0.0.1
+  route_list = * 127.0.0.1
   self = send
-  transport = ${if eq {special_tpt}{$local_part} {smtp2}{smtp}}
-  headers_remove = X-hdr-rtr
-  headers_add =    X-hdr-rtr-new: $h_X-hdr-rtr:+++
+  transport = smtp
   no_more
 
 
@@ -59,12 +48,6 @@ smtp:
   driver = smtp
   interface = HOSTIPV4
   port = PORT_S
-  headers_add =  ${if def:h_X-hdr-rtr {X-hdr-tpt-new: new} {}}
-
-smtp2:
-  driver = smtp
-  interface = HOSTIPV4
-  port = PORT_S
 
 
 # End
deleted file mode 120000 (symlink)
index 8f6811b7e1be0fb33743e246ae5c05aea2c11f3f..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-5400
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..70ec647d009219414c8193b65d14a6b4d3904b42
--- /dev/null
@@ -0,0 +1,70 @@
+# Exim test configuration 5403
+
+exim_path = EXIM_PATH
+keep_environment =
+host_lookup_order = bydns
+primary_hostname = myhost.test.ex
+spool_directory = DIR/spool
+log_file_path = DIR/spool/log/%slog
+gecos_pattern = ""
+gecos_name = CALLER_NAME
+tls_advertise_hosts =
+
+log_selector = +received_recipients
+
+# ----- Main settings -----
+
+domainlist local_domains = test.ex : *.test.ex
+
+acl_smtp_rcpt = ar
+
+
+# ----- ACLs -----
+
+begin acl
+
+ar:
+  warn control =       cutthrough_delivery
+       logwrite =      rcpt for $local_part@$domain
+  warn condition =     ${if eq {verify}{$local_part}}
+       verify =        recipient/callout=use_sender
+  accept
+
+# ----- Routers -----
+
+begin routers
+
+dns:
+  driver = dnslookup
+  domains = localhost.test.ex : localhost4.test.ex : thishost.test.ex
+  self = send
+  transport = smtp
+
+all:
+  driver = manualroute
+  domains = ! +local_domains
+  route_list = special.com HOSTIPV4 ; * 127.0.0.1
+  self = send
+  transport = ${if eq {special_tpt}{$local_part} {smtp2}{smtp}}
+  headers_remove = X-hdr-rtr
+  headers_add =    X-hdr-rtr-new: $h_X-hdr-rtr:+++
+  no_more
+
+
+# ----- Transports -----
+
+begin transports
+
+smtp:
+  driver = smtp
+  interface = HOSTIPV4
+  port = PORT_S
+  headers_add =  ${if def:h_X-hdr-rtr {X-hdr-tpt-new: new} {}}
+
+smtp2:
+  driver = smtp
+  interface = HOSTIPV4
+  port = PORT_S
+
+
+# End
diff --git a/test/confs/5404 b/test/confs/5404
new file mode 120000 (symlink)
index 0000000..8f6811b
--- /dev/null
@@ -0,0 +1 @@
+5400
\ No newline at end of file
diff --git a/test/log/5402 b/test/log/5402
new file mode 100644 (file)
index 0000000..add3b3e
--- /dev/null
@@ -0,0 +1,3 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 >> dest@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
similarity index 100%
rename from test/log/5403
rename to test/log/5404
index 3e6f318..1113c6d 100644 (file)
@@ -1,42 +1,49 @@
-# cutthrough_delivery and -bhc
+# cutthrough_delivery vs. recipient-verify cache entry
 need_ipv4
-munge loopback
-no_msglog_check
 #
-# Despite config for cutthrough should not make onward conn
-server -t -2 PORT_S
+# Set up callout cache
+#
+server PORT_S
+220 ESMTP
+EHLO
+250 OK
+MAIL FROM:
+250 Sender OK
+RCPT TO:
+250 Recipient OK
+QUIT
+250 OK
 ****
-exim -bhc 1.2.3.4
+exim -bs -odf
 EHLO myhost.test.ex
 MAIL FROM:<CALLER@myhost.test.ex>
-RCPT TO:<plain@domain.com>
-DATA
-
-.
+RCPT TO:<dest@domain.com>
 QUIT
 ****
 #
-# Onward conn made for r-verify but cleared before DATA
+# Send message with cutthrough
+#
 server PORT_S
-220 server ready
+220 ESMTP
 EHLO
 250 OK
-MAIL
-250 OK
-RCPT
+MAIL FROM:
+250 Sender OK
+RCPT TO:
+250 Recipient OK
+DATA
+354 Send data
+.
 250 OK
 QUIT
-220 OK
-*eof
+250 OK
 ****
-exim -bhc 1.2.3.4
+exim -DOPT=CUTTHROUGH -bs -odf
 EHLO myhost.test.ex
 MAIL FROM:<CALLER@myhost.test.ex>
-RCPT TO:<verify@domain.com>
+RCPT TO:<dest@domain.com>
 DATA
 
 .
 QUIT
 ****
-#
-# End
index dbe7ef3..3e6f318 100644 (file)
@@ -1,30 +1,42 @@
-# cutthrough_delivery with MAIL SIZE=
+# cutthrough_delivery and -bhc
 need_ipv4
 munge loopback
+no_msglog_check
 #
-server PORT_S
-220 ESMTP
-EHLO
-250-OK
-250 SIZE 65536
-MAIL FROM:<fred@myhost.test.ex> SIZE=1123
-250 Sender OK
-RCPT TO:
-250 Recipient OK
+# Despite config for cutthrough should not make onward conn
+server -t -2 PORT_S
+****
+exim -bhc 1.2.3.4
+EHLO myhost.test.ex
+MAIL FROM:<CALLER@myhost.test.ex>
+RCPT TO:<plain@domain.com>
 DATA
-354 Send data
+
 .
-250 OK
 QUIT
+****
+#
+# Onward conn made for r-verify but cleared before DATA
+server PORT_S
+220 server ready
+EHLO
+250 OK
+MAIL
 250 OK
+RCPT
+250 OK
+QUIT
+220 OK
+*eof
 ****
-exim -bs
+exim -bhc 1.2.3.4
 EHLO myhost.test.ex
-MAIL FROM:<fred@myhost.test.ex> SIZE=99
-RCPT TO:<userx@domain.com>
+MAIL FROM:<CALLER@myhost.test.ex>
+RCPT TO:<verify@domain.com>
 DATA
 
 .
 QUIT
 ****
+#
 # End
diff --git a/test/scripts/5400-cutthrough/5404 b/test/scripts/5400-cutthrough/5404
new file mode 100644 (file)
index 0000000..dbe7ef3
--- /dev/null
@@ -0,0 +1,30 @@
+# cutthrough_delivery with MAIL SIZE=
+need_ipv4
+munge loopback
+#
+server PORT_S
+220 ESMTP
+EHLO
+250-OK
+250 SIZE 65536
+MAIL FROM:<fred@myhost.test.ex> SIZE=1123
+250 Sender OK
+RCPT TO:
+250 Recipient OK
+DATA
+354 Send data
+.
+250 OK
+QUIT
+250 OK
+****
+exim -bs
+EHLO myhost.test.ex
+MAIL FROM:<fred@myhost.test.ex> SIZE=99
+RCPT TO:<userx@domain.com>
+DATA
+
+.
+QUIT
+****
+# End
similarity index 100%
rename from test/stderr/5402
rename to test/stderr/5403
index c0548ba..1aa5596 100644 (file)
@@ -1,29 +1,14 @@
-
-**** SMTP testing session as if from host 1.2.3.4
-**** but without any ident (RFC 1413) callback.
-**** This is not for real!
-
 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
-250-myhost.test.ex Hello myhost.test.ex [1.2.3.4]\r
+250-myhost.test.ex Hello CALLER at myhost.test.ex\r
 250-SIZE 52428800\r
 250-8BITMIME\r
 250-PIPELINING\r
 250 HELP\r
 250 OK\r
 250 Accepted\r
-354 Enter message, ending with "." on a line by itself\r
-250 OK id=10HmaX-0005vi-00\r
-
-**** SMTP testing: that is not a real message id!
-
 221 myhost.test.ex closing connection\r
-
-**** SMTP testing session as if from host 1.2.3.4
-**** but without any ident (RFC 1413) callback.
-**** This is not for real!
-
 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
-250-myhost.test.ex Hello myhost.test.ex [1.2.3.4]\r
+250-myhost.test.ex Hello CALLER at myhost.test.ex\r
 250-SIZE 52428800\r
 250-8BITMIME\r
 250-PIPELINING\r
 250 OK\r
 250 Accepted\r
 354 Enter message, ending with "." on a line by itself\r
-250 OK id=10HmaY-0005vi-00\r
-
-**** SMTP testing: that is not a real message id!
-
+250 OK id=10HmaX-0005vi-00\r
 221 myhost.test.ex closing connection\r
 
 ******** SERVER ********
 Listening on port 1224 ... 
-Server timed out
-Listening on port 1224 ... 
 Connection request from [ip4.ip4.ip4.ip4]
-220 server ready
+220 ESMTP
 EHLO myhost.test.ex
 250 OK
 MAIL FROM:<CALLER@myhost.test.ex>
+250 Sender OK
+RCPT TO:<dest@domain.com>
+250 Recipient 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
-RCPT TO:<verify@domain.com>
+MAIL FROM:<CALLER@myhost.test.ex>
+250 Sender OK
+RCPT TO:<dest@domain.com>
+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@myhost.test.ex>)
+       id 10HmaX-0005vi-00
+       for dest@domain.com; Tue, 2 Mar 1999 09:44:33 +0000
+Message-Id: <E10HmaX-0005vi-00@myhost.test.ex>
+From: CALLER_NAME <CALLER@myhost.test.ex>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+.
 250 OK
 QUIT
-220 OK
-Expected EOF read from client
+250 OK
 End of script
index aa2bdca..c0548ba 100644 (file)
@@ -1,5 +1,10 @@
+
+**** SMTP testing session as if from host 1.2.3.4
+**** but without any ident (RFC 1413) callback.
+**** This is not for real!
+
 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
-250-myhost.test.ex Hello CALLER at myhost.test.ex\r
+250-myhost.test.ex Hello myhost.test.ex [1.2.3.4]\r
 250-SIZE 52428800\r
 250-8BITMIME\r
 250-PIPELINING\r
 250 Accepted\r
 354 Enter message, ending with "." on a line by itself\r
 250 OK id=10HmaX-0005vi-00\r
+
+**** SMTP testing: that is not a real message id!
+
+221 myhost.test.ex closing connection\r
+
+**** SMTP testing session as if from host 1.2.3.4
+**** but without any ident (RFC 1413) callback.
+**** This is not for real!
+
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello myhost.test.ex [1.2.3.4]\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmaY-0005vi-00\r
+
+**** SMTP testing: that is not a real message id!
+
 221 myhost.test.ex closing connection\r
 
 ******** SERVER ********
 Listening on port 1224 ... 
+Server timed out
+Listening on port 1224 ... 
 Connection request from [ip4.ip4.ip4.ip4]
-220 ESMTP
+220 server ready
 EHLO myhost.test.ex
-250-OK
-250 SIZE 65536
-MAIL FROM:<fred@myhost.test.ex> SIZE=ssss
-250 Sender OK
-RCPT TO:<userx@domain.com>
-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@myhost.test.ex>)
-       id 10HmaX-0005vi-00
-       for userx@domain.com; Tue, 2 Mar 1999 09:44:33 +0000
-Message-Id: <E10HmaX-0005vi-00@myhost.test.ex>
-From: CALLER_NAME <CALLER@myhost.test.ex>
-Date: Tue, 2 Mar 1999 09:44:33 +0000
-X-hdr-rtr-new: +++
-
-.
 250 OK
-QUIT
+MAIL FROM:<CALLER@myhost.test.ex>
 250 OK
+RCPT TO:<verify@domain.com>
+250 OK
+QUIT
+220 OK
+Expected EOF read from client
 End of script
diff --git a/test/stdout/5404 b/test/stdout/5404
new file mode 100644 (file)
index 0000000..aa2bdca
--- /dev/null
@@ -0,0 +1,40 @@
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello CALLER at myhost.test.ex\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmaX-0005vi-00\r
+221 myhost.test.ex closing connection\r
+
+******** SERVER ********
+Listening on port 1224 ... 
+Connection request from [ip4.ip4.ip4.ip4]
+220 ESMTP
+EHLO myhost.test.ex
+250-OK
+250 SIZE 65536
+MAIL FROM:<fred@myhost.test.ex> SIZE=ssss
+250 Sender OK
+RCPT TO:<userx@domain.com>
+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@myhost.test.ex>)
+       id 10HmaX-0005vi-00
+       for userx@domain.com; Tue, 2 Mar 1999 09:44:33 +0000
+Message-Id: <E10HmaX-0005vi-00@myhost.test.ex>
+From: CALLER_NAME <CALLER@myhost.test.ex>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+X-hdr-rtr-new: +++
+
+.
+250 OK
+QUIT
+250 OK
+End of script