aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-10 14:20:00 +0000
committerGitHub <noreply@github.com>2017-02-10 14:20:00 +0000
commitcef2dd42559032d6984f16bfb341250ba7faacc6 (patch)
tree167338d0670af77191f627e943a24e9e5438ca34 /test
parent9161c8aa8573be0570cdbb651c3efc0468cf3167 (diff)
parent3205e92fb872da3c43f9e22d44ff0d704cf85605 (diff)
downloadrspamd-cef2dd42559032d6984f16bfb341250ba7faacc6.tar.gz
rspamd-cef2dd42559032d6984f16bfb341250ba7faacc6.zip
Merge pull request #1409 from fatalbanana/MM5
Multimap: fixes for filters
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/102_multimap.robot16
-rw-r--r--test/functional/configs/maps/users.list1
-rw-r--r--test/functional/configs/multimap.conf10
3 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot
index f02320adf..599eaff1f 100644
--- a/test/functional/cases/102_multimap.robot
+++ b/test/functional/cases/102_multimap.robot
@@ -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
index 000000000..696fb6baa
--- /dev/null
+++ b/test/functional/configs/maps/users.list
@@ -0,0 +1 @@
+bob
diff --git a/test/functional/configs/multimap.conf b/test/functional/configs/multimap.conf
index 7c3d21fd4..d28b8a8bf 100644
--- a/test/functional/configs/multimap.conf
+++ b/test/functional/configs/multimap.conf
@@ -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";