From: Vsevolod Stakhov Date: Mon, 2 Dec 2019 15:17:01 +0000 (+0000) Subject: [Minor] Fix dmarc after change X-Git-Tag: 2.3~263 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f116f6edbeffd33ef0cbdbaf893c2587f4ae784;p=thirdparty%2Frspamd.git [Minor] Fix dmarc after change --- diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c index 3a88d9bb6d..133feef2f5 100644 --- a/src/plugins/dkim_check.c +++ b/src/plugins/dkim_check.c @@ -1121,7 +1121,8 @@ dkim_symbol_callback (struct rspamd_task *task, GError *err = NULL; struct rspamd_mime_header *rh, *rh_cur; struct dkim_check_result *res = NULL, *cur; - guint checked = 0, *dmarc_checks; + guint checked = 0; + gdouble *dmarc_checks; struct dkim_ctx *dkim_module_ctx = dkim_get_context (task->cfg); /* Allow dmarc */ diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index c2fc4d9bb1..08d9732d9c 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -559,7 +559,7 @@ local function dmarc_callback(task) local hfromdom = ((from or E)[1] or E).domain local dmarc_domain local ip_addr = task:get_ip() - local dmarc_checks = task:get_mempool():get_variable('dmarc_checks', 'int') or 0 + local dmarc_checks = task:get_mempool():get_variable('dmarc_checks', 'double') or 0 local seen_invalid = false if dmarc_checks ~= 2 then diff --git a/src/plugins/lua/spf.lua b/src/plugins/lua/spf.lua index 2e4492b338..62f147f91a 100644 --- a/src/plugins/lua/spf.lua +++ b/src/plugins/lua/spf.lua @@ -126,6 +126,10 @@ local function spf_check_callback(task) local sym = flag_to_symbol(flags) task:insert_result(sym, 1.0, err) end + + local dmarc_checks = task:get_mempool():get_variable('dmarc_checks', 'double') or 0 + dmarc_checks = dmarc_checks + 1 + task:get_mempool():set_variable('dmarc_checks', dmarc_checks) end rspamd_spf.resolve(task, spf_resolved_cb)