Testsuite: for SPF tests, avoid using the ipv4 address
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 25 Mar 2018 16:14:41 +0000 (17:14 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 25 Mar 2018 16:14:41 +0000 (17:14 +0100)
test/confs/4600
test/log/4600
test/log/4601
test/rejectlog/4600 [deleted file]
test/scripts/4600-SPF/4600
test/scripts/4600-SPF/4601
test/stdout/4600
test/stdout/4601

index cce583909e5248e42cf70b5586bb24802ffa18a6..a566535cded3dc4fac97186de074c9ab380886e7 100644 (file)
@@ -11,7 +11,7 @@ acl_smtp_rcpt = check_rcpt
 begin acl
 
 check_rcpt:
-  accept       hosts =         HOSTIPV4
+  accept       condition =     ${if eq {$received_port}{PORT_D}}
                spf_guess =     pass
                logwrite =      spf_result         $spf_result (guess <$spf_result_guessed>)
                logwrite =      spf_header_comment $spf_header_comment
@@ -19,7 +19,7 @@ check_rcpt:
                logwrite =      spf_received       $spf_received
                logwrite =      ${authresults {$primary_hostname}}
 
-  accept       hosts =         127.0.0.1
+  accept       condition =     ${if eq {$received_port}{PORT_S}}
                spf =           pass : softfail : neutral
                logwrite =      spf_result         $spf_result
                logwrite =      spf_header_comment $spf_header_comment
index c59607edb53ceb00b592d7af7d4b023ce181b2a2..d7fe4f9ecb64c44206c7d539c786d683670b8823 100644 (file)
@@ -1,18 +1,16 @@
 
 ******** SERVER ********
-1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
-1999-03-02 09:44:33 spf_result         fail (guess <no>)
-1999-03-02 09:44:33 spf_header_comment myhost.test.ex: domain of example.com does not designate ip4.ip4.ip4.ip4 as permitted sender
-1999-03-02 09:44:33 spf_smtp_comment   Please see http://www.openspf.org/Why?id=a%40example.com&ip=ip4.ip4.ip4.ip4&receiver=myhost.test.ex : Reason: mechanism
-1999-03-02 09:44:33 spf_received       Received-SPF: fail (myhost.test.ex: domain of example.com does not designate ip4.ip4.ip4.ip4 as permitted sender) client-ip=ip4.ip4.ip4.ip4; envelope-from=a@example.com; helo=testclient;
-1999-03-02 09:44:33 Authentication-Results: myhost.test.ex;\n  spf=fail smtp.mailfrom=example.com
-1999-03-02 09:44:33 H=(testclient) [ip4.ip4.ip4.ip4] F=<a@example.com> rejected RCPT <fred@test.ex>
-1999-03-02 09:44:33 spf_result         neutral (guess <yes>)
-1999-03-02 09:44:33 spf_header_comment myhost.test.ex: ip4.ip4.ip4.ip4 is neither permitted nor denied by domain of test.example.com
-1999-03-02 09:44:33 spf_smtp_comment   Please see http://www.openspf.org/Why?id=b%40test.example.com&ip=ip4.ip4.ip4.ip4&receiver=myhost.test.ex : Reason: mechanism
-1999-03-02 09:44:33 spf_received       Received-SPF: neutral (myhost.test.ex: ip4.ip4.ip4.ip4 is neither permitted nor denied by domain of test.example.com) client-ip=ip4.ip4.ip4.ip4; envelope-from=b@test.example.com; helo=testclient;
-1999-03-02 09:44:33 Authentication-Results: myhost.test.ex;\n  spf=neutral (best guess record for domain) smtp.mailfrom=test.example.com
-1999-03-02 09:44:33 H=(testclient) [ip4.ip4.ip4.ip4] F=<b@test.example.com> rejected RCPT <fred@test.ex>
+1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 port 1224
+1999-03-02 09:44:33 spf_result         pass (guess <no>)
+1999-03-02 09:44:33 spf_header_comment myhost.test.ex: localhost is always allowed.
+1999-03-02 09:44:33 spf_smtp_comment   
+1999-03-02 09:44:33 spf_received       Received-SPF: pass (myhost.test.ex: localhost is always allowed.) client-ip=127.0.0.1; envelope-from=a@example.com; helo=testclient;
+1999-03-02 09:44:33 Authentication-Results: myhost.test.ex;\n  spf=pass smtp.mailfrom=example.com
+1999-03-02 09:44:33 spf_result         pass (guess <no>)
+1999-03-02 09:44:33 spf_header_comment myhost.test.ex: localhost is always allowed.
+1999-03-02 09:44:33 spf_smtp_comment   
+1999-03-02 09:44:33 spf_received       Received-SPF: pass (myhost.test.ex: localhost is always allowed.) client-ip=127.0.0.1; envelope-from=b@test.example.com; helo=testclient;
+1999-03-02 09:44:33 Authentication-Results: myhost.test.ex;\n  spf=pass smtp.mailfrom=test.example.com
 1999-03-02 09:44:33 spf_result         pass
 1999-03-02 09:44:33 spf_header_comment myhost.test.ex: localhost is always allowed.
 1999-03-02 09:44:33 spf_smtp_comment   
index e874ff17e6ed306d6b23b73858ccfa7933c0b15b..33334e89509393a0b75f2df29d6502c19a552c77 100644 (file)
@@ -1,5 +1,5 @@
 
 ******** SERVER ********
-1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
-1999-03-02 09:44:33 a@example.com [ip4.ip4.ip4.ip4] lookup: 'fail'
+1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 port 1224
+1999-03-02 09:44:33 a@example.com [127.0.0.1] lookup: 'pass'
 1999-03-02 09:44:33 b@example.com [127.0.0.1] lookup: 'pass'
diff --git a/test/rejectlog/4600 b/test/rejectlog/4600
deleted file mode 100644 (file)
index abd86c8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-******** SERVER ********
-1999-03-02 09:44:33 H=(testclient) [ip4.ip4.ip4.ip4] F=<a@example.com> rejected RCPT <fred@test.ex>
-1999-03-02 09:44:33 H=(testclient) [ip4.ip4.ip4.ip4] F=<b@test.example.com> rejected RCPT <fred@test.ex>
index 825efb9595490bd79a1108edf440bd126635e432..d24fa9d94a5d7554e20de0d5dbc81180abca959e 100644 (file)
@@ -5,31 +5,31 @@
 # to provide values for testcases.
 #
 # For now just check that what should be working syntax does not cause us to fall over.
-# Be careful with envelope-domains used for testcases, as real DNS lookups will be done.
+# Be careful with envelope-domains and IPs used for testcases, as real DNS lookups will be done.
 #
-exim -bd -DSERVER=server -oX PORT_D
+exim -bd -DSERVER=server -oX PORT_D:PORT_S
 ****
-client HOSTIPV4 PORT_D
+client 127.0.0.1 PORT_D
 ??? 220
 helo testclient
 ??? 250
 mail from:<a@example.com>
 ??? 250
 rcpt to:<fred@test.ex>
-??? 550
+??? 250
 quit
 ****
-client HOSTIPV4 PORT_D
+client 127.0.0.1 PORT_D
 ??? 220
 helo testclient
 ??? 250
 mail from:<b@test.example.com>
 ??? 250
 rcpt to:<fred@test.ex>
-??? 550
+??? 250
 quit
 ****
-client 127.0.0.1 PORT_D
+client 127.0.0.1 PORT_S
 ??? 220
 helo testclient
 ??? 250
index 096b64e2424c61375edb8c17832557810a9ef94b..ab434611c962e52de987495434baf1dea9c440ec 100644 (file)
@@ -7,9 +7,9 @@
 # For now just check that what should be working syntax does not cause us to fall over.
 # Be careful with envelope-domains used for testcases, as real DNS lookups will be done.
 #
-exim -bd -DSERVER=server -oX PORT_D
+exim -bd -DSERVER=server -oX PORT_D:PORT_S
 ****
-client HOSTIPV4 PORT_D
+client 127.0.0.1 PORT_D
 ??? 220
 helo testclient
 ??? 250
@@ -19,7 +19,7 @@ rcpt to:<fred@test.ex>
 ??? 250
 quit
 ****
-client 127.0.0.1 PORT_D
+client 127.0.0.1 PORT_S
 ??? 220
 helo testclient
 ??? 250
index 3b75a04e33143de928839bc6e5691276bc78ab98..e1089a58b00310dac29b0625308d43aa2ef538db 100644 (file)
@@ -1,32 +1,32 @@
-Connecting to ip4.ip4.ip4.ip4 port 1225 ... connected
+Connecting to 127.0.0.1 port 1225 ... connected
 ??? 220
 <<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
 >>> helo testclient
 ??? 250
-<<< 250 myhost.test.ex Hello testclient [ip4.ip4.ip4.ip4]
+<<< 250 myhost.test.ex Hello testclient [127.0.0.1]
 >>> mail from:<a@example.com>
 ??? 250
 <<< 250 OK
 >>> rcpt to:<fred@test.ex>
-??? 550
-<<< 550 Administrative prohibition
+??? 250
+<<< 250 Accepted
 >>> quit
 End of script
-Connecting to ip4.ip4.ip4.ip4 port 1225 ... connected
+Connecting to 127.0.0.1 port 1225 ... connected
 ??? 220
 <<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
 >>> helo testclient
 ??? 250
-<<< 250 myhost.test.ex Hello testclient [ip4.ip4.ip4.ip4]
+<<< 250 myhost.test.ex Hello testclient [127.0.0.1]
 >>> mail from:<b@test.example.com>
 ??? 250
 <<< 250 OK
 >>> rcpt to:<fred@test.ex>
-??? 550
-<<< 550 Administrative prohibition
+??? 250
+<<< 250 Accepted
 >>> quit
 End of script
-Connecting to 127.0.0.1 port 1225 ... connected
+Connecting to 127.0.0.1 port 1224 ... connected
 ??? 220
 <<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
 >>> helo testclient
index 9abbcf5a8ff9afc07f52e7b05354b50199b58f75..66746a4702abe19db0090eb74544a28406e6c2e3 100644 (file)
@@ -1,9 +1,9 @@
-Connecting to ip4.ip4.ip4.ip4 port 1225 ... connected
+Connecting to 127.0.0.1 port 1225 ... connected
 ??? 220
 <<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
 >>> helo testclient
 ??? 250
-<<< 250 myhost.test.ex Hello testclient [ip4.ip4.ip4.ip4]
+<<< 250 myhost.test.ex Hello testclient [127.0.0.1]
 >>> mail from:<a@example.com>
 ??? 250
 <<< 250 OK
@@ -12,7 +12,7 @@ Connecting to ip4.ip4.ip4.ip4 port 1225 ... connected
 <<< 250 Accepted
 >>> quit
 End of script
-Connecting to 127.0.0.1 port 1225 ... connected
+Connecting to 127.0.0.1 port 1224 ... connected
 ??? 220
 <<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
 >>> helo testclient