diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2019-01-28 11:02:32 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2019-01-28 11:02:32 +0300 |
commit | 72085d95ec47a203efc384df618607ad9e20d766 (patch) | |
tree | 99986e27d059f6c3ac19887d627d03dddc886c61 /src/plugins/lua/mid.lua | |
parent | b443d8260a1200e3b9ff7de5a0812a79fb83dafe (diff) | |
download | rspamd-72085d95ec47a203efc384df618607ad9e20d766.tar.gz rspamd-72085d95ec47a203efc384df618607ad9e20d766.zip |
[Fix] MID module: Fix DKIM domain matching
Diffstat (limited to 'src/plugins/lua/mid.lua')
-rw-r--r-- | src/plugins/lua/mid.lua | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/plugins/lua/mid.lua b/src/plugins/lua/mid.lua index 5410e7f9f..0eccd360b 100644 --- a/src/plugins/lua/mid.lua +++ b/src/plugins/lua/mid.lua @@ -49,18 +49,20 @@ local function known_mid_cb(task) local das = task:get_symbol(settings['symbol_dkim_allow']) if ((das or E)[1] or E).options then for _,dkim_domain in ipairs(das[1]['options']) do - local v = map:get_key(dkim_domain) - if v then - if v == '' then - if not header then - task:insert_result(settings['symbol_known_no_mid'], 1, dkim_domain) - return - end - else - re[dkim_domain] = rspamd_regexp.create_cached(v) - if header and re[dkim_domain] and re[dkim_domain]:match(header) then + if dkim_domain then + local v = map:get_key(dkim_domain:match "[^:]+") + if v then + if v == '' then + if not header then + task:insert_result(settings['symbol_known_no_mid'], 1, dkim_domain) + return + end + else + re[dkim_domain] = rspamd_regexp.create_cached(v) + if header and re[dkim_domain] and re[dkim_domain]:match(header) then task:insert_result(settings['symbol_known_mid'], 1, dkim_domain) return + end end end end |