diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-10 12:04:15 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-10 12:04:15 +0100 |
commit | 37a04a9e42001f376f69d2920315194f3098a0c4 (patch) | |
tree | 5c383185523dd5e7f79bd5504d9d9f53925f70e6 /src/plugins/spf.c | |
parent | aaa96909f731c4493cfc707b59fdd4c67f0afcac (diff) | |
download | rspamd-37a04a9e42001f376f69d2920315194f3098a0c4.tar.gz rspamd-37a04a9e42001f376f69d2920315194f3098a0c4.zip |
[Fix] Do not check DMARC if SPF or DKIM were not checked
Issue: #1629
Diffstat (limited to 'src/plugins/spf.c')
-rw-r--r-- | src/plugins/spf.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/spf.c b/src/plugins/spf.c index 883fabde4..c9bc5d67d 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -549,6 +549,21 @@ spf_symbol_callback (struct rspamd_task *task, void *unused) const gchar *domain; struct spf_resolved *l; struct rspamd_async_watcher *w; + gint *dmarc_checks; + + /* Allow dmarc */ + dmarc_checks = rspamd_mempool_get_variable (task->task_pool, "dmarc_checks"); + + if (dmarc_checks) { + (*dmarc_checks) ++; + } + else { + dmarc_checks = rspamd_mempool_alloc (task->task_pool, + sizeof (*dmarc_checks)); + *dmarc_checks = 1; + rspamd_mempool_set_variable (task->task_pool, "dmarc_checks", + dmarc_checks, NULL); + } if (radix_find_compressed_addr (spf_module_ctx->whitelist_ip, task->from_addr) != RADIX_NO_VALUE) { |