aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/emails.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua
index 65e6b433e..12e94a932 100644
--- a/src/plugins/lua/emails.lua
+++ b/src/plugins/lua/emails.lua
@@ -32,6 +32,13 @@ local N = "emails"
-- Check rule for a single email
local function check_email_rule(task, rule, addr)
+ if rule['whitelist'] then
+ if rule['whitelist']:get_key(addr.addr)
+ or rule['whitelist']:get_key(addr.domain) then
+ logger.debugm(N, task, "whitelisted address: %s", addr.addr)
+ return
+ end
+ end
if rule['dnsbl'] then
local email
local to_resolve
@@ -175,6 +182,14 @@ if opts and type(opts) == 'table' then
rule['delimiter'] = "@"
end
+ if rule['whitelist'] then
+ rule['whitelist'] = rspamd_config:add_map({
+ url = rule['whitelist'],
+ description = string.format('Emails rule %s whitelist', rule['symbol']),
+ type = 'set'
+ })
+ end
+
if rule['map'] then
rule['name'] = rule['map']
rule['map'] = rspamd_config:add_map({