aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/cases/280_rules.robot
blob: aed23a1e7bb1a6e4c075165a19ef3a308037780b (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
81
82
83
84
85
86
87
*** Settings ***
Test Setup      Rules Setup
Test Teardown   Rules Teardown
Library         ${TESTDIR}/lib/rspamd.py
Resource        ${TESTDIR}/lib/rspamd.robot
Variables       ${TESTDIR}/lib/vars.py

*** Variables ***
${CONFIG}        ${TESTDIR}/configs/plugins.conf
${MESSAGE}       ${TESTDIR}/messages/newlines.eml
${MESSAGE1}      ${TESTDIR}/messages/fws_fn.eml
${MESSAGE2}      ${TESTDIR}/messages/fws_fp.eml
${MESSAGE3}      ${TESTDIR}/messages/fws_tp.eml
${MESSAGE4}      ${TESTDIR}/messages/broken_richtext.eml
${MESSAGE5}      ${TESTDIR}/messages/badboundary.eml
${MESSAGE6}      ${TESTDIR}/messages/pdf_encrypted.eml
${MESSAGE7}      ${TESTDIR}/messages/pdf_js.eml
${MESSAGE8}      ${TESTDIR}/messages/yand_forward.eml
${URL_TLD}       ${TESTDIR}/../lua/unit/test_tld.dat
${RSPAMD_SCOPE}  Test


*** Test Cases ***
Broken MIME
  ${result} =  Scan Message With Rspamc  ${MESSAGE3}
  Check Rspamc  ${result}  MISSING_SUBJECT

Issue 2584
  ${result} =  Scan Message With Rspamc  ${MESSAGE1}
  Check Rspamc  ${result}  BROKEN_CONTENT_TYPE  inverse=1
  Should Not Contain  ${result.stdout}  MISSING_SUBJECT
  Should Not Contain  ${result.stdout}  R_MISSING_CHARSET

Issue 2349
  ${result} =  Scan Message With Rspamc  ${MESSAGE2}
  Check Rspamc  ${result}  MULTIPLE_UNIQUE_HEADERS  inverse=1

Broken Rich Text
  ${result} =  Scan Message With Rspamc  ${MESSAGE4}
  Check Rspamc  ${result}  BROKEN_CONTENT_TYPE

Dynamic Config
  ${result} =  Scan Message With Rspamc  ${MESSAGE}
  Check Rspamc  ${result}  SA_BODY_WORD (10
  Check Rspamc  ${result}  \/ 20

Broken boundary
  ${result} =  Scan Message With Rspamc  ${MESSAGE4}
  Check Rspamc  ${result}  BROKEN_CONTENT_TYPE

PDF encrypted
  ${result} =  Scan Message With Rspamc  ${MESSAGE6}
  Check Rspamc  ${result}  PDF_ENCRYPTED

PDF javascript
  ${result} =  Scan Message With Rspamc  ${MESSAGE7}
  Check Rspamc  ${result}  PDF_JAVASCRIPT

BITCOIN ADDR
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/btc.eml
  Should Contain  ${result.stdout}  BITCOIN_ADDR

RCVD_COUNT_ONE
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/btc.eml
  Should Contain  ${result.stdout}  RCVD_COUNT_ONE

RCVD_COUNT_FIVE
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/yand_forward.eml
  Should Contain  ${result.stdout}  RCVD_COUNT_FIVE

RCVD_COUNT_SEVEN
  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/rcvd7.eml
  Should Contain  ${result.stdout}  RCVD_COUNT_SEVEN

FROM_NEQ_ENVFROM
  ${result} =  Scan Message With Rspamc  ${MESSAGE8}  --from  test@test.net
  Check Rspamc  ${result}  FROM_NEQ_ENVFROM


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

Rules Teardown
  Normal Teardown