aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/cases/340_surbl.robot
blob: 58be332f8279285905b658feb9446a6d2690d081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
*** Settings ***
Suite Setup     Surbl Setup
Suite Teardown  Surbl Teardown
Library         ${TESTDIR}/lib/rspamd.py
Resource        ${TESTDIR}/lib/rspamd.robot
Variables       ${TESTDIR}/lib/vars.py

*** Variables ***
${CONFIG}       ${TESTDIR}/configs/plugins.conf
${RSPAMD_SCOPE}  Suite
${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat

*** Test Cases ***
SURBL Example.com domain
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/url4.eml
  Should Contain  ${result.stdout}  RSPAMD_URIBL
  Should Contain  ${result.stdout}  DBL_SPAM
  Should Not Contain  ${result.stdout}  DBL_PHISH
  Should Not Contain  ${result.stdout}  URIBL_BLACK

SURBL Example.net domain
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/url5.eml
  Should Contain  ${result.stdout}  DBL_PHISH
  Should Not Contain  ${result.stdout}  DBL_SPAM
  Should Not Contain  ${result.stdout}  RSPAMD_URIBL
  Should Not Contain  ${result.stdout}  URIBL_BLACK

SURBL Example.org domain
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/url6.eml
  Should Contain  ${result.stdout}  URIBL_BLACK
  Should Not Contain  ${result.stdout}  DBL_SPAM
  Should Not Contain  ${result.stdout}  RSPAMD_URIBL
  Should Not Contain  ${result.stdout}  DBL_PHISH

SURBL Example.ru domain
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/url7.eml
  Should Contain  ${result.stdout}  URIBL_GREY
  Should Contain  ${result.stdout}  URIBL_RED
  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.ru ZEN domain
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/url7.eml
  Should Contain  ${result.stdout}  URIBL_SBL_CSS (
  Should Contain  ${result.stdout}  URIBL_XBL (
  Should Contain  ${result.stdout}  URIBL_PBL (
  Should Not Contain  ${result.stdout}  URIBL_SBL (
  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 domain image false
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/urlimage.eml
  Should Contain  ${result.stdout}  RSPAMD_URIBL_IMAGES
  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
  ${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 (

*** Keywords ***
Surbl Setup
  ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/surbl.conf
  Set Suite Variable  ${PLUGIN_CONFIG}
  Generic Setup  PLUGIN_CONFIG

Surbl Teardown
  Normal Teardown
  Terminate All Processes    kill=True