SPF: use exim facilities for DNS lookups
[exim.git] / test / scripts / 4600-SPF / 4600
index d24fa9d94a5d7554e20de0d5dbc81180abca959e..58239487978e6957243e62ce3959d96f1bc45fa7 100644 (file)
@@ -1,15 +1,11 @@
 # acl condition and variables
 #
-# It is rather difficult to properly test spf.  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.
+# The 127.0.0.1 source addr seems to be a builtin in the spf library; no dns lookup is done.
+# HOSTIPV4 does get a series of lookups (see server debug output to verify that).
 #
-# For now just check that what should be working syntax does not cause us to fall over.
-# Be careful with envelope-domains and IPs used for testcases, as real DNS lookups will be done.
-#
-exim -bd -DSERVER=server -oX PORT_D:PORT_S
+exim -bd -DSERVER=server -oX PORT_D:PORT_S:PORT_N
 ****
-client 127.0.0.1 PORT_D
+client 127.0.0.1 PORT_S
 ??? 220
 helo testclient
 ??? 250
@@ -19,7 +15,7 @@ rcpt to:<fred@test.ex>
 ??? 250
 quit
 ****
-client 127.0.0.1 PORT_D
+client HOSTIPV4 PORT_S
 ??? 220
 helo testclient
 ??? 250
@@ -29,7 +25,7 @@ rcpt to:<fred@test.ex>
 ??? 250
 quit
 ****
-client 127.0.0.1 PORT_S
+client 127.0.0.1 PORT_D
 ??? 220
 helo testclient
 ??? 250
@@ -39,5 +35,25 @@ rcpt to:<fred@test.ex>
 ??? 250
 quit
 ****
+client HOSTIPV4 PORT_D
+??? 220
+helo testclient
+??? 250
+mail from:<b@test.example.com>
+??? 250
+rcpt to:<fred@test.ex>
+??? 550
+quit
+****
+client 127.0.0.1 PORT_N
+??? 220
+helo testclient
+??? 250
+mail from:<c@example.com>
+??? 250
+rcpt to:<fred@test.ex>
+??? 550
+quit
+****
 #
 killdaemon