Skip to content

Commit

Permalink
Merge pull request #3023 from korgoth1/master
Browse files Browse the repository at this point in the history
[Test] Uribl in mail address
  • Loading branch information
vstakhov committed Aug 30, 2019
2 parents 2f98824 + b8f697f commit 0c9d6fa
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
18 changes: 18 additions & 0 deletions test/functional/cases/340_surbl.robot
Expand Up @@ -60,6 +60,24 @@ SURBL Example.com domain image false
Should Not Contain ${result.stdout} DBL_PHISH (
Should Not Contain ${result.stdout} URIBL_BLACK (

SURBL @example.com mail html
${result} = Scan Message With Rspamc ${TESTDIR}/messages/mailadr.eml
Should Contain ${result.stdout} URIBL_IN_MAIL (
Should Not Contain ${result.stdout} RSPAMD_URIBL
Should Not Contain ${result.stdout} DBL_SPAM (
Should Not Contain ${result.stdout} RSPAMD_URIBL (
Should Not Contain ${result.stdout} DBL_PHISH (
Should Not Contain ${result.stdout} URIBL_BLACK (

SURBL @example.com mail text
${result} = Scan Message With Rspamc ${TESTDIR}/messages/mailadr2.eml
Should Contain ${result.stdout} URIBL_IN_MAIL (
Should Not Contain ${result.stdout} RSPAMD_URIBL
Should Not Contain ${result.stdout} DBL_SPAM (
Should Not Contain ${result.stdout} RSPAMD_URIBL (
Should Not Contain ${result.stdout} DBL_PHISH (
Should Not Contain ${result.stdout} URIBL_BLACK (

*** Keywords ***
Surbl Setup
${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/surbl.conf
Expand Down
5 changes: 5 additions & 0 deletions test/functional/configs/plugins.conf
Expand Up @@ -544,6 +544,11 @@ options = {
type = a;
replies = ["127.0.1.2"];
},
{
name = "user.example.com.test2.uribl";
type = a;
replies = ["127.0.1.5"];
},
{
name = "example.net.test2.uribl";
type = a;
Expand Down
10 changes: 9 additions & 1 deletion test/functional/configs/surbl.conf
@@ -1,4 +1,3 @@

surbl {
rules {
"RSPAMD_URIBL" {
Expand Down Expand Up @@ -64,5 +63,14 @@ EOD;
end
EOD;
}
"URIBL_IN_MAIL" {
suffix = "test2.uribl";
no_ip = true;
check_emails = true;

ips = {
URIBL_IN_MAIL = "127.0.1.5";
}
}
}
}
4 changes: 4 additions & 0 deletions test/functional/messages/mailadr.eml
@@ -0,0 +1,4 @@
Content-Type: text/html

helo
<a href="mailto:user@example.com">Send email</a>
4 changes: 4 additions & 0 deletions test/functional/messages/mailadr2.eml
@@ -0,0 +1,4 @@
Content-Type: text/plain

hello
user@example.com

0 comments on commit 0c9d6fa

Please sign in to comment.