diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-21 20:35:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-21 20:35:44 +0100 |
commit | dec3e60713ca4364d08d407e8dc01a57c63163cf (patch) | |
tree | d07c4888ba3b3f194dfb4b4f228520428d78db7f /src/plugins | |
parent | a7d6560cfb64331e00a54a41a698e78aac62a2de (diff) | |
download | rspamd-dec3e60713ca4364d08d407e8dc01a57c63163cf.tar.gz rspamd-dec3e60713ca4364d08d407e8dc01a57c63163cf.zip |
[Fix] Various fixes in embedded plugins
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/dkim_check.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c index 30dbe7b02..9475164a1 100644 --- a/src/plugins/dkim_check.c +++ b/src/plugins/dkim_check.c @@ -1029,8 +1029,6 @@ dkim_module_check (struct dkim_check_result *res) tracebuf); } } - - rspamd_symcache_item_async_dec_check (res->task, res->item); } } @@ -1119,15 +1117,21 @@ dkim_symbol_callback (struct rspamd_task *task, || (!dkim_module_ctx->check_local && rspamd_inet_address_is_local (task->from_addr, TRUE))) { msg_info_task ("skip DKIM checks for local networks and authorized users"); + rspamd_symbols_cache_finalize_item (task, item); + return; } /* Check whitelist */ if (rspamd_match_radix_map_addr (dkim_module_ctx->whitelist_ip, task->from_addr) != NULL) { msg_info_task ("skip DKIM checks for whitelisted address"); + rspamd_symbols_cache_finalize_item (task, item); + return; } + rspamd_symcache_item_async_inc (task, item); + /* Now check if a message has its signature */ hlist = rspamd_message_get_header_array (task, RSPAMD_DKIM_SIGNHEADER, @@ -1156,6 +1160,15 @@ dkim_symbol_callback (struct rspamd_task *task, RSPAMD_DKIM_NORMAL, &err); + if (res == NULL) { + res = cur; + res->first = res; + res->prev = res; + } + else { + DL_APPEND (res, cur); + } + if (ctx == NULL) { if (err != NULL) { msg_info_task ("<%s> cannot parse DKIM context: %e", @@ -1205,15 +1218,6 @@ dkim_symbol_callback (struct rspamd_task *task, } } - if (res == NULL) { - res = cur; - res->first = res; - res->prev = res; - } - else { - DL_APPEND (res, cur); - } - checked ++; if (checked > dkim_module_ctx->max_sigs) { @@ -1232,12 +1236,10 @@ dkim_symbol_callback (struct rspamd_task *task, } if (res != NULL) { - rspamd_symcache_item_async_inc (task, item); dkim_module_check (res); } - else { - rspamd_symbols_cache_finalize_item (task, item); - } + + rspamd_symcache_item_async_dec_check (task, item); } static void |