[exim-cvs] Testsuite: Add test for proxy and -bh (Bug 2656)

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Testsuite: Add test for proxy and -bh (Bug 2656)
Gitweb: https://git.exim.org/exim.git/commitdiff/ee359040f0c1e78c057bb1e533059c5c3d9e2c69
Commit:     ee359040f0c1e78c057bb1e533059c5c3d9e2c69
Parent:     db889856a56c1da9d18fc2f676b4aad2d45dc585
Author:     Heiko Schlittermann (HS12-RIPE) <hs@???>
AuthorDate: Sat Oct 3 18:58:11 2020 +0200
Committer:  Heiko Schlittermann (HS12-RIPE) <hs@???>
CommitDate: Sun Oct 4 12:31:07 2020 +0200


    Testsuite: Add test for proxy and -bh (Bug 2656)
---
 test/confs/4031                       |   1 +
 test/scripts/4030-proxy-protocol/4031 |  40 +++++++++++++
 test/stderr/4031                      | 102 ++++++++++++++++++++++++++++++++++
 test/stdout/4031                      |  53 ++++++++++++++++++
 4 files changed, 196 insertions(+)


diff --git a/test/confs/4031 b/test/confs/4031
new file mode 120000
index 0000000..b6e26c8
--- /dev/null
+++ b/test/confs/4031
@@ -0,0 +1 @@
+4030
\ No newline at end of file
diff --git a/test/scripts/4030-proxy-protocol/4031 b/test/scripts/4030-proxy-protocol/4031
new file mode 100644
index 0000000..ecf3e82
--- /dev/null
+++ b/test/scripts/4030-proxy-protocol/4031
@@ -0,0 +1,40 @@
+# proxy-protocol proxy on inbound -bh
+#
+### non-prox plain receive
+exim -bh 127.0.0.2
+HELO clientname
+MAIL FROM: <a@???>
+RCPT TO:<b@???>
+DATA
+Subject: test non-prox
+
+body non-prox
+.
+QUIT
+****
+### protocol v1 receive
+exim -bh HOSTIPV4
+>>> PROXY TCP4 127.0.0.2 127.42.42.42 64000 25\r\n
+HELO clientname
+MAIL FROM: <a@???>
+RCPT TO:<b@???>
+DATA
+Subject: test v1
+
+body v1
+.
+QUIT
+****
+### protocol v2 receive
+exim -bh HOSTIPV4
+>>> \x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A\x21\x11\x00\x0c\x7f\x00\x00\x02\x7f\x2a\x2a\x2a\xc2\x95\x04\x01
+HELO clientname
+MAIL FROM: <a@???>
+RCPT TO:<b@???>
+DATA
+Subject: test v2
+
+body v2
+.
+QUIT
+****
diff --git a/test/stderr/4031 b/test/stderr/4031
new file mode 100644
index 0000000..c5336cb
--- /dev/null
+++ b/test/stderr/4031
@@ -0,0 +1,102 @@
+### non-prox plain receive
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> host in sender_unqualified_hosts? no (option unset)
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> clientname in helo_lookup_domains? no (end of list)
+>>> using ACL "r_acl"
+>>> processing "accept" (TESTSUITE/test-config 20)
+>>> check logwrite = proxy session: $proxy_session
+>>>                = proxy session: no
+LOG: proxy session: no
+>>> check logwrite = local          [$received_ip_address]:$received_port
+>>>                = local          []:-1
+LOG: local          []:-1
+>>> check logwrite = proxy internal [$proxy_local_address]:$proxy_local_port
+>>>                = proxy internal []:0
+LOG: proxy internal []:0
+>>> check logwrite = proxy external [$proxy_external_address]:$proxy_external_port
+>>>                = proxy external []:0
+LOG: proxy external []:0
+>>> check logwrite = remote         [$sender_host_address]:$sender_host_port
+>>>                = remote         [127.0.0.2]:1111
+LOG: remote         [127.0.0.2]:1111
+>>> accept: condition test succeeded in ACL "r_acl"
+>>> end of ACL "r_acl": ACCEPT
+>>> host in ignore_fromline_hosts? no (option unset)
+LOG: 10HmaX-0005vi-00 <= a@??? H=(clientname) [127.0.0.2] P=smtp S=sss
+### protocol v1 receive
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> host in sender_unqualified_hosts? no (option unset)
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> looking up host name for 127.0.0.2
+LOG: no host name found for IP address 127.0.0.2
+>>> clientname in helo_lookup_domains? no (end of list)
+>>> using ACL "r_acl"
+>>> processing "accept" (TESTSUITE/test-config 20)
+>>> check logwrite = proxy session: $proxy_session
+>>>                = proxy session: yes
+LOG: proxy session: yes
+>>> check logwrite = local          [$received_ip_address]:$received_port
+>>>                = local          []:-1
+LOG: local          []:-1
+>>> check logwrite = proxy internal [$proxy_local_address]:$proxy_local_port
+>>>                = proxy internal [ip4.ip4.ip4.ip4]:1111
+LOG: proxy internal [ip4.ip4.ip4.ip4]:1111
+>>> check logwrite = proxy external [$proxy_external_address]:$proxy_external_port
+>>>                = proxy external [127.42.42.42]:1112
+LOG: proxy external [127.42.42.42]:1112
+>>> check logwrite = remote         [$sender_host_address]:$sender_host_port
+>>>                = remote         [127.0.0.2]:1113
+LOG: remote         [127.0.0.2]:1113
+>>> accept: condition test succeeded in ACL "r_acl"
+>>> end of ACL "r_acl": ACCEPT
+>>> host in ignore_fromline_hosts? no (option unset)
+LOG: 10HmaY-0005vi-00 <= a@??? H=(clientname) [127.0.0.2]:1113 P=smtp PRX=ip4.ip4.ip4.ip4 S=sss
+### protocol v2 receive
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> host in sender_unqualified_hosts? no (option unset)
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> looking up host name for 127.0.0.2
+LOG: no host name found for IP address 127.0.0.2
+>>> clientname in helo_lookup_domains? no (end of list)
+>>> using ACL "r_acl"
+>>> processing "accept" (TESTSUITE/test-config 20)
+>>> check logwrite = proxy session: $proxy_session
+>>>                = proxy session: yes
+LOG: proxy session: yes
+>>> check logwrite = local          [$received_ip_address]:$received_port
+>>>                = local          []:-1
+LOG: local          []:-1
+>>> check logwrite = proxy internal [$proxy_local_address]:$proxy_local_port
+>>>                = proxy internal [ip4.ip4.ip4.ip4]:1111
+LOG: proxy internal [ip4.ip4.ip4.ip4]:1111
+>>> check logwrite = proxy external [$proxy_external_address]:$proxy_external_port
+>>>                = proxy external [127.42.42.42]:1114
+LOG: proxy external [127.42.42.42]:1114
+>>> check logwrite = remote         [$sender_host_address]:$sender_host_port
+>>>                = remote         [127.0.0.2]:1115
+LOG: remote         [127.0.0.2]:1115
+>>> accept: condition test succeeded in ACL "r_acl"
+>>> end of ACL "r_acl": ACCEPT
+>>> host in ignore_fromline_hosts? no (option unset)
+LOG: 10HmaZ-0005vi-00 <= a@??? H=(clientname) [127.0.0.2]:1115 P=smtp PRX=ip4.ip4.ip4.ip4 S=sss
+
+******** SERVER ********
+### non-prox plain receive
+### protocol v1 receive
+### protocol v2 receive
diff --git a/test/stdout/4031 b/test/stdout/4031
new file mode 100644
index 0000000..a0cddc6
--- /dev/null
+++ b/test/stdout/4031
@@ -0,0 +1,53 @@
+### non-prox plain receive
+
+**** SMTP testing session as if from host 127.0.0.2
+**** 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
+250 myhost.test.ex Hello clientname [127.0.0.2]
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaX-0005vi-00
+
+**** SMTP testing: that is not a real message id!
+
+221 myhost.test.ex closing connection
+### protocol v1 receive
+
+**** SMTP testing session as if from host ip4.ip4.ip4.ip4
+**** 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
+250 myhost.test.ex Hello clientname [127.0.0.2]
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaY-0005vi-00
+
+**** SMTP testing: that is not a real message id!
+
+221 myhost.test.ex closing connection
+### protocol v2 receive
+
+**** SMTP testing session as if from host ip4.ip4.ip4.ip4
+**** 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
+250 myhost.test.ex Hello clientname [127.0.0.2]
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaZ-0005vi-00
+
+**** SMTP testing: that is not a real message id!
+
+221 myhost.test.ex closing connection
+
+******** SERVER ********
+### non-prox plain receive
+### protocol v1 receive
+### protocol v2 receive