From 3bb1e9f161fd22707bc7cfcd77772422ac0fdd8e Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 2 Feb 2021 21:30:56 +0000 Subject: [PATCH] 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 2d2cca0b7..94eb71ccc 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 065cd544c..dabeaf19d 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= rejected RCPT 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@example.com; 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@passme.helo.example.com; 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 ) +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@example.com; 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= rejected RCPT diff --git a/test/rejectlog/4600 b/test/rejectlog/4600 index e989ff7b7..338b674e3 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= rejected RCPT 1999-03-02 09:44:33 H=(testclient) [127.0.0.1] F= rejected RCPT +1999-03-02 09:44:33 H=(passme.helo.example.com) [ip4.ip4.ip4.ip4] F= rejected RCPT diff --git a/test/scripts/4600-SPF/4600 b/test/scripts/4600-SPF/4600 index cb67d19ae..55e2e0aff 100644 --- a/test/scripts/4600-SPF/4600 +++ b/test/scripts/4600-SPF/4600 @@ -60,9 +60,14 @@ rcpt to: 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: quit **** # +# helo name is overridden when a mailfrom is set +client HOSTIPV4 PORT_S +??? 220 +helo passme.helo.example.com +??? 250 +mail from: +??? 250 +rcpt to: +??? 550 +quit +**** +# killdaemon diff --git a/test/stdout/4600 b/test/stdout/4600 index a0d3eed8b..e686fee12 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: +??? 250 +<<< 250 OK +>>> rcpt to: +??? 550 +<<< 550 Administrative prohibition +>>> quit +End of script -- 2.30.2