From 6ef35e3b2219338be95a1f1fc31f77c5c8cbed29 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 Jan 2016 22:06:27 +0000 Subject: Ignore SPF results in case of DNS failure --- src/plugins/spf.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/spf.c b/src/plugins/spf.c index d7f1031c7..583a46a44 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -386,12 +386,18 @@ spf_check_list (struct spf_resolved *rec, struct rspamd_task *task) guint i; struct spf_addr *addr; - for (i = 0; i < rec->elts->len; i ++) { - addr = &g_array_index (rec->elts, struct spf_addr, i); - if (spf_check_element (addr, task)) { - break; + if (!rec->failed) { + for (i = 0; i < rec->elts->len; i ++) { + addr = &g_array_index (rec->elts, struct spf_addr, i); + if (spf_check_element (addr, task)) { + break; + } } } + else { + msg_info_task ("<%s>: ignore spf results due to DNS failure", + task->message_id); + } } static void -- cgit v1.2.3