| 1 |
*** Settings *** |
| 2 |
Library ${RSPAMD_TESTDIR}/lib/rspamd.py |
| 3 |
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot |
| 4 |
Variables ${RSPAMD_TESTDIR}/lib/vars.py |
| 5 |
|
| 6 |
*** Variables *** |
| 7 |
${GTUBE} ${RSPAMD_TESTDIR}/messages/gtube.eml |
| 8 |
${ALT_RELATED} ${RSPAMD_TESTDIR}/messages/alternative-related.eml |
| 9 |
${MIXED_RELATED_HTML} ${RSPAMD_TESTDIR}/messages/mixed-related-html-only.eml |
| 10 |
${SETTINGS_NOSYMBOLS} {symbols_enabled = []} |
| 11 |
|
| 12 |
*** Test Cases *** |
| 13 |
GTUBE via checkv3 |
| 14 |
[Documentation] Basic /checkv3 scan, expect GTUBE symbol |
| 15 |
Scan File V3 ${GTUBE} Settings=${SETTINGS_NOSYMBOLS} |
| 16 |
Expect Symbol GTUBE |
| 17 |
|
| 18 |
checkv3 with metadata from and rcpt |
| 19 |
[Documentation] Set from and rcpt in metadata JSON, verify they are applied |
| 20 |
&{meta} = Create Dictionary [email protected] [email protected] |
| 21 |
Scan File V3 ${GTUBE} metadata=${meta} Settings=${SETTINGS_NOSYMBOLS} |
| 22 |
Expect Symbol GTUBE |
| 23 |
|
| 24 |
checkv3 with settings_id |
| 25 |
[Documentation] Pass settings_id in metadata, verify settings are applied |
| 26 |
&{meta} = Create Dictionary settings_id=id_test |
| 27 |
Scan File V3 ${GTUBE} metadata=${meta} |
| 28 |
Expect Symbol GTUBE |
| 29 |
|
| 30 |
checkv3 missing metadata part |
| 31 |
[Documentation] Send only message part without metadata, expect HTTP 500 (400 error mapped to 5xx) |
| 32 |
${status} = Scan File V3 Single Part message test message body |
| 33 |
Should Be Equal As Integers ${status} 500 |
| 34 |
|
| 35 |
checkv3 missing message part |
| 36 |
[Documentation] Send only metadata part without message, expect HTTP 500 (400 error mapped to 5xx) |
| 37 |
${status} = Scan File V3 Single Part metadata {} application/json |
| 38 |
Should Be Equal As Integers ${status} 500 |
| 39 |
|
| 40 |
checkv3 multipart/alternative MIME message |
| 41 |
[Documentation] Message with own MIME boundaries (multipart/alternative) must parse correctly |
| 42 |
Scan File V3 ${ALT_RELATED} |
| 43 |
... Settings={symbols_enabled = [R_PARTS_DIFFER]} |
| 44 |
Expect Symbol R_PARTS_DIFFER |
| 45 |
|
| 46 |
checkv3 multipart/mixed MIME message |
| 47 |
[Documentation] Message with multipart/mixed MIME structure and attachments |
| 48 |
Scan File V3 ${MIXED_RELATED_HTML} |
| 49 |
... Settings={symbols_enabled = [MIME_HTML_ONLY]} |
| 50 |
Expect Symbol MIME_HTML_ONLY |
| 51 |
|
| 52 |
checkv3 malformed boundary |
| 53 |
[Documentation] Send body with wrong boundary, expect HTTP 500 (400 error mapped to 5xx) |
| 54 |
Scan File V3 Expect Error ${GTUBE} 500 |
| 55 |
... content_type_override=multipart/form-data; boundary=wrong-boundary-does-not-match |
| 56 |
|
| 57 |
checkv3 via rspamc with zstd compression |
| 58 |
[Documentation] Scan via rspamc --protocol-v3 (zstd compression enabled by default) |
| 59 |
${result} = Run Rspamc -p -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL} --protocol-v3 |
| 60 |
... --settings=${SETTINGS_NOSYMBOLS} ${GTUBE} |
| 61 |
Check Rspamc ${result} GTUBE ( |
| 62 |
|
| 63 |
checkv3 via rspamc encrypted |
| 64 |
[Documentation] Scan via rspamc --protocol-v3 with httpcrypt encryption |
| 65 |
${result} = Run Rspamc -p -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL} --protocol-v3 |
| 66 |
... --key ${RSPAMD_KEY_PUB1} --settings=${SETTINGS_NOSYMBOLS} ${GTUBE} |
| 67 |
Check Rspamc ${result} GTUBE ( |
| 68 |
|
| 69 |
checkv3 via rspamc with msgpack metadata |
| 70 |
[Documentation] Scan via rspamc --protocol-v3 --msgpack (msgpack metadata and response) |
| 71 |
${result} = Run Rspamc -p -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL} --protocol-v3 |
| 72 |
... --msgpack --settings=${SETTINGS_NOSYMBOLS} ${GTUBE} |
| 73 |
Check Rspamc ${result} GTUBE ( |
| 74 |
|
| 75 |
checkv3 via rspamc encrypted with msgpack |
| 76 |
[Documentation] Scan via rspamc --protocol-v3 --msgpack --key (encrypted + msgpack) |
| 77 |
${result} = Run Rspamc -p -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL} --protocol-v3 |
| 78 |
... --msgpack --key ${RSPAMD_KEY_PUB1} --settings=${SETTINGS_NOSYMBOLS} ${GTUBE} |
| 79 |
Check Rspamc ${result} GTUBE ( |