From 9a77fefe6512423df49bc47292994b0ed13cac4c Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Sun, 22 Sep 2019 22:07:25 +0300 Subject: [PATCH] [Test] EMAIL BL --- test/functional/cases/340_surbl.robot | 16 ++++++++++++++++ test/functional/configs/plugins.conf | 10 ++++++++++ test/functional/configs/surbl.conf | 16 ++++++++++++++++ test/functional/messages/emailbltext.eml | 4 ++++ test/functional/messages/replyto.eml | 5 +++++ test/functional/messages/replyto2.eml | 5 +++++ 6 files changed, 56 insertions(+) create mode 100644 test/functional/messages/emailbltext.eml create mode 100644 test/functional/messages/replyto.eml create mode 100644 test/functional/messages/replyto2.eml diff --git a/test/functional/cases/340_surbl.robot b/test/functional/cases/340_surbl.robot index 4e1558ecd..87d02dd29 100644 --- a/test/functional/cases/340_surbl.robot +++ b/test/functional/cases/340_surbl.robot @@ -98,6 +98,22 @@ WHITELIST Should Not Contain ${result.stdout} DBL_SPAM ( Should Not Contain ${result.stdout} RSPAMD_URIBL_IMAGES ( +EMAILBL full adress & domain only + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/emailbltext.eml + Should Contain ${result.stdout} RSPAMD_EMAILBL_FULL ( + Should Contain ${result.stdout} RSPAMD_EMAILBL_DOMAINONLY ( + +EMAILBL REPLY TO full adress + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/replyto.eml + Should Contain ${result.stdout} RSPAMD_EMAILBL_FULL ( + Should Not Contain ${result.stdout} RSPAMD_EMAILBL_DOMAINONLY ( + +EMAILBL REPLY TO domain only + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/replyto2.eml + Should Contain ${result.stdout} RSPAMD_EMAILBL_DOMAINONLY ( + Should Not Contain ${result.stdout} RSPAMD_EMAILBL_FULL ( + + *** Keywords *** Surbl Setup ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/surbl.conf diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf index cb5d50609..bb4b97e1d 100644 --- a/test/functional/configs/plugins.conf +++ b/test/functional/configs/plugins.conf @@ -539,6 +539,16 @@ options = { type = a; replies = ["127.0.0.2"]; }, + { + name = "user.emailbl.com.test5.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, + { + name = "baddomain.com.test6.uribl"; + type = a; + replies = ["127.0.0.2"]; + }, { name = "example.com.test2.uribl"; type = a; diff --git a/test/functional/configs/surbl.conf b/test/functional/configs/surbl.conf index a4f22bb9f..823aec25c 100644 --- a/test/functional/configs/surbl.conf +++ b/test/functional/configs/surbl.conf @@ -64,5 +64,21 @@ EOD; end EOD; } + "RSPAMD_EMAILBL_FULL" { + suffix = "test5.uribl"; + check_emails = true; + emails_domainonly = false; + urls = false; + replyto = true; + images = false; + } + "RSPAMD_EMAILBL_DOMAINONLY" { + suffix = "test6.uribl"; + check_emails = true; + emails_domainonly = true; + urls = false; + replyto = true; + images = false; + } } } \ No newline at end of file diff --git a/test/functional/messages/emailbltext.eml b/test/functional/messages/emailbltext.eml new file mode 100644 index 000000000..6ae877d59 --- /dev/null +++ b/test/functional/messages/emailbltext.eml @@ -0,0 +1,4 @@ +Content-Type: text/plain + +user@emailbl.com +user@baddomain.com \ No newline at end of file diff --git a/test/functional/messages/replyto.eml b/test/functional/messages/replyto.eml new file mode 100644 index 000000000..234bc59e0 --- /dev/null +++ b/test/functional/messages/replyto.eml @@ -0,0 +1,5 @@ +Reply-to: user@emailbl.com +From: xxx@abrakadabra.com +Content-Type: text/plain + +salkdmaslkd \ No newline at end of file diff --git a/test/functional/messages/replyto2.eml b/test/functional/messages/replyto2.eml new file mode 100644 index 000000000..2813f03cd --- /dev/null +++ b/test/functional/messages/replyto2.eml @@ -0,0 +1,5 @@ +Reply-to: user@baddomain.com +From: xxx@abrakadabra.com +Content-Type: text/plain + +salkdmaslkd \ No newline at end of file -- 2.39.5