]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Additional tests for multimap 1409/head
authorAndrew Lewis <nerf@judo.za.org>
Fri, 10 Feb 2017 13:53:19 +0000 (15:53 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 10 Feb 2017 13:53:19 +0000 (15:53 +0200)
test/functional/cases/102_multimap.robot
test/functional/configs/maps/users.list [new file with mode: 0644]
test/functional/configs/multimap.conf

index f02320adfbed13a7110a8f9dbaa52a5a38170530..599eaff1f45ffe5a532ac14e596d590a33eaec74 100644 (file)
@@ -69,6 +69,22 @@ MAP - FROM REGEXP MISS
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --from  user@other.org
   Check Rspamc  ${result}  REGEXP_MAP  inverse=1
 
+MAP - RCPT DOMAIN HIT
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  user@example.com
+  Check Rspamc  ${result}  RCPT_DOMAIN
+
+MAP - RCPT DOMAIN MISS
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  example.com@user
+  Check Rspamc  ${result}  RCPT_DOMAIN  inverse=1
+
+MAP - RCPT USER HIT
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  bob@example.com
+  Check Rspamc  ${result}  RCPT_USER
+
+MAP - RCPT USER MISS
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --from  example.com@bob
+  Check Rspamc  ${result}  RCPT_USER  inverse=1
+
 MAP - DEPENDS HIT
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  -i  5.9.155.182  --from  user123@rspamd.com
   Check Rspamc  ${result}  DEPS_MAP
diff --git a/test/functional/configs/maps/users.list b/test/functional/configs/maps/users.list
new file mode 100644 (file)
index 0000000..696fb6b
--- /dev/null
@@ -0,0 +1 @@
+bob
index 7c3d21fd414fe5d285c74520ac45bbb9a0fc7712..d28b8a8bffea7da19ad3d92bc6459447f6a99ede 100644 (file)
@@ -30,6 +30,16 @@ multimap {
     map = "${TESTDIR}/configs/maps/regexp.list";
     require_symbols = "R_SPF_ALLOW & REGEXP_MAP & !FROM_MAP";
   }
+  RCPT_DOMAIN {
+    type = "rcpt";
+    filter = "email:domain";
+    map = "${TESTDIR}/configs/maps/domains.list";
+  }
+  RCPT_USER {
+    type = "rcpt";
+    filter = "email:user";
+    map = "${TESTDIR}/configs/maps/users.list";
+  }
   RCPT_MAP {
     type = "rcpt";
     filter = "email:addr";