From: Jeremy Harris Date: Sun, 18 Mar 2018 19:07:50 +0000 (+0000) Subject: DMARC: tescase X-Git-Tag: exim-4_91_RC2~7 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=55997e6c4457d48140d2c7b3919bf98a46374ac7;p=exim.git DMARC: tescase Extremely basic; we have no control of the DNS use of the dmarc library --- diff --git a/test/aux-fixed/4650.tldfile b/test/aux-fixed/4650.tldfile new file mode 100644 index 000000000..a9eb3bbf4 --- /dev/null +++ b/test/aux-fixed/4650.tldfile @@ -0,0 +1 @@ +ac diff --git a/test/confs/4650 b/test/confs/4650 new file mode 100644 index 000000000..e6c788436 --- /dev/null +++ b/test/confs/4650 @@ -0,0 +1,28 @@ +# Exim test configuration 4650 + +.include DIR/aux-var/std_conf_prefix + +primary_hostname = myhost.test.ex + +# ----- Main settings ----- + +dmarc_tld_file = DIR/aux-fixed/TESTNUM.tldfile + +acl_smtp_rcpt = accept +acl_smtp_data = check_data + +queue_only + +begin acl + +check_data: + accept hosts = HOSTIPV4 + spf = pass : !pass + dmarc_status = none : !none + logwrite = dmarc_status <$dmarc_status> + logwrite = dmarc_status_text <$dmarc_status_text> + logwrite = dmarc_used_domain <$dmarc_used_domain> + logwrite = dmarc_domain_policy <$dmarc_domain_policy> + logwrite = ${authresults {$primary_hostname}} + +# End diff --git a/test/log/4650 b/test/log/4650 new file mode 100644 index 000000000..2abe33f88 --- /dev/null +++ b/test/log/4650 @@ -0,0 +1,9 @@ + +******** 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 10HmaX-0005vi-00 dmarc_status +1999-03-02 09:44:33 10HmaX-0005vi-00 dmarc_status_text +1999-03-02 09:44:33 10HmaX-0005vi-00 dmarc_used_domain +1999-03-02 09:44:33 10HmaX-0005vi-00 dmarc_domain_policy <> +1999-03-02 09:44:33 10HmaX-0005vi-00 Authentication-Results: myhost.test.ex;\n spf=fail smtp.mailfrom=example.com;\n dmarc=noneheader.from=example.com +1999-03-02 09:44:33 10HmaX-0005vi-00 <= a@example.com H=(testclient) [ip4.ip4.ip4.ip4] P=smtp S=sss diff --git a/test/runtest b/test/runtest index 8925731d2..da02aa4bb 100755 --- a/test/runtest +++ b/test/runtest @@ -1138,6 +1138,9 @@ RESET_AFTER_EXTRA_LINE_READ: next if /^Waiting for MySQL server to answer/; next if /mysqladmin: CREATE DATABASE failed; .* database exists/; + # Not all builds include DMARC + next if /^DMARC: no (dmarc_tld_file|sender_host_address)$/ ; + # When Exim is checking the size of directories for maildir, it uses # the check_dir_size() function to scan directories. Of course, the order # of the files that are obtained using readdir() varies from system to diff --git a/test/scripts/4650-DMARC/4650 b/test/scripts/4650-DMARC/4650 new file mode 100644 index 000000000..85d9e51cc --- /dev/null +++ b/test/scripts/4650-DMARC/4650 @@ -0,0 +1,32 @@ +# acl variables and authresults +# +# SPF is a problem. We use libspf2 to do the work, and it +# does the DNS lookups, so we cannot intercept them in the testsuite's usual fashion +# 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. +# +exim -bd -DSERVER=server -oX PORT_D +**** +client HOSTIPV4 PORT_D +??? 220 +HELO testclient +??? 250 +MAIL FROM: +??? 250 +RCPT TO: +??? 250 +DATA +??? 3 +Subject: test +From: z@example.com + +body line +. +??? 250 +QUIT +**** +# +killdaemon +no_msglog_check diff --git a/test/scripts/4650-DMARC/REQUIRES b/test/scripts/4650-DMARC/REQUIRES new file mode 100644 index 000000000..bb17aff6c --- /dev/null +++ b/test/scripts/4650-DMARC/REQUIRES @@ -0,0 +1 @@ +support Experimental_DMARC diff --git a/test/stdout/4650 b/test/stdout/4650 new file mode 100644 index 000000000..acd347256 --- /dev/null +++ b/test/stdout/4650 @@ -0,0 +1,24 @@ +Connecting to ip4.ip4.ip4.ip4 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] +>>> MAIL FROM: +??? 250 +<<< 250 OK +>>> RCPT TO: +??? 250 +<<< 250 Accepted +>>> DATA +??? 3 +<<< 354 Enter message, ending with "." on a line by itself +>>> Subject: test +>>> From: z@example.com +>>> +>>> body line +>>> . +??? 250 +<<< 250 OK id=10HmaX-0005vi-00 +>>> QUIT +End of script