summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2018-03-18 19:07:50 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2018-03-18 22:22:32 +0000
commit55997e6c4457d48140d2c7b3919bf98a46374ac7 (patch)
tree4e69fb70778dc9c0124925bdac86d98b5a08f461
parentd7b5f2ab122c3de70f1f6672fe07b87e011338c6 (diff)
DMARC: tescase
Extremely basic; we have no control of the DNS use of the dmarc library
-rw-r--r--test/aux-fixed/4650.tldfile1
-rw-r--r--test/confs/465028
-rw-r--r--test/log/46509
-rwxr-xr-xtest/runtest3
-rw-r--r--test/scripts/4650-DMARC/465032
-rw-r--r--test/scripts/4650-DMARC/REQUIRES1
-rw-r--r--test/stdout/465024
7 files changed, 98 insertions, 0 deletions
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 <norecord>
+1999-03-02 09:44:33 10HmaX-0005vi-00 dmarc_status_text <No DMARC record>
+1999-03-02 09:44:33 10HmaX-0005vi-00 dmarc_used_domain <example.com>
+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:<a@example.com>
+??? 250
+RCPT TO:<fred@test.ex>
+??? 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:<a@example.com>
+??? 250
+<<< 250 OK
+>>> RCPT TO:<fred@test.ex>
+??? 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