[exim-cvs] Testsuite: fix testcase for SPF empty-mailfrom-us…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Testsuite: fix testcase for SPF empty-mailfrom-use-helo. Bug 467
Gitweb: https://git.exim.org/exim.git/commitdiff/3bb1e9f161fd22707bc7cfcd77772422ac0fdd8e
Commit:     3bb1e9f161fd22707bc7cfcd77772422ac0fdd8e
Parent:     0f773e4df59a9d35929d5839f89c15487a1dd0be
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue Feb 2 21:30:56 2021 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Feb 2 21:30:56 2021 +0000


    Testsuite: fix testcase for SPF empty-mailfrom-use-helo.  Bug 467
---
 test/dnszones-src/db.example.com |  1 +
 test/log/4600                    | 12 +++++++++---
 test/rejectlog/4600              |  1 +
 test/scripts/4600-SPF/4600       | 21 +++++++++++++++++++--
 test/stdout/4600                 | 20 +++++++++++++++++---
 5 files changed, 47 insertions(+), 8 deletions(-)


diff --git a/test/dnszones-src/db.example.com b/test/dnszones-src/db.example.com
index 2d2cca0..94eb71c 100644
--- a/test/dnszones-src/db.example.com
+++ b/test/dnszones-src/db.example.com
@@ -33,6 +33,7 @@ doubleplus    TXT    v=spf1 include:_spf.google.com ~all
         TXT    v=spf1 +a +mx -all


 uppercase    TXT    v=sPf1 +all
+passme.helo    TXT    v=spf1 +all


; Alias A record for the local host, under the name "server1"

diff --git a/test/log/4600 b/test/log/4600
index 065cd54..dabeaf1 100644
--- a/test/log/4600
+++ b/test/log/4600
@@ -29,7 +29,13 @@
 1999-03-02 09:44:33 Authentication-Results: myhost.test.ex
 1999-03-02 09:44:33 H=(testclient) [127.0.0.1] F=<c@???> rejected RCPT <fred@???>
 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_header_comment myhost.test.ex: domain of passme.helo.example.com designates ip4.ip4.ip4.ip4 as permitted sender
 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=postmaster@???; helo=example.com;
-1999-03-02 09:44:33 Authentication-Results: myhost.test.ex;\n    spf=pass smtp.helo=example.com
+1999-03-02 09:44:33 spf_received       Received-SPF: pass (myhost.test.ex: domain of passme.helo.example.com designates ip4.ip4.ip4.ip4 as permitted sender) client-ip=ip4.ip4.ip4.ip4; envelope-from=postmaster@???; helo=passme.helo.example.com;
+1999-03-02 09:44:33 Authentication-Results: myhost.test.ex;\n    spf=pass smtp.helo=passme.helo.example.com
+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.open-spf.org/Why : 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=failme@???; helo=passme.helo.example.com;
+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=(passme.helo.example.com) [ip4.ip4.ip4.ip4] F=<failme@???> rejected RCPT <fred@???>
diff --git a/test/rejectlog/4600 b/test/rejectlog/4600
index e989ff7..338b674 100644
--- a/test/rejectlog/4600
+++ b/test/rejectlog/4600
@@ -2,3 +2,4 @@
 ******** SERVER ********
 1999-03-02 09:44:33 H=(testclient) [ip4.ip4.ip4.ip4] F=<b@???> rejected RCPT <fred@???>
 1999-03-02 09:44:33 H=(testclient) [127.0.0.1] F=<c@???> rejected RCPT <fred@???>
+1999-03-02 09:44:33 H=(passme.helo.example.com) [ip4.ip4.ip4.ip4] F=<failme@???> rejected RCPT <fred@???>
diff --git a/test/scripts/4600-SPF/4600 b/test/scripts/4600-SPF/4600
index cb67d19..55e2e0a 100644
--- a/test/scripts/4600-SPF/4600
+++ b/test/scripts/4600-SPF/4600
@@ -60,9 +60,14 @@ rcpt to:<fred@???>
 quit
 ****
 #
-client 127.0.0.1 PORT_S
+#
+#
+#
+#
+# helo name gets used when mailfrom is null
+client HOSTIPV4 PORT_S
 ??? 220
-helo example.com
+helo passme.helo.example.com
 ??? 250
 mail from:<>
 ??? 250
@@ -71,4 +76,16 @@ rcpt to:<fred@???>
 quit
 ****
 #
+# helo name is overridden when a mailfrom is set
+client HOSTIPV4 PORT_S
+??? 220
+helo passme.helo.example.com
+??? 250
+mail from:<failme@???>
+??? 250
+rcpt to:<fred@???>
+??? 550
+quit
+****
+#
 killdaemon
diff --git a/test/stdout/4600 b/test/stdout/4600
index a0d3eed..e686fee 100644
--- a/test/stdout/4600
+++ b/test/stdout/4600
@@ -68,12 +68,12 @@ Connecting to 127.0.0.1 port 1226 ... connected
 <<< 550 Administrative prohibition

>>> quit

End of script
-Connecting to 127.0.0.1 port 1224 ... connected
+Connecting to ip4.ip4.ip4.ip4 port 1224 ... connected
??? 220
<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
->>> helo example.com
+>>> helo passme.helo.example.com
??? 250
-<<< 250 myhost.test.ex Hello example.com [127.0.0.1]
+<<< 250 myhost.test.ex Hello passme.helo.example.com [ip4.ip4.ip4.ip4]
>>> mail from:<>

??? 250
<<< 250 OK
@@ -82,3 +82,17 @@ Connecting to 127.0.0.1 port 1224 ... connected
<<< 250 Accepted
>>> quit

End of script
+Connecting to ip4.ip4.ip4.ip4 port 1224 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> helo passme.helo.example.com
+??? 250
+<<< 250 myhost.test.ex Hello passme.helo.example.com [ip4.ip4.ip4.ip4]
+>>> mail from:<failme@???>
+??? 250
+<<< 250 OK
+>>> rcpt to:<fred@???>
+??? 550
+<<< 550 Administrative prohibition
+>>> quit
+End of script