summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2018-09-16 16:58:34 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2018-09-16 17:01:50 +0300
commit54aaea910810fb71af1e8faacee2e4267e58e5f0 (patch)
treec238dc2f48df1cf210ada4094867191eb7d5dca3 /src
parent52c90107be7b9dc9bd7d399c88d0bc3dc2a36a77 (diff)
downloadrspamd-54aaea910810fb71af1e8faacee2e4267e58e5f0.tar.gz
rspamd-54aaea910810fb71af1e8faacee2e4267e58e5f0.zip
[Feature] Relax FORGED_RECIPIENTS
allow alias expansion and forwarding (Postfix)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/forged_recipients.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/lua/forged_recipients.lua b/src/plugins/lua/forged_recipients.lua
index 782a408bd..25d6c8f8c 100644
--- a/src/plugins/lua/forged_recipients.lua
+++ b/src/plugins/lua/forged_recipients.lua
@@ -28,6 +28,7 @@ local E = {}
local function check_forged_headers(task)
local auser = task:get_user()
+ local delivered_to = task:get_header('Delivered-To')
local smtp_rcpt = task:get_recipients(1)
local smtp_from = task:get_from(1)
local res
@@ -43,7 +44,7 @@ local function check_forged_headers(task)
task:insert_result(symbol_rcpt, score, '', sra)
return
end
- -- Find pair for each smtp recipient recipient in To or Cc headers
+ -- Find pair for each smtp recipient in To or Cc headers
for _,sr in ipairs(smtp_rcpt) do
res = false
for _,mr in ipairs(mime_rcpt) do
@@ -51,6 +52,10 @@ local function check_forged_headers(task)
string.lower(mr['addr']) == string.lower(sr['addr']) then
res = true
break
+ elseif delivered_to and delivered_to == mr['addr'] then
+ -- allow alias expansion and forwarding (Postfix)
+ res = true
+ break
elseif auser and auser == sr['addr'] then
-- allow user to BCC themselves
res = true