| 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 |
*** Test Cases *** |
| 7 |
|
| 8 |
# Basic alias resolution tests |
| 9 |
|
| 10 |
UNIX ALIAS - SIMPLE RESOLUTION |
| 11 |
[Documentation] Test simple Unix alias resolution (postmaster -> root) |
| 12 |
Scan File ${RSPAMD_TESTDIR}/messages/aliases_simple.eml |
| 13 |
... [email protected] |
| 14 |
... [email protected] |
| 15 |
Expect Symbol ALIAS_RESOLVED |
| 16 |
Expect Symbol LOCAL_INBOUND |
| 17 |
|
| 18 |
PLUS ADDRESSING - BASIC |
| 19 |
[Documentation] Test basic plus addressing (user+tag@domain) |
| 20 |
Scan File ${RSPAMD_TESTDIR}/messages/aliases_plus.eml |
| 21 |
... [email protected] |
| 22 |
... [email protected] |
| 23 |
Expect Symbol TAGGED_RCPT |
| 24 |
Expect Symbol LOCAL_INBOUND |
| 25 |
|
| 26 |
# Message classification tests |
| 27 |
|
| 28 |
CLASSIFICATION - INTERNAL MAIL |
| 29 |
[Documentation] Test internal mail classification (local -> local) |
| 30 |
Scan File ${RSPAMD_TESTDIR}/messages/aliases_internal.eml |
| 31 |
... [email protected] |
| 32 |
... [email protected] |
| 33 |
... IP=127.0.0.1 |
| 34 |
Expect Symbol INTERNAL_MAIL |
| 35 |
Do Not Expect Symbol LOCAL_INBOUND |
| 36 |
Do Not Expect Symbol LOCAL_OUTBOUND |
| 37 |
|
| 38 |
CLASSIFICATION - OUTBOUND MAIL |
| 39 |
[Documentation] Test outbound mail classification (local -> external) |
| 40 |
Scan File ${RSPAMD_TESTDIR}/messages/aliases_outbound.eml |
| 41 |
... [email protected] |
| 42 |
... [email protected] |
| 43 |
... IP=127.0.0.1 |
| 44 |
Expect Symbol LOCAL_OUTBOUND |
| 45 |
Do Not Expect Symbol LOCAL_INBOUND |
| 46 |
Do Not Expect Symbol INTERNAL_MAIL |
| 47 |
|
| 48 |
CLASSIFICATION - INBOUND MAIL |
| 49 |
[Documentation] Test inbound mail classification (external -> local) |
| 50 |
Scan File ${RSPAMD_TESTDIR}/messages/aliases_inbound.eml |
| 51 |
... [email protected] |
| 52 |
... [email protected] |
| 53 |
Expect Symbol LOCAL_INBOUND |
| 54 |
Expect Symbol ALIAS_RESOLVED |
| 55 |
Do Not Expect Symbol LOCAL_OUTBOUND |
| 56 |
Do Not Expect Symbol INTERNAL_MAIL |
| 57 |
|
| 58 |
# Gmail-specific tests |
| 59 |
|
| 60 |
GMAIL DOTS REMOVAL |
| 61 |
[Documentation] Test Gmail dots removal ([email protected] -> [email protected]) |
| 62 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 63 |
... [email protected] |
| 64 |
... [email protected] |
| 65 |
Expect Symbol ALIAS_RESOLVED |
| 66 |
# Note: TAGGED_FROM is only for plus-addressing, not for dots removal |
| 67 |
|
| 68 |
GMAIL PLUS ADDRESSING |
| 69 |
[Documentation] Test Gmail plus addressing ([email protected] -> [email protected]) |
| 70 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 71 |
... [email protected] |
| 72 |
... [email protected] |
| 73 |
Expect Symbol TAGGED_RCPT |
| 74 |
Expect Symbol ALIAS_RESOLVED |
| 75 |
|
| 76 |
GMAIL DOTS AND PLUS |
| 77 |
[Documentation] Test Gmail dots + plus addressing combined |
| 78 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 79 |
... [email protected] |
| 80 |
... [email protected] |
| 81 |
Expect Symbol TAGGED_FROM |
| 82 |
Expect Symbol ALIAS_RESOLVED |
| 83 |
|
| 84 |
# Virtual aliases tests |
| 85 |
|
| 86 |
VIRTUAL ALIAS - SIMPLE |
| 87 |
[Documentation] Test virtual alias resolution ([email protected] -> [email protected]) |
| 88 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 89 |
... [email protected] |
| 90 |
... [email protected] |
| 91 |
Expect Symbol ALIAS_RESOLVED |
| 92 |
Expect Symbol LOCAL_INBOUND |
| 93 |
|
| 94 |
# Chained aliases tests |
| 95 |
|
| 96 |
CHAINED ALIAS RESOLUTION |
| 97 |
[Documentation] Test chained alias resolution (sales -> team-sales -> [email protected]) |
| 98 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 99 |
... [email protected] |
| 100 |
... [email protected] |
| 101 |
Expect Symbol ALIAS_RESOLVED |
| 102 |
Expect Symbol LOCAL_INBOUND |
| 103 |
|
| 104 |
# Rspamd inline aliases tests |
| 105 |
|
| 106 |
RSPAMD INLINE ALIAS |
| 107 |
[Documentation] Test rspamd inline alias from config ([email protected]) |
| 108 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 109 |
... [email protected] |
| 110 |
... [email protected] |
| 111 |
Expect Symbol ALIAS_RESOLVED |
| 112 |
Expect Symbol LOCAL_INBOUND |
| 113 |
|
| 114 |
# Local domain detection tests |
| 115 |
|
| 116 |
LOCAL DOMAIN - POSITIVE |
| 117 |
[Documentation] Test local domain detection for example.com |
| 118 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 119 |
... [email protected] |
| 120 |
... [email protected] |
| 121 |
... IP=127.0.0.1 |
| 122 |
Expect Symbol INTERNAL_MAIL |
| 123 |
|
| 124 |
LOCAL DOMAIN - SUBDOMAIN |
| 125 |
[Documentation] Test local domain detection for mail.example.com |
| 126 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 127 |
... [email protected] |
| 128 |
... [email protected] |
| 129 |
... IP=127.0.0.1 |
| 130 |
Expect Symbol INTERNAL_MAIL |
| 131 |
|
| 132 |
LOCAL DOMAIN - NEGATIVE |
| 133 |
[Documentation] Test that external domain is not detected as local |
| 134 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 135 |
... [email protected] |
| 136 |
... [email protected] |
| 137 |
Expect Symbol LOCAL_INBOUND |
| 138 |
Do Not Expect Symbol INTERNAL_MAIL |
| 139 |
|
| 140 |
# Combined tests |
| 141 |
|
| 142 |
PLUS ADDRESSING WITH ALIAS |
| 143 |
[Documentation] Test plus addressing combined with alias resolution |
| 144 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 145 |
... [email protected] |
| 146 |
... [email protected] |
| 147 |
Expect Symbol TAGGED_RCPT |
| 148 |
Expect Symbol ALIAS_RESOLVED |
| 149 |
|
| 150 |
FROM AND RCPT TAGGED |
| 151 |
[Documentation] Test when both from and recipient have plus tags |
| 152 |
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 153 |
... [email protected] |
| 154 |
... [email protected] |
| 155 |
Expect Symbol TAGGED_FROM |
| 156 |
Expect Symbol TAGGED_RCPT |