]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Feature] Allow maps with multiple symbols and scores
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Jul 2016 12:44:08 +0000 (13:44 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Jul 2016 12:44:08 +0000 (13:44 +0100)
test/functional/cases/102_maps.robot
test/functional/configs/maps.conf
test/functional/configs/maps/multiple.list [new file with mode: 0644]

index 0a83283f68557a174745e045d7efbb00af4bc87f..aecc61b5c38b2434f29582341553c4e4a391da6a 100644 (file)
@@ -63,4 +63,28 @@ MAP - FROM REGEXP MISS
 
 MAP - DEPENDS HIT
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  -i  147.243.1.47  --from  user123@microsoft.com
-  Check Rspamc  ${result}  DEPS_MAP
\ No newline at end of file
+  Check Rspamc  ${result}  DEPS_MAP
+
+MAP - DEPENDS MISS
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  -i  127.0.0.1  --from  user123@microsoft.com
+  Check Rspamc  ${result}  DEPS_MAP  inverse=1  rc_nocheck=1
+
+MAP - MULSYM PLAIN
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  user1@example.com
+  Check Rspamc  ${result}  RCPT_MAP
+
+MAP - MULSYM SCORE
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  user2@example.com
+  Check Rspamc  ${result}  RCPT_MAP (10.0
+
+MAP - MULSYM SYMBOL
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  user3@example.com
+  Check Rspamc  ${result}  SYM1 (1.0
+
+MAP - MULSYM SYMBOL MISS
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  user4@example.com
+  Check Rspamc  ${result}  RCPT_MAP (1.0
+
+MAP - MULSYM SYMBOL + SCORE
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --rcpt  user5@example.com
+  Check Rspamc  ${result}  SYM1 (-10.0
\ No newline at end of file
index d90440384f8c1d684c58a6dc31b1e7a8f8392a72..4b6331fae8e70725200b5b26b4d46f67c937a8da 100644 (file)
@@ -53,6 +53,12 @@ multimap {
     filter = "email:addr";
     regexp = true;
     map = "${TESTDIR}/configs/maps/regexp.list";
-    require_symbols = "R_SPF_ALLOW & DNSBL_MAP & !FROM_MAP";
+    require_symbols = "R_SPF_ALLOW & REGEXP_MAP & !FROM_MAP";
+  }
+  RCPT_MAP {
+    type = "rcpt";
+    filter = "email:addr";
+    symbols = ["SYM1"];
+    map = "${TESTDIR}/configs/maps/multiple.list";
   }
 }
diff --git a/test/functional/configs/maps/multiple.list b/test/functional/configs/maps/multiple.list
new file mode 100644 (file)
index 0000000..24444f1
--- /dev/null
@@ -0,0 +1,10 @@
+#empty string
+user1@example.com
+#just score
+user2@example.com 10
+#just symbol
+user3@example.com SYM1
+#unknown symbol
+user4@example.com SYM2
+#symbol + score
+user5@example.com SYM1:-10.1