aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/400_known_senders.robot39
-rw-r--r--test/functional/cases/410_replies.robot47
-rw-r--r--test/functional/configs/merged.conf1
-rw-r--r--test/functional/configs/replies.conf6
-rw-r--r--test/functional/messages/inc_mail_known_sender.eml11
-rw-r--r--test/functional/messages/inc_mail_unknown_sender.eml11
-rw-r--r--test/functional/messages/replyto_1_1.eml11
-rw-r--r--test/functional/messages/replyto_1_2.eml11
-rw-r--r--test/functional/messages/replyto_1_2_s.eml11
-rw-r--r--test/functional/messages/replyto_2_2.eml11
-rw-r--r--test/functional/messages/set_replyto_1_1.eml12
-rw-r--r--test/functional/messages/set_replyto_1_2_first.eml11
-rw-r--r--test/functional/messages/set_replyto_2_2.eml11
13 files changed, 193 insertions, 0 deletions
diff --git a/test/functional/cases/400_known_senders.robot b/test/functional/cases/400_known_senders.robot
index f258113da..d827acc0e 100644
--- a/test/functional/cases/400_known_senders.robot
+++ b/test/functional/cases/400_known_senders.robot
@@ -7,6 +7,9 @@ Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
${CONFIG} ${RSPAMD_TESTDIR}/configs/known_senders.conf
+${SETTINGS_REPLIES} {symbols_enabled = [REPLIES_CHECK, REPLIES_SET, REPLY]}
+${SYMBOL_GLOBAL} INC_MAIL_KNOWN_GLOBALLY
+${SYMBOL_LOCAL} INC_MAIL_KNOWN_LOCALLY
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
@@ -34,3 +37,39 @@ UNKNOWN SENDER WRONG DOMAIN RESCAN
... Settings={symbols_enabled [KNOWN_SENDER]}
Do Not Expect Symbol KNOWN_SENDER
Do Not Expect Symbol UNKNOWN_SENDER
+
+INCOMING MAIL SENDER IS UNKNOWN
+ Scan File ${RSPAMD_TESTDIR}/messages/inc_mail_unknown_sender.eml
+ ... Settings={symbols_enabled [${SYMBOL_GLOBAL}, ${SYMBOL_LOCAL}]}
+ Do Not Expect Symbol ${SYMBOL_GLOBAL}
+ Do Not Expect Symbol ${SYMBOL_LOCAL}
+
+INCOMING MAIL SENDER IS KNOWN RECIPIENTS ARE UNKNOWN
+ Scan File ${RSPAMD_TESTDIR}/messages/set_replyto_1_1.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto_1_1.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Scan File ${RSPAMD_TESTDIR}/messages/inc_mail_known_sender.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings={symbols_enabled [${SYMBOL_GLOBAL}, ${SYMBOL_LOCAL}]}
+ Expect Symbol ${SYMBOL_GLOBAL}
+ Do Not Expect Symbol ${SYMBOL_LOCAL}
+
+INCOMING MAIL SENDER IS KNOWN RECIPIENTS ARE KNOWN
+ Scan File ${RSPAMD_TESTDIR}/messages/set_replyto_1_1.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto_1_1.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Scan File ${RSPAMD_TESTDIR}/messages/inc_mail_known_sender.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Scan File ${RSPAMD_TESTDIR}/messages/inc_mail_known_sender.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings={symbols_enabled [${SYMBOL_GLOBAL}, ${SYMBOL_LOCAL}]}
+ Expect Symbol ${SYMBOL_GLOBAL}
+ Expect Symbol ${SYMBOL_LOCAL}
+
diff --git a/test/functional/cases/410_replies.robot b/test/functional/cases/410_replies.robot
new file mode 100644
index 000000000..23ad9df35
--- /dev/null
+++ b/test/functional/cases/410_replies.robot
@@ -0,0 +1,47 @@
+*** Settings ***
+Suite Setup Rspamd Redis Setup
+Suite Teardown Rspamd Redis Teardown
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
+
+*** Variables ***
+${CONFIG} ${RSPAMD_TESTDIR}/configs/replies.conf
+${SETTINGS_REPLIES} {symbols_enabled = [REPLIES_CHECK, REPLIES_SET, REPLY]}
+${SYMBOL} REPLY
+${REDIS_SCOPE} Suite
+${RSPAMD_SCOPE} Suite
+
+*** Test Cases ***
+Reply to 1 sender 1 recipients
+ Scan File ${RSPAMD_TESTDIR}/messages/set_replyto_1_1.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto_1_1.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Expect Symbol ${SYMBOL}
+
+Reply to 1 sender 2 recipients first is set second is not
+ Scan File ${RSPAMD_TESTDIR}/messages/set_replyto_1_2_first.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto_1_2.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Expect Symbol ${SYMBOL}
+
+Reply to 1 sender 2 recipients 1 rcpt is same
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto_1_2_s.eml
+ ... IP=8.8.8.8 User=user@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Expect Symbol ${SYMBOL}
+
+Reply to another sender 2 recipients
+ Scan File ${RSPAMD_TESTDIR}/messages/set_replyto_2_2.eml
+ ... IP=8.8.8.8 User=another@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto_2_2.eml
+ ... IP=8.8.8.8 User=another@emailbl.com
+ ... Settings=${SETTINGS_REPLIES}
+ Expect Symbol ${SYMBOL}
diff --git a/test/functional/configs/merged.conf b/test/functional/configs/merged.conf
index 0718d0210..2b3640048 100644
--- a/test/functional/configs/merged.conf
+++ b/test/functional/configs/merged.conf
@@ -35,5 +35,6 @@ lua = "{= env.TESTDIR =}/lua/magic.lua"
# 380_external_relay
lua = "{= env.TESTDIR =}/lua/external_relay.lua"
+
.include(priority=1,duplicate=merge) "{= env.TESTDIR =}/configs/merged-local.conf"
.include(priority=2,duplicate=replace) "{= env.TESTDIR =}/configs/merged-override.conf"
diff --git a/test/functional/configs/replies.conf b/test/functional/configs/replies.conf
new file mode 100644
index 000000000..e4d9b34f5
--- /dev/null
+++ b/test/functional/configs/replies.conf
@@ -0,0 +1,6 @@
+.include "{= env.TESTDIR =}/../../conf/rspamd.conf"
+
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua"
+
+.include(priority=1,duplicate=merge) "{= env.TESTDIR =}/configs/merged-local.conf"
+.include(priority=2,duplicate=replace) "{= env.TESTDIR =}/configs/merged-override.conf" \ No newline at end of file
diff --git a/test/functional/messages/inc_mail_known_sender.eml b/test/functional/messages/inc_mail_known_sender.eml
new file mode 100644
index 000000000..29f4cbeb7
--- /dev/null
+++ b/test/functional/messages/inc_mail_known_sender.eml
@@ -0,0 +1,11 @@
+in-reply-to: 00020
+message-id: 000200
+From: <xxx@abrakadabra.com>
+To: <llll@abrakadabra.com>, <user@emailbl.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test
diff --git a/test/functional/messages/inc_mail_unknown_sender.eml b/test/functional/messages/inc_mail_unknown_sender.eml
new file mode 100644
index 000000000..1643e8f66
--- /dev/null
+++ b/test/functional/messages/inc_mail_unknown_sender.eml
@@ -0,0 +1,11 @@
+in-reply-to: 00020
+message-id: 000200
+From: <ffff@abrakadabra.com>
+To: <zzzz@abrakadabra.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test
diff --git a/test/functional/messages/replyto_1_1.eml b/test/functional/messages/replyto_1_1.eml
new file mode 100644
index 000000000..ff3c75417
--- /dev/null
+++ b/test/functional/messages/replyto_1_1.eml
@@ -0,0 +1,11 @@
+in-reply-to: 0002
+message-id: 00020
+From: <user@emailbl.com>
+To: <xxx@abrakadabra.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test
diff --git a/test/functional/messages/replyto_1_2.eml b/test/functional/messages/replyto_1_2.eml
new file mode 100644
index 000000000..5acbd584e
--- /dev/null
+++ b/test/functional/messages/replyto_1_2.eml
@@ -0,0 +1,11 @@
+in-reply-to: 0012
+message-id: 00120
+From: <user@emailbl.com>
+To: <xxxx@emailbl.com>, <yyyy@example.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test \ No newline at end of file
diff --git a/test/functional/messages/replyto_1_2_s.eml b/test/functional/messages/replyto_1_2_s.eml
new file mode 100644
index 000000000..11546939b
--- /dev/null
+++ b/test/functional/messages/replyto_1_2_s.eml
@@ -0,0 +1,11 @@
+in-reply-to: 0012
+message-id: 00121
+From: <user@emailbl.com>
+To: <xxxx@emailbl.com>, <llll@example.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test \ No newline at end of file
diff --git a/test/functional/messages/replyto_2_2.eml b/test/functional/messages/replyto_2_2.eml
new file mode 100644
index 000000000..de56ecbf1
--- /dev/null
+++ b/test/functional/messages/replyto_2_2.eml
@@ -0,0 +1,11 @@
+in-reply-to: 0022
+message-id: 00220
+From: <another@emailbl.com>
+To: <xxxx@emailbl.com>, <yyyy@example.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test \ No newline at end of file
diff --git a/test/functional/messages/set_replyto_1_1.eml b/test/functional/messages/set_replyto_1_1.eml
new file mode 100644
index 000000000..267d809d7
--- /dev/null
+++ b/test/functional/messages/set_replyto_1_1.eml
@@ -0,0 +1,12 @@
+in-reply-to: 0002
+message-id: 0002
+From: <xxx@abrakadabra.com>
+To: <user@emailbl.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test
+
diff --git a/test/functional/messages/set_replyto_1_2_first.eml b/test/functional/messages/set_replyto_1_2_first.eml
new file mode 100644
index 000000000..0985a2d98
--- /dev/null
+++ b/test/functional/messages/set_replyto_1_2_first.eml
@@ -0,0 +1,11 @@
+in-reply-to: 0012
+message-id: 0012
+From: <xxxx@emailbl.com>
+To: <user@emailbl.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test
diff --git a/test/functional/messages/set_replyto_2_2.eml b/test/functional/messages/set_replyto_2_2.eml
new file mode 100644
index 000000000..63e7d7a6c
--- /dev/null
+++ b/test/functional/messages/set_replyto_2_2.eml
@@ -0,0 +1,11 @@
+in-reply-to: 0022
+message-id: 0022
+From: <xxxx@emailbl.com>
+To: <another@emailbl.com>
+Subject: 06.07.2015
+Date: Mon, 6 Jul 2015 10:35:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1251"
+
+test \ No newline at end of file