*** Settings ***
-Suite Setup Generic Setup
+Suite Setup New Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Lua Setup
[Arguments] ${LUA_SCRIPT}
Set Test Variable ${LUA_SCRIPT}
- Generic Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
Lua Replace Setup
[Arguments] ${LUA_SCRIPT_UNESC}
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/multimap.conf
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml
${REDIS_SCOPE} Suite
*** Keywords ***
Multimap Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/multimap.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
Run Redis
+ New Setup REDIS_ADDR=${REDIS_ADDR} REDIS_PORT=${REDIS_PORT} URL_TLD=${URL_TLD}
Multimap Teardown
Normal Teardown
[Arguments] ${PASSWORD} ${ENABLE_PASSWORD}=nq2
Set Test Variable ${PASSWORD}
Set Test Variable ${ENABLE_PASSWORD}
- Generic Setup
+ New Setup PASSWORD=${PASSWORD} ENABLE_PASSWORD=${ENABLE_PASSWORD}
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup GetFrom Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
task:get_from('mime') - quoted in the middle of DN (inner spaces)
Scan File ${TESTDIR}/messages/from/from_quoted_dn_middle_inner.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
+
+*** Keywords ***
+GetFrom Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT}
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/mime_types.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Keywords ***
MIMETypes Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/mime_types.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
*** Settings ***
-Suite Setup MID Setup
+Suite Setup New Setup
Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/mid.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
Expect Symbol With Score MISSING_MID_ALLOWED 1.00
Do Not Expect Symbol MISSING_MID
Do Not Expect Symbol INVALID_MSGID
-
-*** Keywords ***
-MID Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/mid.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/settings.conf
${LUA_SCRIPT} ${TESTDIR}/lua/settings.lua
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${MESSAGE_PRIORITY} ${TESTDIR}/messages/priority.eml
Settings Setup
Copy File ${TESTDIR}/data/bayes.spam.sqlite3 /tmp/bayes.spam.sqlite3
Copy File ${TESTDIR}/data/bayes.ham.sqlite3 /tmp/bayes.ham.sqlite3
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/settings.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup LUA_SCRIPT=${LUA_SCRIPT}
Settings Teardown
Normal Teardown
+ Remove Files /tmp/bayes.spam.sqlite3 /tmp/bayes.ham.sqlite3
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup Composites Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Do Not Expect Symbol SYMOPTS3
Composites - Opts RE Hit 2
- Scan File ${MESSAGE} opts=foo/,sym2
+ Scan File ${MESSAGE} opts=sym2,foo/
Expect Symbol With Score SYMOPTS3 6.00
Do Not Expect Symbol SYMOPTS2
Do Not Expect Symbol SYMOPTS1
Scan File ${MESSAGE} opts=example.com->app.link
Expect Symbol With Score SYMOPTS4 6.00
Do Not Expect Symbol SYMOPTS2
- Do Not Expect Symbol SYMOPTS1
\ No newline at end of file
+ Do Not Expect Symbol SYMOPTS1
+
+*** Keywords ***
+Composites Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT}
${MESSAGE_SPAM} ${TESTDIR}/messages/spam_message.eml
${MESSAGE_HAM} ${TESTDIR}/messages/ham.eml
${REDIS_SCOPE} Suite
-${REDIS_SERVER} ${EMPTY}
+${REDIS_SERVER} null
${RSPAMD_SCOPE} Suite
-${STATS_HASH} ${EMPTY}
-${STATS_KEY} ${EMPTY}
+${STATS_BACKEND} redis
+${STATS_HASH} null
+${STATS_KEY} null
*** Keywords ***
Broken Learn Test
Do Not Expect Symbol BAYES_SPAM
Redis Statistics Setup
- ${tmpdir} = Make Temporary Directory
- Set Suite Variable ${TMPDIR} ${tmpdir}
Run Redis
- Generic Setup TMPDIR=${tmpdir}
+ New Setup STATS_BACKEND=${STATS_BACKEND} STATS_HASH=${STATS_HASH} STATS_KEY=${STATS_KEY} REDIS_SERVER=${REDIS_SERVER}
Redis Statistics Teardown
Normal Teardown
- Shutdown Process With Children ${REDIS_PID}
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
-${STATS_BACKEND} redis
-${STATS_HASH} hash = "siphash";
-${STATS_KEY} key = "${KEY_PVT1}";
+${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
+${STATS_HASH} siphash
+${STATS_KEY} ${KEY_PVT1}
*** Test Cases ***
Learn
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
-${STATS_BACKEND} redis
-${STATS_HASH} hash = "xxhash";
-${STATS_KEY} key = "${KEY_PVT1}";
+${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
+${STATS_HASH} xxhash
+${STATS_KEY} ${KEY_PVT1}
*** Test Cases ***
Learn
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
-${STATS_BACKEND} redis
-${STATS_HASH} hash = "siphash";
+${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
+${STATS_HASH} siphash
*** Test Cases ***
Learn
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
-${STATS_BACKEND} redis
-${STATS_HASH} hash = "xxhash";
+${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
+${STATS_HASH} xxhash
*** Test Cases ***
Learn
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/phishing.conf
${MESSAGE1} ${TESTDIR}/messages/phishing1.eml
${MESSAGE2} ${TESTDIR}/messages/phishing2.eml
${MESSAGE3} ${TESTDIR}/messages/phishing3.eml
*** Keywords ***
Phishing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/phishing.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dmarc.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Keywords ***
DMARC Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dmarc.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Keywords ***
DKIM Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dmarc.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Keywords ***
SPF Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dmarc.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
${FLAG1_SYMBOL} R_TEST_FUZZY_DENIED
${FLAG2_NUMBER} 51
${FLAG2_SYMBOL} R_TEST_FUZZY_WHITE
+${FUZZY_ENCRYPTED_ONLY} false
+${FUZZY_ENCRYPTION_KEY} null
+${FUZZY_KEY} null
+${FUZZY_INCLUDE} ${TESTDIR}/configs/empty.conf
+${FUZZY_SHINGLES_KEY} null
@{MESSAGES} ${TESTDIR}/messages/spam_message.eml ${TESTDIR}/messages/zip.eml
@{MESSAGES_SKIP} ${TESTDIR}/messages/priority.eml
@{RANDOM_MESSAGES} ${TESTDIR}/messages/bad_message.eml ${TESTDIR}/messages/zip-doublebad.eml
Fuzzy Setup Encrypted
[Arguments] ${algorithm}
- ${worker_settings} = Set Variable "keypair": {"pubkey": "${KEY_PUB1}", "privkey": "${KEY_PVT1}"}; "encrypted_only": true;
- ${check_settings} = Set Variable encryption_key = "${KEY_PUB1}";
- Fuzzy Setup Generic ${algorithm} ${worker_settings} ${check_settings}
+ Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${FUZZY_ENCRYPTED_ONLY} true
+ Set Suite Variable ${FUZZY_ENCRYPTION_KEY} ${KEY_PUB1}
+ Set Suite Variable ${FUZZY_INCLUDE} ${TESTDIR}/configs/fuzzy-encryption-key.conf
+ Fuzzy Setup Generic
Fuzzy Setup Encrypted Keyed
[Arguments] ${algorithm}
- ${worker_settings} = Set Variable "keypair": {"pubkey": "${KEY_PUB1}", "privkey": "${KEY_PVT1}"}; "encrypted_only": true;
- ${check_settings} = Set Variable fuzzy_key = "mYN888sydwLTfE32g2hN"; fuzzy_shingles_key = "hXUCgul9yYY3Zlk1QIT2"; encryption_key = "${KEY_PUB1}";
- Fuzzy Setup Generic ${algorithm} ${worker_settings} ${check_settings}
+ Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${FUZZY_ENCRYPTED_ONLY} true
+ Set Suite Variable ${FUZZY_ENCRYPTION_KEY} ${KEY_PUB1}
+
+ Set Suite Variable ${FUZZY_KEY} mYN888sydwLTfE32g2hN
+ Set Suite Variable ${FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
+ Fuzzy Setup Generic
Fuzzy Setup Plain
[Arguments] ${algorithm}
- Fuzzy Setup Generic ${algorithm} ${EMPTY} ${EMPTY}
+ Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Fuzzy Setup Generic
Fuzzy Setup Keyed
[Arguments] ${algorithm}
- ${check_settings} = Set Variable fuzzy_key = "mYN888sydwLTfE32g2hN"; fuzzy_shingles_key = "hXUCgul9yYY3Zlk1QIT2";
- Fuzzy Setup Generic ${algorithm} ${EMPTY} ${check_settings}
+ Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${FUZZY_KEY} mYN888sydwLTfE32g2hN
+ Set Suite Variable ${FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
+ Fuzzy Setup Generic
Fuzzy Setup Generic
- [Arguments] ${algorithm} ${worker_settings} ${check_settings} &{kwargs}
- ${worker_settings} = Set Variable backend \= "redis"; ${worker_settings}
- ${tmpdir} = Make Temporary Directory
- Set Suite Variable ${TMPDIR} ${tmpdir}
- Set Suite Variable ${SETTINGS_FUZZY_WORKER} ${worker_settings}
- Set Suite Variable ${SETTINGS_FUZZY_CHECK} ${check_settings}
Run Redis
- Generic Setup TMPDIR=${TMPDIR}
+ Generic Setup FUZZY_ALGORITHM=${FUZZY_ALGORITHM} FUZZY_ENCRYPTED_ONLY=${FUZZY_ENCRYPTED_ONLY}
+ ... FUZZY_KEY=${FUZZY_KEY} FUZZY_SHINGLES_KEY=${FUZZY_SHINGLES_KEY}
+ ... FUZZY_ENCRYPTION_KEY=${FUZZY_ENCRYPTION_KEY} FLAG1_NUMBER=${FLAG1_NUMBER}
+ ... FLAG2_NUMBER=${FLAG2_NUMBER} FUZZY_BACKEND=redis PORT_FUZZY=${PORT_FUZZY}
+ ... FUZZY_INCLUDE=${FUZZY_INCLUDE}
Fuzzy Setup Plain Fasthash
Fuzzy Setup Plain fasthash
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup JSON Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource lib.robot
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup JSON Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource lib.robot
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Keywords ***
+JSON Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
+
Stat Test
@{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /stat
Check JSON ${result}[1]
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/whitelist.conf
${M_DMARC_OK} ${TESTDIR}/messages/dmarc/pass_none.eml
${M_DMARC_BAD} ${TESTDIR}/messages/dmarc/fail_none.eml
*** Keywords ***
Whitelist Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/whitelist.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup
${lua} = Replace Variables ${lua}
Create File ${LUA_SCRIPT} ${lua}
Create File ${MAP_FILE} ${MAP1}
- Generic Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
Map Reload Teardown
Remove File ${MAP_FILE}
*** Settings ***
-Suite Setup DKIM Signing Setup
-Suite Teardown DKIM Signing Teardown
+Suite Setup New Setup
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim_signing/simple.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${result} = Scan Message With Rspamc ${MESSAGE_FAIL} -u bob@invalid.za.org
Check Rspamc ${result} DKIM-Signature: inverse=1
Should Not Contain ${result.stdout} DKIM_SIGNED
-
-*** Keywords ***
-DKIM Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/simple.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-DKIM Signing Teardown
- Normal Teardown
*** Settings ***
Suite Setup DKIM Signing Setup
-Suite Teardown DKIM Signing Teardown
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim_signing/redis.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
*** Keywords ***
DKIM Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/redis.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
Run Redis
Redis HSET TEST_DKIM_SELECTORS cacophony.za.org dkim
${key} = Get File ${TESTDIR}/configs/dkim.key
Redis HSET TEST_DKIM_KEYS dkim.cacophony.za.org ${key}
-
-DKIM Signing Teardown
- Normal Teardown
- Shutdown Process With Children ${REDIS_PID}
+ New Setup
*** Settings ***
-Suite Setup DKIM Signing Setup
-Suite Teardown DKIM Signing Teardown
+Suite Setup New Setup
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim_signing/eddsa.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${result} = Scan Message With Rspamc ${MESSAGE_FAIL} -u bob@invalid.za.org
Check Rspamc ${result} DKIM-Signature: inverse=1
Should Not Contain ${result.stdout} DKIM_SIGNED
-
-*** Keywords ***
-DKIM Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/eddsa.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-DKIM Signing Teardown
- Normal Teardown
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim_signing/invalidate.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
${key_dir} Make Temporary Directory
Set Suite Variable ${KEY_DIR} ${key_dir}
Copy File ${TESTDIR}/configs/dkim-eddsa.key ${KEY_DIR}/dkim-eddsa.key
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/invalidate.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup
Delete Key
Remove File ${KEY_DIR}/dkim-eddsa.key
*** Settings ***
-Suite Setup DKIM Signing Setup
-Suite Teardown DKIM Signing Teardown
+Suite Setup New Setup
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim_signing/multiple.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${result} = Scan Message With Rspamc ${MESSAGE} -u bob@cacophony.za.org
Check Rspamc ${result} (?s)DKIM-Signature.+DKIM-Signature re=1
Should Contain ${result.stdout} DKIM_SIGNED
-
-*** Keywords ***
-DKIM Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/multiple.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-DKIM Signing Teardown
- Normal Teardown
*** Settings ***
-Suite Setup DKIM Milter Setup
+Suite Setup New Setup
Suite Teardown Generic Teardown
Library Process
Library ${TESTDIR}/lib/rspamd.py
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
+${CONFIG} ${TESTDIR}/configs/dkim_signing/milter.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
SINGLE SIGNATURE
Milter Test dkim_many.lua
*** Keywords ***
-DKIM Milter Setup
- Generic Setup CONFIG=${TESTDIR}/configs/dkim_signing/milter.conf
-
Milter Test
[Arguments] ${mtlua}
${result} = Run Process miltertest -Dport\=${PORT_PROXY} -Dhost\=${LOCAL_ADDR} -s ${TESTDIR}/lua/miltertest/${mtlua}
*** Settings ***
-Suite Setup DKIM Signing Setup
-Suite Teardown DKIM Signing Teardown
+Suite Setup New Setup
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim_signing/sign_maps.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${result} = Scan Message With Rspamc ${MESSAGE_FAIL} -u bob@cacophony.za.org
Check Rspamc ${result} DKIM-Signature: inverse=1
Should Not Contain ${result.stdout} DKIM_SIGNED
-
-*** Keywords ***
-DKIM Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/sign_maps.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-DKIM Signing Teardown
- Normal Teardown
*** Settings ***
-Suite Setup SpamAssassin Setup
+Suite Setup New Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/spamassassin.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
Expect Symbol USER_IN_BLACKLIST_TO
Do Not Expect Symbol USER_IN_WHITELIST_TO
Do Not Expect Symbol USER_IN_WHITELIST
-
-*** Keywords ***
-SpamAssassin Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/spamassassin.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${LUA_SCRIPT} ${TESTDIR}/lua/simple.lua
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${LUA_SCRIPT} ${TESTDIR}/lua/simple.lua
+${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_SCOPE} Suite
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
HTTP PROTOCOL
*** Keywords ***
Proxy Setup
- &{d} = Run Rspamd CONFIG=${TESTDIR}/configs/lua_test.conf
- Set Suite Variable ${SLAVE_PID} ${d}[RSPAMD_PID]
- Set Suite Variable ${SLAVE_TMPDIR} ${d}[TMPDIR]
- &{d} = Run Rspamd CONFIG=${TESTDIR}/configs/proxy.conf
- Set Suite Variable ${PROXY_PID} ${d}[RSPAMD_PID]
- Set Suite Variable ${PROXY_TMPDIR} ${d}[TMPDIR]
+ # Run slave & copy variables
+ Set Suite Variable ${CONFIG} ${TESTDIR}/configs/lua_test.conf
+ New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
+ Set Suite Variable ${SLAVE_PID} ${RSPAMD_PID}
+ Set Suite Variable ${SLAVE_TMPDIR} ${TMPDIR}
+
+ # Run proxy & copy variables
+ Set Suite Variable ${CONFIG} ${TESTDIR}/configs/proxy.conf
+ New Setup
+ Set Suite Variable ${PROXY_PID} ${RSPAMD_PID}
+ Set Suite Variable ${PROXY_TMPDIR} ${TMPDIR}
Proxy Teardown
- Shutdown Process With Children ${PROXY_PID}
- Shutdown Process With Children ${SLAVE_PID}
- Cleanup Temporary Directory ${PROXY_TMPDIR}
- Cleanup Temporary Directory ${SLAVE_TMPDIR}
+ # Restore variables & run normal teardown
+ Set Suite Variable ${RSPAMD_PID} ${PROXY_PID}
+ Set Suite Variable ${TMPDIR} ${PROXY_TMPDIR}
+ Normal Teardown
+ # Do it again for slave
+ Set Suite Variable ${RSPAMD_PID} ${SLAVE_PID}
+ Set Suite Variable ${TMPDIR} ${SLAVE_TMPDIR}
+ Normal Teardown
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/antivirus.conf
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${MESSAGE2} ${TESTDIR}/messages/freemail.eml
${REDIS_SCOPE} Suite
*** Keywords ***
Antivirus Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/antivirus.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup PORT_CLAM=${PORT_CLAM} PORT_FPROT=${PORT_FPROT} PORT_AVAST=${PORT_AVAST}
+ ... PORT_FPROT2_DUPLICATE=${PORT_FPROT2_DUPLICATE}
Run Redis
Antivirus Teardown
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/p0f.conf
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${MESSAGE2} ${TESTDIR}/messages/freemail.eml
${REDIS_SCOPE} Suite
*** Keywords ***
p0f Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/p0f.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup P0F_SOCKET=${P0F_SOCKET} URL_TLD=${URL_TLD}
Run Redis
p0f Teardown
Normal Teardown
- Shutdown Process With Children ${REDIS_PID}
Shutdown p0f
Terminate All Processes kill=True
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/url_redirector.conf
${MESSAGE} ${TESTDIR}/messages/redir.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
Set Suite Variable ${REDIS_TMPDIR} ${TMPDIR}
Run Redis
Run Dummy Http
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/url_redirector.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
Urlredirector Teardown
Normal Teardown
- Shutdown Process With Children ${REDIS_PID}
#Stop Dummy Http
Terminate All Processes kill=True
- Cleanup Temporary Directory ${REDIS_TMPDIR}
Stop Dummy Http
${http_pid} = Get File /tmp/dummy_http.pid
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
+${CONFIG} ${TESTDIR}/configs/milter.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
ACCEPT
*** Keywords ***
Milter Setup
- Generic Setup CONFIG=${TESTDIR}/configs/milter.conf
+ New Setup URL_TLD=${URL_TLD}
Milter Test
[Arguments] ${mtlua}
Expect Symbol HTTP_SSL_LARGE
*** Keywords ***
-Lua Setup
- [Arguments] ${LUA_SCRIPT}
- Set Suite Variable ${LUA_SCRIPT}
- Generic Setup
-
Http Setup
Run Dummy Http
Run Dummy Https
- Lua Setup ${TESTDIR}/lua/http.lua
+ New Setup LUA_SCRIPT=${TESTDIR}/lua/http.lua URL_TLD=${URL_TLD}
Http Teardown
${http_pid} = Get File /tmp/dummy_http.pid
Servers Setup
Run Dummy Http
Run Dummy Ssl
- Lua Setup ${TESTDIR}/lua/tcp.lua
+ New Setup LUA_SCRIPT=${TESTDIR}/lua/tcp.lua URL_TLD=${URL_TLD}
Servers Teardown
${http_pid} = Get File /tmp/dummy_http.pid
*** Keywords ***
-Lua Setup
- [Arguments] ${LUA_SCRIPT}
- Set Suite Variable ${LUA_SCRIPT}
- Generic Setup
-
Http Setup
- Lua Setup ${TESTDIR}/lua/tcp.lua
+ New Setup LUA_SCRIPT=${TESTDIR}/lua/tcp.lua URL_TLD=${URL_TLD}
Http Teardown
Normal Teardown
*** Settings ***
Test Setup Redis Setup
-Test Teardown Redis Teardown
+Test Teardown Normal Teardown
Library Process
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
*** Variables ***
${REDIS_SCOPE} Test
${RSPAMD_SCOPE} Test
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/redis.conf
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
Expect Symbol With Exact Options REDIS_ASYNC201809 test value
*** Keywords ***
-Lua Setup
- [Arguments] ${LUA_SCRIPT}
- Set Suite Variable ${LUA_SCRIPT}
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/redis.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
Redis Setup
- Lua Setup ${TESTDIR}/lua/redis.lua
+ New Setup LUA_SCRIPT=${TESTDIR}/lua/redis.lua
Run Redis
-
-Redis Teardown
- Normal Teardown
- Shutdown Process With Children ${REDIS_PID}
*** Settings ***
Documentation Test the case when trying to connect to nowhere
... (i.e. redis is not running)
-Test Setup Redis Setup
-Test Teardown Redis Teardown
+Test Setup Dead Redis Setup
+Test Teardown Normal Teardown
Library Process
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
*** Variables ***
${REDIS_SCOPE} Test
${RSPAMD_SCOPE} Test
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/redis.conf
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
Expect Symbol With Exact Options REDIS_ASYNC_ERROR Connection refused
*** Keywords ***
-Lua Setup
- [Arguments] ${LUA_SCRIPT}
- Set Suite Variable ${LUA_SCRIPT}
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/redis.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-Redis Setup
- Lua Setup ${TESTDIR}/lua/redis.lua
-
-Redis Teardown
- Normal Teardown
-# Shutdown Process With Children ${REDIS_PID}
+Dead Redis Setup
+ New Setup LUA_SCRIPT=${TESTDIR}/lua/redis.lua
Generic Setup
Http Setup
- Lua Setup ${TESTDIR}/lua/dns.lua
+ New Setup LUA_SCRIPT=${TESTDIR}/lua/dns.lua URL_TLD=${URL_TLD}
Http Teardown
Normal Teardown
*** Settings ***
-Test Setup Regex Setup
-Test Teardown Regex Teardown
+Test Setup New Setup
+Test Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/regexp.conf
${MESSAGE} ${TESTDIR}/messages/newlines.eml
${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
Expect Symbol With Option FOUND_URL https://google.com/maps/
Expect Symbol With Option FOUND_URL https://www.google.com/search?q\=hello world&oq\=hello world&aqs\=chrome..69i57j0l5.3045j0j7&sourceid\=chrome&ie\=UTF-8
Expect Symbol With Option FOUND_URL https://github.com/google/sanitizers/wiki/AddressSanitizer
-
-
-*** Keywords ***
-Regex Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/regexp.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-Regex Teardown
- Normal Teardown
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/selector.conf
${MESSAGE} ${TESTDIR}/messages/subject1.eml
${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${RSPAMD_SCOPE} Test
+${RSPAMD_SCOPE} Suite
*** Test Cases ***
*** Keywords ***
Regex Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/selector.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
Regex Teardown
Normal Teardown
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/regexp.conf
${MESSAGE} ${TESTDIR}/messages/newlines.eml
${MESSAGE1} ${TESTDIR}/messages/fws_fn.eml
${MESSAGE2} ${TESTDIR}/messages/fws_fp.eml
*** Keywords ***
Rules Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/regexp.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
Rules Teardown
Normal Teardown
*** Settings ***
-Suite Setup Fnames Setup
-Suite Teardown Fnames Teardown
+Suite Setup FNames Setup
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
Expect Symbol With Option TEST_FNAME [삼성생명]2020.08.14 데일리 경제뉴스.pdf
Expect Symbol With Option TEST_FNAME 01029_402110_10620_RGT06902_PRT180ML_20200803_101820.pdf
-
-*** Keywords ***
-Fnames Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/regexp.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-Fnames Teardown
- Normal Teardown
- Terminate All Processes kill=True
+*** Keyword ***
+FNames Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT}
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/greylist.conf
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
*** Keywords ***
Greylist Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/greylist.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
Run Redis
Greylist Teardown
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/rbl.conf
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Keywords ***
Rbl Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/rbl.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
Rbl Teardown
Normal Teardown
Expect Symbol With Exact Options UDP_FAIL read timeout
*** Keywords ***
-Lua Setup
- [Arguments] ${LUA_SCRIPT}
- Set Suite Variable ${LUA_SCRIPT}
- Generic Setup
-
UDP Setup
Run Dummy UDP
- Lua Setup ${TESTDIR}/lua/udp.lua
+ New Setup LUA_SCRIPT=${TESTDIR}/lua/udp.lua URL_TLD=${URL_TLD}
UDP Teardown
${udp_pid} = Get File /tmp/dummy_udp.pid
*** Settings ***
-Suite Setup ARC Signing Setup
-Suite Teardown ARC Signing Teardown
+Suite Setup New Setup
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/arc_signing/simple.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
TEST NOT SIGNED - USERNAME WRONG PUBKEY
${result} = Scan Message With Rspamc ${MESSAGE_FAIL} -u bob@invalid.za.org
Should Not Contain ${result.stdout} ARC_SIGNED
-
-*** Keywords ***
-ARC Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/arc_signing/simple.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-ARC Signing Teardown
- Normal Teardown
*** Settings ***
Suite Setup ARC Signing Setup
-Suite Teardown ARC Signing Teardown
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/arc_signing/redis.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
*** Keywords ***
ARC Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/arc_signing/redis.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
Run Redis
Redis HSET TEST_DKIM_SELECTORS cacophony.za.org arc
${key} = Get File ${TESTDIR}/configs/dkim.key
Redis HSET TEST_DKIM_KEYS arc.cacophony.za.org ${key}
-
-ARC Signing Teardown
- Normal Teardown
- Shutdown Process With Children ${REDIS_PID}
+ New Setup
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/arc.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Keywords ***
ARC Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/arc.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
*** Settings ***
Suite Setup Neural Setup
-Suite Teardown Neural Teardown
+Suite Teardown Normal Teardown
Library Process
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
*** Keywords ***
Neural Setup
- ${TMPDIR} = Make Temporary Directory
- Set Suite Variable ${TMPDIR}
Run Redis
- Generic Setup
-
-Neural Teardown
- Shutdown Process With Children ${REDIS_PID}
- Normal Teardown
+ New Setup URL_TLD=${URL_TLD}
*** Settings ***
Suite Setup Neural Setup
-Suite Teardown Neural Teardown
+Suite Teardown Normal Teardown
Library Process
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
*** Keywords ***
Neural Setup
- ${TMPDIR} = Make Temporary Directory
- Set Suite Variable ${TMPDIR}
Run Redis
- Generic Setup
-
-Neural Teardown
- Shutdown Process With Children ${REDIS_PID}
- Normal Teardown
+ New Setup URL_TLD=${URL_TLD}
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/surbl.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Keywords ***
Surbl Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/surbl.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
Surbl Teardown
Normal Teardown
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup Magic Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
*** Test Cases ***
Magic detections bundle 1
Scan File ${TESTDIR}/messages/gargantua.eml
- Expect Symbol MAGIC_SYM_ZIP_2
- Expect Symbol MAGIC_SYM_RAR_3
- Expect Symbol MAGIC_SYM_EXE_4
- Expect Symbol MAGIC_SYM_ELF_5
- Expect Symbol MAGIC_SYM_LNK_6
- Expect Symbol MAGIC_SYM_CLASS_7
- Expect Symbol MAGIC_SYM_RTF_8
- Expect Symbol MAGIC_SYM_PDF_9
- Expect Symbol MAGIC_SYM_PS_10
- Expect Symbol MAGIC_SYM_CHM_11
- Expect Symbol MAGIC_SYM_DJVU_12
- Expect Symbol MAGIC_SYM_ARJ_13
- Expect Symbol MAGIC_SYM_CAB_14
- Expect Symbol MAGIC_SYM_ACE_15
- Expect Symbol MAGIC_SYM_TAR_16
- Expect Symbol MAGIC_SYM_BZ2_17
- Expect Symbol MAGIC_SYM_XZ_18
- Expect Symbol MAGIC_SYM_LZ4_19
- Expect Symbol MAGIC_SYM_ZST_20
- Expect Symbol MAGIC_SYM_DMG_21
- Expect Symbol MAGIC_SYM_ISO_22
- Expect Symbol MAGIC_SYM_ZOO_23
- Expect Symbol MAGIC_SYM_EPUB_24
- Expect Symbol MAGIC_SYM_XAR_25
- Expect Symbol MAGIC_SYM_PSD_26
- Expect Symbol MAGIC_SYM_PCX_27
- Expect Symbol MAGIC_SYM_TIFF_28
- Expect Symbol MAGIC_SYM_ICO_29
- Expect Symbol MAGIC_SYM_SWF_30
- Expect Symbol MAGIC_SYM_DOC_31
- Expect Symbol MAGIC_SYM_XLS_32
- Expect Symbol MAGIC_SYM_PPT_33
- Expect Symbol MAGIC_SYM_MSI_34
- Expect Symbol MAGIC_SYM_MSG_35
- Expect Symbol MAGIC_SYM_DOCX_36
- Expect Symbol MAGIC_SYM_XLSX_37
- Expect Symbol MAGIC_SYM_PPTX_38
- Expect Symbol MAGIC_SYM_ODT_39
- Expect Symbol MAGIC_SYM_ODS_40
- Expect Symbol MAGIC_SYM_ODP_41
- Expect Symbol MAGIC_SYM_7Z_42
- Expect Symbol MAGIC_SYM_VSD_43
- Expect Symbol MAGIC_SYM_PNG_44
- Expect Symbol MAGIC_SYM_JPG_45
- Expect Symbol MAGIC_SYM_GIF_46
- Expect Symbol MAGIC_SYM_BMP_47
- Expect Symbol MAGIC_SYM_TXT_48
- Expect Symbol MAGIC_SYM_HTML_49
- Expect Symbol MAGIC_SYM_CSV_50
- Expect Symbol MAGIC_SYM_DWG_51
- Expect Symbol MAGIC_SYM_JAR_52
- Expect Symbol MAGIC_SYM_APK_53
- Expect Symbol MAGIC_SYM_BAT_54
- Expect Symbol MAGIC_SYM_ICS_55
- Expect Symbol MAGIC_SYM_VCF_56
+ Expect Symbols MAGIC_SYM_ZIP_2
+ ... MAGIC_SYM_RAR_3
+ ... MAGIC_SYM_EXE_4
+ ... MAGIC_SYM_ELF_5
+ ... MAGIC_SYM_LNK_6
+ ... MAGIC_SYM_CLASS_7
+ ... MAGIC_SYM_RTF_8
+ ... MAGIC_SYM_PDF_9
+ ... MAGIC_SYM_PS_10
+ ... MAGIC_SYM_CHM_11
+ ... MAGIC_SYM_DJVU_12
+ ... MAGIC_SYM_ARJ_13
+ ... MAGIC_SYM_CAB_14
+ ... MAGIC_SYM_ACE_15
+ ... MAGIC_SYM_TAR_16
+ ... MAGIC_SYM_BZ2_17
+ ... MAGIC_SYM_XZ_18
+ ... MAGIC_SYM_LZ4_19
+ ... MAGIC_SYM_ZST_20
+ ... MAGIC_SYM_DMG_21
+ ... MAGIC_SYM_ISO_22
+ ... MAGIC_SYM_ZOO_23
+ ... MAGIC_SYM_EPUB_24
+ ... MAGIC_SYM_XAR_25
+ ... MAGIC_SYM_PSD_26
+ ... MAGIC_SYM_PCX_27
+ ... MAGIC_SYM_TIFF_28
+ ... MAGIC_SYM_ICO_29
+ ... MAGIC_SYM_SWF_30
+ ... MAGIC_SYM_DOC_31
+ ... MAGIC_SYM_XLS_32
+ ... MAGIC_SYM_PPT_33
+ ... MAGIC_SYM_MSI_34
+ ... MAGIC_SYM_MSG_35
+ ... MAGIC_SYM_DOCX_36
+ ... MAGIC_SYM_XLSX_37
+ ... MAGIC_SYM_PPTX_38
+ ... MAGIC_SYM_ODT_39
+ ... MAGIC_SYM_ODS_40
+ ... MAGIC_SYM_ODP_41
+ ... MAGIC_SYM_7Z_42
+ ... MAGIC_SYM_VSD_43
+ ... MAGIC_SYM_PNG_44
+ ... MAGIC_SYM_JPG_45
+ ... MAGIC_SYM_GIF_46
+ ... MAGIC_SYM_BMP_47
+ ... MAGIC_SYM_TXT_48
+ ... MAGIC_SYM_HTML_49
+ ... MAGIC_SYM_CSV_50
+ ... MAGIC_SYM_DWG_51
+ ... MAGIC_SYM_JAR_52
+ ... MAGIC_SYM_APK_53
+ ... MAGIC_SYM_BAT_54
+ ... MAGIC_SYM_ICS_55
+ ... MAGIC_SYM_VCF_56
+*** Keywords ***
+Magic Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT}
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/force_actions.conf
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
${MESSAGE} ${TESTDIR}/messages/url7.eml
${RSPAMD_SCOPE} Suite
*** Keywords ***
Force Actions Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/force_actions.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup
Force Actions Teardown
Normal Teardown
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
}
antivirus {
clam {
attachments_only = false;
symbol = "CLAM_VIRUS";
type = "clamav";
- servers = "127.0.0.1:${PORT_CLAM}";
+ servers = "127.0.0.1:{= env.PORT_CLAM =}";
}
fprot {
attachments_only = false;
symbol = "FPROT_VIRUS";
type = "fprot";
- servers = "127.0.0.1:${PORT_FPROT}";
+ servers = "127.0.0.1:{= env.PORT_FPROT =}";
patterns {
FPROT_EICAR = "^EICAR_Test_File$";
}
attachments_only = false;
symbol = "FPROT2_VIRUS_DUPLICATE_DEFAULT";
type = "fprot";
- servers = "127.0.0.1:${PORT_FPROT2_DUPLICATE}";
+ servers = "127.0.0.1:{= env.PORT_FPROT2_DUPLICATE =}";
patterns = [
{FPROT2_VIRUS_DUPLICATE_PATTERN = "^E"},
{FPROT2_VIRUS_DUPLICATE_NOPE1 = "^EI",
attachments_only = false;
symbol = "AVAST_VIRUS";
type = "avast";
- servers = "127.0.0.1:${PORT_AVAST}";
+ servers = "127.0.0.1:{= env.PORT_AVAST =}";
}
}
-arc { }
\ No newline at end of file
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
+arc { }
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
arc {
use_redis = true;
key_prefix = "TEST_DKIM_KEYS";
selector_prefix = "TEST_DKIM_SELECTORS";
}
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
arc {
- path = "${TESTDIR}/configs/dkim.key";
+ path = "{= env.TESTDIR =}/configs/dkim.key";
check_pubkey = true;
allow_pubkey_mismatch = false;
selector = "dkim";
options = {
- pidfile = "${TMPDIR}/rspamd.pid"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
}
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
-lua = ${LUA_SCRIPT};
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+lua = {= env.LUA_SCRIPT =};
composites {
EXPRESSIONS {
score = 6.0;
}
SYMOPTS3 {
- expression = 'OPTS[sym2,/FoO\\//i]';
+ expression = 'OPTS[sym2,/FoO\//i]';
score = 6.0;
}
SYMOPTS4 {
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
options = {
filters = ["dkim"]
- pidfile = "${TMPDIR}/rspamd.pid"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
dns {
retransmits = 10;
timeout = 2s;
- fake_records = [{ # ed25519
- name = "test._domainkey.example.com";
- type = txt;
- replies = ["k=ed25519; p=yi50DjK5O9pqbFpNHklsv9lqaS0ArSYu02qp1S0DW1Y="];
- },
- {
- name = "brisbane._domainkey.football.example.com";
- type = txt;
- replies = ["v=DKIM1; k=ed25519; p=11qYAYKxCrfVS/7TyWQHOg7hcvPapiMlrwIaaPcHURo="];
- },
- {
- name = "test._domainkey.football.example.com";
- type = txt;
- replies = ["v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkHlOQoBTzWRiGs5V6NpP3idY6Wk08a5qhdR6wy5bdOKb2jLQiY/J16JYi0Qvx/byYzCNb3W91y3FutACDfzwQ/BC/e/8uBsCR+yz1Lxj+PL6lHvqMKrM3rG4hstT5QjvHO9PzoxZyVYLzBfO2EeC3Ip3G+2kryOTIKT+l/K4w3QIDAQAB"],
- },
- {
- name = "dkim._domainkey.cacophony.za.org",
- type = "txt";
- replies = ["v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXtxBE5IiNRMcq2/lc2zErfdCvDFyQNBnMjbOjBQrPST2k4fdGbtpe5Iu5uS01Met+dAEf94XL8I0hwmYw+n70PP834zfJGi2egwGqrakpaWsCDPvIJZLkxJCJKQRA/zrQ622uEXdvYixVbsEGVw7U4wAGSmT5rU2eU1y63AlOlQIDAQAB"];
- }];
}
}
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
metric = {
name = "default",
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
keypair {
- pubkey = "${KEY_PUB1}";
- privkey = "${KEY_PVT1}";
+ pubkey = "{= env.KEY_PUB1 =}";
+ privkey = "{= env.KEY_PVT1 =}";
}
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
dkim {
local dodkim = task:get_request_header('dodkim')
if not dodkim then return end
return {
- key = "${TESTDIR}/configs/dkim.key",
+ key = "{= env.TESTDIR =}/configs/dkim.key",
domain = "cacophony.za.org",
selector = "dkim"
}
skip_multi = false;
}
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "{= env.TESTDIR =}/../../src/plugins/lua/"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
dkim_signing {
- path = "${TESTDIR}/configs/dkim-eddsa.key";
+ path = "{= env.TESTDIR =}/configs/dkim-eddsa.key";
selector = "eddsa";
check_pubkey = true;
allow_pubkey_mismatch = false;
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
dkim_signing {
- path = "${KEY_DIR}/dkim-eddsa.key";
+ path = "{= env.KEY_DIR =}/dkim-eddsa.key";
selector = "eddsa";
check_pubkey = true;
allow_pubkey_mismatch = false;
options = {
filters = ["dkim"]
- url_tld = "${URL_TLD}"
- pidfile = "${TMPDIR}/rspamd.pid"
- lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua"
+ url_tld = "{= env.URL_TLD =}"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
+ lua_path = "{= env.INSTALLROOT =}/share/rspamd/lib/?.lua"
dns {
nameserver = ["8.8.8.8", "8.8.4.4"];
retransmits = 10;
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
metric = {
name = "default",
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
worker {
type = "rspamd_proxy";
timeout = 120;
upstream {
local {
- hosts = "${LOCAL_ADDR}:${PORT_NORMAL}";
+ hosts = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}";
default = true;
}
}
- bind_socket = "${LOCAL_ADDR}:${PORT_PROXY}";
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_PROXY =}";
milter = true;
}
dkim_signing {
domain {
cacophony.za.org {
selectors = {
- path: "${TESTDIR}/configs/dkim.key";
+ path: "{= env.TESTDIR =}/configs/dkim.key";
selector: "dkim";
}
selectors = {
- path: "${TESTDIR}/configs/dkim-eddsa.key";
+ path: "{= env.TESTDIR =}/configs/dkim-eddsa.key";
selector: "eddsa";
}
}
invalid.za.org {
selectors = [
- { path: "${TESTDIR}/configs/dkim-eddsa.key";
+ { path: "{= env.TESTDIR =}/configs/dkim-eddsa.key";
selector: "eddsa"; }
]
}
allow_pubkey_mismatch: true;
}
modules {
- path = "${TESTDIR}/../../src/plugins/lua/dkim_signing.lua"
+ path = "{= env.TESTDIR =}/../../src/plugins/lua/dkim_signing.lua"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
-lua = "${INSTALLROOT}/share/rspamd/rules/rspamd.lua"
-lua = "${TESTDIR}/lua/params.lua"
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+lua = "{= env.INSTALLROOT =}/share/rspamd/rules/rspamd.lua"
+lua = "{= env.TESTDIR =}/lua/params.lua"
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
dkim_signing {
domain {
cacophony.za.org {
selectors = {
- path: "${TESTDIR}/configs/dkim.key";
+ path: "{= env.TESTDIR =}/configs/dkim.key";
selector: "dkim";
}
selectors = {
- path: "${TESTDIR}/configs/dkim-eddsa.key";
+ path: "{= env.TESTDIR =}/configs/dkim-eddsa.key";
selector: "eddsa";
}
}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
dkim_signing {
use_redis = true;
key_prefix = "TEST_DKIM_KEYS";
selector_prefix = "TEST_DKIM_SELECTORS";
}
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
dkim_signing {
signing_table = [
"*@cacophony.za.org cacophony.za.org",
key_table = [
"cacophony.za.org %:eddsa:m5kGxtckRfsNe5EuYTe7bvkDjSh7LXaX3aXyIMPGLR0=",
];
-}
\ No newline at end of file
+}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
dkim_signing {
- path = "${TESTDIR}/configs/dkim.key";
+ path = "{= env.TESTDIR =}/configs/dkim.key";
check_pubkey = true;
allow_pubkey_mismatch = false;
use_http_headers = true;
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
dmarc { }
spf {
external_relay = [
- "${TESTDIR}/configs/maps/external_relay_ip.list",
+ "{= env.TESTDIR =}/configs/maps/external_relay_ip.list",
];
-}
\ No newline at end of file
+}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
force_actions {
rules {
FORCE_REJECT_TO_ADD_HEADER {
}
}
}
-}
\ No newline at end of file
+}
--- /dev/null
+# Setting this to null does not work out so it's hidden in an include
+encryption_key = {= env.FUZZY_ENCRYPTION_KEY =};
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
options = {
filters = "fuzzy_check";
- pidfile = "${TMPDIR}/rspamd.pid";
- control_socket = "${TMPDIR}/rspamd.sock mode=0600";
- url_tld = "${TESTDIR}/../lua/unit/test_tld.dat";
+ pidfile = "{= env.TMPDIR =}/rspamd.pid";
+ control_socket = "{= env.TMPDIR =}/rspamd.sock mode=0600";
+ url_tld = "{= env.TESTDIR =}/../lua/unit/test_tld.dat";
dns {
retransmits = 10;
timeout = 2s;
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
metric = {
name = "default",
unknown_weight = 1
symbol {
weight = 10.0;
- name = "${FLAG1_SYMBOL}";
+ name = "{= env.FLAG1_SYMBOL =}";
}
symbol {
weight = -1.0;
- name = "${FLAG2_SYMBOL}";
+ name = "{= env.FLAG2_SYMBOL =}";
}
}
worker {
type = normal
- bind_socket = "${LOCAL_ADDR}:${PORT_NORMAL}";
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}";
count = 1
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = "${LOCAL_ADDR}:${PORT_CONTROLLER}";
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}";
count = 1
- secure_ip = ["${LOCAL_ADDR}"];
- stats_path = "${TMPDIR}/stats.ucl";
+ secure_ip = ["{= env.LOCAL_ADDR =}"];
+ stats_path = "{= env.TMPDIR =}/stats.ucl";
}
worker {
count = 1;
- bind_socket = "${LOCAL_ADDR}:${PORT_FUZZY}";
+ backend = "{= env.FUZZY_BACKEND =}";
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_FUZZY =}";
type = "fuzzy";
- hashfile = "${TMPDIR}/fuzzy.db";
- allow_update = ["${LOCAL_ADDR}"];
-${SETTINGS_FUZZY_WORKER}
+ hashfile = "{= env.TMPDIR =}/fuzzy.db";
+ allow_update = ["{= env.LOCAL_ADDR =}"];
+ encrypted_only = {= env.FUZZY_ENCRYPTED_ONLY =};
+ keypair {
+ privkey = "{= env.KEY_PVT1 =}";
+ pubkey = "{= env.KEY_PUB1 =}";
+ }
}
fuzzy_check {
rule {
min_bytes = 0;
min_length = 0;
- algorithm = "${ALGORITHM}";
- servers = "${LOCAL_ADDR}:${PORT_FUZZY}";
+ algorithm = "{= env.FUZZY_ALGORITHM =}";
+ servers = "{= env.LOCAL_ADDR =}:{= env.PORT_FUZZY =}";
symbol = "R_TEST_FUZZY";
max_score = 10.0;
mime_types = ["application/*"];
read_only = false;
skip_unknown = true;
- skip_hashes = "${TMPDIR}/skip_hash.map";
-${SETTINGS_FUZZY_CHECK}
+ skip_hashes = "{= env.TMPDIR =}/skip_hash.map";
+ fuzzy_key = {= env.FUZZY_KEY =};
+ fuzzy_shingles_key = {= env.FUZZY_SHINGLES_KEY =};
+.include "{= env.FUZZY_INCLUDE =}";
fuzzy_map = {
- ${FLAG1_SYMBOL} {
+ R_TEST_FUZZY_DENIED {
max_score = 10.0;
- flag = ${FLAG1_NUMBER};
+ flag = {= env.FLAG1_NUMBER =};
}
- ${FLAG2_SYMBOL} {
+ R_TEST_FUZZY_WHITE {
max_score = 1.0;
- flag = ${FLAG2_NUMBER};
+ flag = {= env.FLAG2_NUMBER =};
}
}
}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
}
greylist {
check_local = true;
options = {
- pidfile = "${TMPDIR}/rspamd.pid"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
}
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
-lua = ${LUA_SCRIPT};
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+lua = "{= env.LUA_SCRIPT =}";
options = {
filters = ["spf", "dkim", "regexp"]
- url_tld = "${URL_TLD}"
- pidfile = "${TMPDIR}/rspamd.pid"
- map_watch_interval = ${MAP_WATCH_INTERVAL};
+ url_tld = "{= env.URL_TLD =}"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
+ map_watch_interval = {= env.MAP_WATCH_INTERVAL =};
dns {
retransmits = 10;
timeout = 2s;
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
log_usec = true;
}
metric = {
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
task_timeout = 10s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
-lua = ${LUA_SCRIPT};
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+lua = "{= env.LUA_SCRIPT =}";
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
mid = {
source = {
url = [
"https://maps.rspamd.com/rspamd/mid.inc.zst",
- "fallback+file://${TESTDIR}/../../../conf/mid.inc",
- "file://${TESTDIR}/configs/maps/mid.list"
+ "fallback+file://{= env.TESTDIR =}/../../../conf/mid.inc",
+ "file://{= env.TESTDIR =}/configs/maps/mid.list"
];
}
}
options = {
filters = ["spf", "dkim", "regexp"]
- url_tld = "${URL_TLD}"
- pidfile = "${TMPDIR}/rspamd.pid"
- lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua";
+ url_tld = "{= env.URL_TLD =}"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
+ lua_path = "{= env.INSTALLROOT =}/share/rspamd/lib/?.lua";
enable_test_patterns = true;
dns {
nameserver = ["8.8.8.8", "8.8.4.4"];
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
metric = {
name = "default",
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
worker {
type = "rspamd_proxy";
timeout = 120;
upstream {
local {
- hosts = "${LOCAL_ADDR}:${PORT_NORMAL}";
+ hosts = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}";
default = true;
}
}
- bind_socket = "${LOCAL_ADDR}:${PORT_PROXY}";
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_PROXY =}";
milter = true;
}
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "{= env.TESTDIR =}/../../src/plugins/lua/"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
-lua = "${INSTALLROOT}/share/rspamd/rules/rspamd.lua"
-lua = "${TESTDIR}/lua/params.lua"
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+lua = "{= env.INSTALLROOT =}/share/rspamd/rules/rspamd.lua"
+lua = "{= env.TESTDIR =}/lua/params.lua"
milter_headers {
extended_spam_headers = true;
skip_local = false;
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
mime_types {
file = [
"https://maps.rspamd.com/rspamd/mime_types.inc.zst",
- "fallback+file://${TESTDIR}/../../../conf/mime_types.inc"
+ "fallback+file://{= env.TESTDIR =}/../../../conf/mime_types.inc"
];
extension_map {
html = "text/html";
"application/pdf",
]
}
- filename_whitelist = "${TESTDIR}/configs/maps/mime_types.wl";
+ filename_whitelist = "{= env.TESTDIR =}/configs/maps/mime_types.wl";
}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
asn {
}
spf {}
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
expand_keys = true;
}
multimap {
}
IP_MAP {
type = "ip";
- map = "${TESTDIR}/configs/maps/ip.list";
+ map = "{= env.TESTDIR =}/configs/maps/ip.list";
}
FROM_MAP {
type = "from";
filter = "email:domain";
- map = "${TESTDIR}/configs/maps/domains.list";
+ map = "{= env.TESTDIR =}/configs/maps/domains.list";
}
FREEMAIL_CC {
type = "header";
header = "Cc";
filter = "email:domain";
- map = "${TESTDIR}/configs/maps/domains.list.2";
+ map = "{= env.TESTDIR =}/configs/maps/domains.list.2";
score = 1.0;
}
REGEXP_MAP {
type = "from";
filter = "email:addr";
regexp = true;
- map = "${TESTDIR}/configs/maps/regexp.list";
+ map = "{= env.TESTDIR =}/configs/maps/regexp.list";
}
DEPS_MAP {
type = "from";
filter = "email:addr";
regexp = true;
- map = "${TESTDIR}/configs/maps/regexp.list";
+ map = "{= env.TESTDIR =}/configs/maps/regexp.list";
require_symbols = "(R_SPF_ALLOW|R_SPF_DNSFAIL) & REGEXP_MAP & !FROM_MAP";
}
RCPT_DOMAIN {
type = "rcpt";
filter = "email:domain";
- map = "${TESTDIR}/configs/maps/domains.list";
+ map = "{= env.TESTDIR =}/configs/maps/domains.list";
}
RCPT_USER {
type = "rcpt";
filter = "email:user";
- map = "${TESTDIR}/configs/maps/users.list";
+ map = "{= env.TESTDIR =}/configs/maps/users.list";
}
RCPT_MAP {
type = "rcpt";
filter = "email:addr";
symbols = ["SYM1"];
- map = "${TESTDIR}/configs/maps/multiple.list";
+ map = "{= env.TESTDIR =}/configs/maps/multiple.list";
score = 1.0;
}
RCPT_MAP_NOMULTISYM {
type = "rcpt";
filter = "email:addr";
disable_multisymbol = true;
- map = "${TESTDIR}/configs/maps/multiple.list";
+ map = "{= env.TESTDIR =}/configs/maps/multiple.list";
score = 1.0;
}
HEADER_MAP {
type = "header";
header = "To";
filter = "email:name";
- map = "${TESTDIR}/configs/maps/utf.list";
+ map = "{= env.TESTDIR =}/configs/maps/utf.list";
regexp = true;
}
HOSTNAME_MAP {
type = "hostname";
- map = "${TESTDIR}/configs/maps/domains.list";
+ map = "{= env.TESTDIR =}/configs/maps/domains.list";
}
HOSTNAME_TOP_MAP {
type = "hostname";
filter = "top";
- map = "${TESTDIR}/configs/maps/top.list";
+ map = "{= env.TESTDIR =}/configs/maps/top.list";
}
CDB_HOSTNAME {
type = "hostname";
- map = "cdb://${TESTDIR}/configs/maps/domains.cdb";
+ map = "cdb://{= env.TESTDIR =}/configs/maps/domains.cdb";
}
REDIS_HOSTNAME {
type = "hostname";
}
REDIS_HOSTNAME_EXPANSION {
type = "hostname";
- map = "redis://\${ip}.\${principal_recipient_domain}";
+ map = "redis://${ip}.${principal_recipient_domain}";
}
REDIS_IPADDR {
type = "ip";
RCVD_TEST_01 {
type = "received";
max_pos = 1;
- map = "${TESTDIR}/configs/maps/rcvd.list";
+ map = "{= env.TESTDIR =}/configs/maps/rcvd.list";
}
RCVD_TEST_02 {
type = "received";
min_pos = -1;
- map = "${TESTDIR}/configs/maps/rcvd.list";
+ map = "{= env.TESTDIR =}/configs/maps/rcvd.list";
}
RCVD_TEST_REDIS_01 {
type = "received";
}
RCVD_AUTHED_ONE {
type = "received";
- map = "${TESTDIR}/configs/maps/rcvd2.list";
+ map = "{= env.TESTDIR =}/configs/maps/rcvd2.list";
flags = ["authenticated"];
nflags = ["ssl"];
}
RCVD_AUTHED_TWO {
type = "received";
- map = "${TESTDIR}/configs/maps/rcvd2.list";
+ map = "{= env.TESTDIR =}/configs/maps/rcvd2.list";
flags = ["authenticated", "ssl"];
}
COMBINED_MAP_AND {
rules {
ip = {
type = "radix";
- map = "${TESTDIR}/configs/maps/ip.list";
+ map = "{= env.TESTDIR =}/configs/maps/ip.list";
selector = "ip";
}
from {
- map = "${TESTDIR}/configs/maps/domains.list";
+ map = "{= env.TESTDIR =}/configs/maps/domains.list";
selector = "from:domain";
}
}
rules {
ip = {
type = "radix";
- map = "${TESTDIR}/configs/maps/ip.list";
+ map = "{= env.TESTDIR =}/configs/maps/ip.list";
selector = "ip";
}
from {
- map = "${TESTDIR}/configs/maps/domains.list";
+ map = "{= env.TESTDIR =}/configs/maps/domains.list";
selector = "from:domain";
}
}
options = {
- url_tld = "${URL_TLD}"
- pidfile = "${TMPDIR}/rspamd.pid"
- lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua"
+ url_tld = "{= env.URL_TLD =}"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
+ lua_path = "{= env.INSTALLROOT =}/share/rspamd/lib/?.lua"
filters = [];
explicit_modules = ["settings"];
}
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
log_usec = true;
}
metric = {
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
task_timeout = 10s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "{= env.TESTDIR =}/../../src/plugins/lua/"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
neural {
rules {
}
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
expand_keys = true;
}
-lua = "${TESTDIR}/lua/neural.lua";
\ No newline at end of file
+lua = "{= env.TESTDIR =}/lua/neural.lua";
options = {
- url_tld = "${URL_TLD}"
- pidfile = "${TMPDIR}/rspamd.pid"
- lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua"
+ url_tld = "{= env.URL_TLD =}"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
+ lua_path = "{= env.INSTALLROOT =}/share/rspamd/lib/?.lua"
filters = [];
explicit_modules = ["settings"];
}
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
log_usec = true;
}
metric = {
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
task_timeout = 10s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "{= env.TESTDIR =}/../../src/plugins/lua/"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
neural {
rules {
}
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
expand_keys = true;
}
-lua = "${TESTDIR}/lua/neural.lua";
+lua = "{= env.TESTDIR =}/lua/neural.lua";
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
}
p0f {
- socket = "${P0F_SOCKET}";
+ socket = "{= env.P0F_SOCKET =}";
patterns {
WINDOWS = '^Windows.*';
ETHER = '^Ethernet.*';
options = {
filters = ["spf", "dkim", "regexp"]
- url_tld = "${TESTDIR}/../lua/unit/test_tld.dat"
- pidfile = "${TMPDIR}/rspamd.pid"
+ url_tld = "{= env.TESTDIR =}/../lua/unit/test_tld.dat"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
dns {
retransmits = 10;
timeout = 2s;
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
metric = {
name = "default",
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
keypair {
- pubkey = "${KEY_PUB1}";
- privkey = "${KEY_PVT1}";
+ pubkey = "{= env.KEY_PUB1 =}";
+ privkey = "{= env.KEY_PVT1 =}";
}
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
keypair {
- pubkey = "${KEY_PUB1}";
- privkey = "${KEY_PVT1}";
+ pubkey = "{= env.KEY_PUB1 =}";
+ privkey = "{= env.KEY_PVT1 =}";
}
- password = ${PASSWORD};
- enable_password = ${ENABLE_PASSWORD};
- stats_path = "${TMPDIR}/stats.ucl";
+ password = {= env.PASSWORD =};
+ enable_password = {= env.ENABLE_PASSWORD =};
+ stats_path = "{= env.TMPDIR =}/stats.ucl";
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
phishing {
symbol = "PHISHING";
strict_domains = {
STRICT_PHISHING = [
- "${TESTDIR}/configs/maps/strict.phishing",
+ "{= env.TESTDIR =}/configs/maps/strict.phishing",
];
STRICTER_PHISHING = [
- "${TESTDIR}/configs/maps/stricter.phishing"
+ "{= env.TESTDIR =}/configs/maps/stricter.phishing"
]
}
}
options = {
filters = [ "dkim", "regexp"]
- url_tld = "${URL_TLD}"
- pidfile = "${TMPDIR}/rspamd.pid"
- lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua"
+ url_tld = "{= env.URL_TLD =}"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
+ lua_path = "{= env.INSTALLROOT =}/share/rspamd/lib/?.lua"
explicit_modules = ["settings", "bayes_expiry"];
dns {
nameserver = ["8.8.8.8", "8.8.4.4"];
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
log_usec = true;
}
metric = {
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
task_timeout = 10s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "{= env.TESTDIR =}/../../src/plugins/lua/"
}
spf {}
-lua = "${TESTDIR}/lua/test_coverage.lua";
-lua = "${INSTALLROOT}/share/rspamd/rules/rspamd.lua"
-${PLUGIN_CONFIG}
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+lua = "{= env.INSTALLROOT =}/share/rspamd/rules/rspamd.lua";
options = {
filters = ["spf", "dkim", "regexp"]
- url_tld = "${URL_TLD}"
- pidfile = "${TMPDIR}/rspamd.pid"
- lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua"
+ url_tld = "{= env.URL_TLD =}"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
+ lua_path = "{= env.INSTALLROOT =}/share/rspamd/lib/?.lua"
dns {
nameserver = ["8.8.8.8", "8.8.4.4"];
retransmits = 10;
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
worker "rspamd_proxy" {
- bind_socket = "${LOCAL_ADDR}:${PORT_PROXY}";
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_PROXY =}";
upstream {
- name = "${LOCAL_ADDR}";
+ name = "{= env.LOCAL_ADDR =}";
default = yes;
- hosts = "${LOCAL_ADDR}:${PORT_NORMAL}";
+ hosts = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}";
}
count = 1;
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
rbl {
rbls {
fake {
}
RSPAMD_EMAILBL {
rbl = "test8.uribl";
- url_compose_map = "${TESTDIR}/configs/maps/url_compose_map_for_mails.list";
+ url_compose_map = "{= env.TESTDIR =}/configs/maps/url_compose_map_for_mails.list";
ignore_defaults = true;
emails = true;
emails_domainonly = true
-lua = ${LUA_SCRIPT};
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
+lua = "{= env.LUA_SCRIPT =}";
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
expand_keys = true;
}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
regexp {
SA_BODY_WORD_BOUNDARY_ON_NEWLINE {
- re = '/\\bhello\\s/{sa_body}',
+ re = '/\bhello\s/{sa_body}',
score = 0.0,
description = 'Test if word boundary works correctly on sa_body regexes',
group = 'body',
group = 'body',
}
SA_BODY_WORD_WITH_SPACE_BOUNDARIES {
- re = '/\\bhello world\\b/{sa_body}',
+ re = '/\bhello world\b/{sa_body}',
score = 0.0,
description = 'Test if regex matches word separated with newline (should work - newline is replaced with space)',
group = 'body',
}
SA_BODY_WORD_WITH_SPACE_BOUNDARIES_2 {
- re = '/\\shello\\sworld\\s/{sa_body}',
+ re = '/\shello\sworld\s/{sa_body}',
score = 0.0,
description = 'Test if regex matches word separated with newline (should work - newline is replaced with space)',
group = 'body',
}
SA_BODY_WORD_WITH_SPACE_BOUNDARIES_3 {
- re = '/\\shello\\sworld\\sthis\\s/{sa_body}',
+ re = '/\shello\sworld\sthis\s/{sa_body}',
score = 0.0,
description = 'Test if regex matches word separated with newline (should work - newline is replaced with space)',
group = 'body',
}
SA_BODY_WORD_WITH_SPACE_AND_DOT {
- re = '/\\bword\\.\\sagain\\b/{sa_body}',
+ re = '/\bword\.\sagain\b/{sa_body}',
score = 0.0,
description = 'Test if regex matches word separated with newline (should work - newline is replaced with space)',
group = 'body',
}
options {
- dynamic_conf = "${TESTDIR}/configs/dynamic.conf";
+ dynamic_conf = "{= env.TESTDIR =}/configs/dynamic.conf";
}
dmarc { }
spf { }
dkim { }
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "{= env.TESTDIR =}/../../src/plugins/lua/"
}
-lua = "${TESTDIR}/lua/regex_test.lua"
+lua = "{= env.TESTDIR =}/lua/regex_test.lua"
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
regexp {
CONFIG_SELECTOR_RE_RCPT_SUBJECT {
re = 'test=/test@user.com some subject/$',
}
}
-lua = "${TESTDIR}/lua/selector_test.lua"
+lua = "{= env.TESTDIR =}/lua/selector_test.lua"
-lua = ${LUA_SCRIPT};
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
+lua = "{= env.LUA_SCRIPT =}";
settings {
id_test {
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
spamassassin {
- rules = "${TESTDIR}/configs/spamassassin.rules"
+ rules = "{= env.TESTDIR =}/configs/spamassassin.rules"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
-lua = "${TESTDIR}/lua/simple.lua"
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
+lua = "{= env.TESTDIR =}/lua/simple.lua"
options = {
filters = ["spf", "dkim", "regexp"]
- url_tld = "${TESTDIR}/../lua/unit/test_tld.dat"
- pidfile = "${TMPDIR}/rspamd.pid"
+ url_tld = "{= env.TESTDIR =}/../lua/unit/test_tld.dat"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid"
dns {
retransmits = 10;
timeout = 2s;
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "{= env.TMPDIR =}/rspamd.log"
}
metric = {
name = "default",
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
keypair {
- pubkey = "${KEY_PUB1}";
- privkey = "${KEY_PVT1}";
+ pubkey = "{= env.KEY_PUB1 =}";
+ privkey = "{= env.KEY_PVT1 =}";
}
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
keypair {
- pubkey = "${KEY_PUB1}";
- privkey = "${KEY_PVT1}";
+ pubkey = "{= env.KEY_PUB1 =}";
+ privkey = "{= env.KEY_PVT1 =}";
}
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl";
+ stats_path = "{= env.TMPDIR =}/stats.ucl";
}
classifier {
languages_enabled = true;
tokenizer {
name = "osb";
- ${STATS_HASH}
- ${STATS_KEY}
+ hash = {= env.STATS_HASH =};
+ key = {= env.STATS_KEY =};
}
- backend = ${STATS_BACKEND}
+ backend = "{= env.STATS_BACKEND =}";
statfile {
spam = true;
symbol = BAYES_SPAM;
size = 1M;
- ${REDIS_SERVER}
+ server = {= env.REDIS_SERVER =}
}
statfile {
spam = false;
symbol = BAYES_HAM;
size = 1M;
- ${REDIS_SERVER}
+ server = {= env.REDIS_SERVER =}
}
cache {
- ${REDIS_SERVER}
+ server = {= env.REDIS_SERVER =}
}
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
+lua = "{= env.TESTDIR =}/lua/test_coverage.lua";
settings {}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
surbl {
"whitelist" = [
"rspamd-test.com"
}
"BAD_SUBDOMAIN" {
suffix = "test7.uribl";
- url_compose_map = "${TESTDIR}/configs/maps/url_compose_map.list";
+ url_compose_map = "{= env.TESTDIR =}/configs/maps/url_compose_map.list";
check_dkim = true;
check_emails = false;
}
replyto = true;
}
}
-}
\ No newline at end of file
+}
options = {
filters = ["spf", "dkim", "regexp"]
- url_tld = "${TESTDIR}/../lua/unit/test_tld.dat"
- pidfile = "${TMPDIR}/rspamd.pid";
- lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua";
+ url_tld = "{= env.TESTDIR =}/../lua/unit/test_tld.dat"
+ pidfile = "{= env.TMPDIR =}/rspamd.pid";
+ lua_path = "{= env.INSTALLROOT =}/share/rspamd/lib/?.lua";
dns {
nameserver = ["8.8.8.8", "8.8.4.4"];
retransmits = 10;
log_urls = true;
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log";
+ filename = "{= env.TMPDIR =}/rspamd.log";
log_usec = true;
}
metric = {
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_NORMAL =}"
count = 1
keypair {
- pubkey = "${KEY_PUB1}";
- privkey = "${KEY_PVT1}";
+ pubkey = "{= env.KEY_PUB1 =}";
+ privkey = "{= env.KEY_PVT1 =}";
}
task_timeout = 10s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = "{= env.LOCAL_ADDR =}:{= env.PORT_CONTROLLER =}"
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "{= env.TMPDIR =}/stats.ucl"
}
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "{= env.TESTDIR =}/../../src/plugins/lua/"
}
-lua = "${INSTALLROOT}/share/rspamd/rules/rspamd.lua"
+lua = "{= env.INSTALLROOT =}/share/rspamd/rules/rspamd.lua"
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
}
url_redirector {
- redirector_hosts_map = "${TESTDIR}/configs/maps/redir.map";
+ redirector_hosts_map = "{= env.TESTDIR =}/configs/maps/redir.map";
}
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"
+
dmarc {}
spf {}
whitelist {
valid_dmarc = true;
valid_spf = true;
domains = [
- "${TESTDIR}/configs/maps/domains.list",
+ "{= env.TESTDIR =}/configs/maps/domains.list",
];
score = -3.0;
inverse_symbol = "BLACKLIST_DDS";
"WHITELIST_DKIM" = {
valid_dkim = true;
domains = [
- "${TESTDIR}/configs/maps/domains.list",
+ "{= env.TESTDIR =}/configs/maps/domains.list",
];
description = "Mail comes from the whitelisted domain and has a valid DKIM signature";
score = -1.0;
"WHITELIST_SPF" = {
valid_spf = true;
domains = [
- "${TESTDIR}/configs/maps/domains.list",
+ "{= env.TESTDIR =}/configs/maps/domains.list",
];
score = -1.0
inverse_multiplier = 3.0
valid_spf = true;
valid_dkim = true;
domains = [
- "${TESTDIR}/configs/maps/domains.list"
+ "{= env.TESTDIR =}/configs/maps/domains.list"
];
score = -3.0;
description = "Mail comes from the whitelisted domain and has a valid SPF policy and valid DKIM signature";
valid_dmarc = true;
valid_dkim = true;
domains = [
- "${TESTDIR}/configs/maps/domains.list",
+ "{= env.TESTDIR =}/configs/maps/domains.list",
];
score = -2.0;
description = "Mail comes from the whitelisted domain and has valid DMARC and DKIM policies";
"WHITELIST_DMARC" = {
valid_dmarc = true;
domains = [
- "${TESTDIR}/configs/maps/domains.list",
+ "{= env.TESTDIR =}/configs/maps/domains.list",
];
score = -2.0;
description = "Mail comes from the whitelisted domain and has valid DMARC policy";
strict = true;
valid_dmarc = true;
domains = [
- "${TESTDIR}/configs/maps/domains.list",
+ "{= env.TESTDIR =}/configs/maps/domains.list",
];
score = -3.0;
}
END
Generic Setup
- [Arguments] @{vargs} &{kwargs}
- &{d} = Run Rspamd @{vargs} &{kwargs}
- ${keys} = Get Dictionary Keys ${d}
- FOR ${i} IN @{keys}
- Run Keyword If '${RSPAMD_SCOPE}' == 'Suite' Set Suite Variable ${${i}} ${d}[${i}]
- ... ELSE IF '${RSPAMD_SCOPE}' == 'Test' Set Test Variable ${${i}} ${d}[${i}]
- ... ELSE Fail 'RSPAMD_SCOPE must be Test or Suite'
- END
+ [Arguments] &{kw}
+ New Setup &{kw}
Expect Action
[Arguments] ${action}
Should Be Equal As Numbers ${SCAN_RESULT}[symbols][${symbol}][score] ${score}
... msg="Symbol ${symbol} has score of ${SCAN_RESULT}[symbols][${symbol}][score] but expected ${score}"
+Expect Symbols
+ [Arguments] @{symbols}
+ FOR ${symbol} IN @{symbols}
+ Dictionary Should Contain Key ${SCAN_RESULT}[symbols] ${symbol}
+ ... msg=Symbol ${symbol} wasn't found in result
+ END
+
Expect Symbols With Scores
[Arguments] &{symscores}
FOR ${key} ${value} IN &{symscores}
Expect Symbol With Exact Options ${symbol} @{options}
Expect Symbol With Score ${symbol} ${score}
+Export Scoped Variables
+ [Arguments] ${scope} &{vars}
+ FOR ${k} ${v} IN &{vars}
+ Run Keyword If '${scope}' == 'Test' Set Test Variable ${${k}} ${v}
+ ... ELSE IF '${scope}' == 'Suite' Set Suite Variable ${${k}} ${v}
+ ... ELSE IF '${scope}' == 'Global' Set Global Variable ${${k}} ${v}
+ ... ELSE Fail message="Don't know what to do with scope: ${scope}"
+ END
+
Generic Teardown
+ # Robot Framework 4.0
+ #Run Keyword If '${CONTROLLER_ERRORS}' == 'True' Run Keyword And Warn On Failure Check Controller Errors
Run Keyword If '${CONTROLLER_ERRORS}' == 'True' Check Controller Errors
Shutdown Process With Children ${RSPAMD_PID}
Save Run Results ${TMPDIR} rspamd.conf rspamd.log redis.log clickhouse-config.xml
Collect Lua Coverage
Cleanup Temporary Directory ${TMPDIR}
+ # Possibly deal with Redis
+ ${redis_tmpdir} = Get Variable Value ${REDIS_TMPDIR}
+ Run Keyword If '${redis_tmpdir}' != 'None' Cleanup Temporary Directory ${REDIS_TMPDIR}
+ ${redis_pid} = Get Variable Value ${REDIS_PID}
+ Run Keyword If '${redis_pid}' == 'None' Return From Keyword
+ Shutdown Process With Children ${redis_pid}
+
Log does not contain segfault record
${log} = Get File ${TMPDIR}/rspamd.log encoding_errors=ignore
Should not contain ${log} Segmentation fault: msg=Segmentation fault detected
+New Setup
+ [Arguments] &{kw}
+
+ # Create and chown temporary directory
+ ${TMPDIR} = Make Temporary Directory
+ Set Directory Ownership ${TMPDIR} ${RSPAMD_USER} ${RSPAMD_GROUP}
+
+ # Export ${TMPDIR} to appropriate scope according to ${RSPAMD_SCOPE}
+ Export Scoped Variables ${RSPAMD_SCOPE} TMPDIR=${TMPDIR}
+
+ # Set additional values to ${kw} that are expected to be available everywhere
+ Set To Dictionary ${kw} LOCAL_ADDR=${LOCAL_ADDR} PORT_NORMAL=${PORT_NORMAL}
+ ... KEY_PUB1=${KEY_PUB1} KEY_PVT1=${KEY_PVT1} PORT_CONTROLLER=${PORT_CONTROLLER}
+ ... TESTDIR=${TESTDIR} INSTALLROOT=${INSTALLROOT} TMPDIR=${TMPDIR}
+ ... MAP_WATCH_INTERVAL=${MAP_WATCH_INTERVAL} PORT_PROXY=${PORT_PROXY}
+
+ New Run Rspamd &{kw}
+
Normal Teardown
Generic Teardown
Should Be Equal As Integers ${result.rc} 0
Run Redis
+ ${TMPDIR} = Make Temporary Directory
${template} = Get File ${TESTDIR}/configs/redis-server.conf
${config} = Replace Variables ${template}
Create File ${TMPDIR}/redis-server.conf ${config}
Wait Until Keyword Succeeds 5x 1 sec Check Pidfile ${TMPDIR}/redis.pid timeout=0.5s
Wait Until Keyword Succeeds 5x 1 sec Redis Check ${REDIS_ADDR} ${REDIS_PORT}
${REDIS_PID} = Get File ${TMPDIR}/redis.pid
- Run Keyword If '${REDIS_SCOPE}' == 'Test' Set Test Variable ${REDIS_PID}
- ... ELSE IF '${REDIS_SCOPE}' == 'Suite' Set Suite Variable ${REDIS_PID}
+ ${REDIS_PID} = Convert To Number ${REDIS_PID}
+ Export Scoped Variables ${REDIS_SCOPE} REDIS_PID=${REDIS_PID} REDIS_TMPDIR=${TMPDIR}
${redis_log} = Get File ${TMPDIR}/redis.log
Log ${redis_log}
+Run Rspamd
+ [Arguments] &{kwargs}
+ New Run Rspamd &{kwargs}
+
Run Nginx
${template} = Get File ${TESTDIR}/configs/nginx.conf
${config} = Replace Variables ${template}
Log ${result.stdout}
[Return] ${result}
-Run Rspamd
- [Arguments] @{vargs} &{kwargs}
- ${has_CONFIG} = Evaluate 'CONFIG' in $kwargs
- ${has_TMPDIR} = Evaluate 'TMPDIR' in $kwargs
- ${CONFIG} = Set Variable If '${has_CONFIG}' == 'True' ${kwargs}[CONFIG] ${CONFIG}
- &{d} = Create Dictionary
- ${tmpdir} = Run Keyword If '${has_TMPDIR}' == 'True' Set Variable ${kwargs}[TMPDIR]
- ... ELSE Make Temporary Directory
- Set Directory Ownership ${tmpdir} ${RSPAMD_USER} ${RSPAMD_GROUP}
- ${template} = Get File ${CONFIG}
- # TODO: stop using this; we have Lupa now
- FOR ${i} IN @{vargs}
- ${newvalue} = Replace Variables ${${i}}
- Set To Dictionary ${d} ${i}=${newvalue}
+New Run Rspamd
+ [Arguments] &{kwargs}
+
+ # Set each kwarg to environment variable prefixed with RSPAMD_
+ FOR ${k} ${v} IN &{kwargs}
+ Set Environment Variable RSPAMD_${k} ${v}
END
- ${config} = Replace Variables ${template}
- ${config} = Replace Variables ${config}
- Log ${config}
- Create File ${tmpdir}/rspamd.conf ${config}
+
+ # Dump templated config or errors to log
+ ${result} = Run Process ${RSPAMADM} configdump -c ${CONFIG}
+ # We need to send output to files (or discard output) to avoid hanging Robot
+ ... stdout=${TMPDIR}/configdump.stdout stderr=${TMPDIR}/configdump.stderr
+ ${configdump} = Run Keyword If ${result.rc} == 0 Get File ${TMPDIR}/configdump.stdout
+ ... ELSE Get File ${TMPDIR}/configdump.stderr
+ Log ${configdump}
+
+ # Fix directory ownership (maybe do this somewhere else)
+ Set Directory Ownership ${TMPDIR} ${RSPAMD_USER} ${RSPAMD_GROUP}
+
+ # Run Rspamd
${result} = Run Process ${RSPAMD} -u ${RSPAMD_USER} -g ${RSPAMD_GROUP}
- ... -c ${tmpdir}/rspamd.conf env:TMPDIR=${tmpdir} env:DBDIR=${tmpdir} env:LD_LIBRARY_PATH=${TESTDIR}/../../contrib/aho-corasick
- ... env:RSPAMD_INSTALLROOT=${INSTALLROOT} stdout=DEVNULL stderr=DEVNULL
- Run Keyword If ${result.rc} != 0 Log ${result.stderr}
+ ... -c ${CONFIG} env:TMPDIR=${TMPDIR} env:DBDIR=${TMPDIR} env:LD_LIBRARY_PATH=${TESTDIR}/../../contrib/aho-corasick
+ ... env:RSPAMD_INSTALLROOT=${INSTALLROOT} env:RSPAMD_TMPDIR=${TMPDIR} env:RSPAMD_TESTDIR=${TESTDIR}
+ # We need to send output to files (or discard output) to avoid hanging Robot
+ ... stdout=${TMPDIR}/rspamd.stdout stderr=${TMPDIR}/rspamd.stderr
+
+ # Abort if it failed
Should Be Equal As Integers ${result.rc} 0
- Wait Until Keyword Succeeds 10x 1 sec Check Pidfile ${tmpdir}/rspamd.pid timeout=0.5s
+
+ # Wait for pid file to be written
+ Wait Until Keyword Succeeds 10x 1 sec Check Pidfile ${TMPDIR}/rspamd.pid timeout=0.5s
+
+ # Confirm worker is reachable
Wait Until Keyword Succeeds 5x 1 sec Ping Rspamd ${LOCAL_ADDR} ${PORT_NORMAL}
- ${rspamd_pid} = Get File ${tmpdir}/rspamd.pid
- Set To Dictionary ${d} RSPAMD_PID=${rspamd_pid} TMPDIR=${tmpdir}
- [Return] &{d}
+
+ # Read PID from PIDfile and export it to appropriate scope as ${RSPAMD_PID}
+ ${RSPAMD_PID} = Get File ${TMPDIR}/rspamd.pid
+ Export Scoped Variables ${RSPAMD_SCOPE} RSPAMD_PID=${RSPAMD_PID}
Simple Teardown
Generic Teardown