DMARC: tescase
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 18 Mar 2018 19:07:50 +0000 (19:07 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 18 Mar 2018 22:22:32 +0000 (22:22 +0000)
Extremely basic; we have no control of the DNS use of the dmarc library

test/aux-fixed/4650.tldfile [new file with mode: 0644]
test/confs/4650 [new file with mode: 0644]
test/log/4650 [new file with mode: 0644]
test/runtest
test/scripts/4650-DMARC/4650 [new file with mode: 0644]
test/scripts/4650-DMARC/REQUIRES [new file with mode: 0644]
test/stdout/4650 [new file with mode: 0644]

diff --git a/test/aux-fixed/4650.tldfile b/test/aux-fixed/4650.tldfile
new file mode 100644 (file)
index 0000000..a9eb3bb
--- /dev/null
@@ -0,0 +1 @@
+ac
diff --git a/test/confs/4650 b/test/confs/4650
new file mode 100644 (file)
index 0000000..e6c7884
--- /dev/null
@@ -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 (file)
index 0000000..2abe33f
--- /dev/null
@@ -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
index 8925731d2b1ba81bee0e0962f71ad44ed537ca34..da02aa4bbfa7c6fcf03fba610da2bab96a814f46 100755 (executable)
@@ -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 (file)
index 0000000..85d9e51
--- /dev/null
@@ -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 (file)
index 0000000..bb17aff
--- /dev/null
@@ -0,0 +1 @@
+support Experimental_DMARC
diff --git a/test/stdout/4650 b/test/stdout/4650
new file mode 100644 (file)
index 0000000..acd3472
--- /dev/null
@@ -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