diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-06 10:04:38 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-06 10:05:59 +0100 |
commit | dac58faa8449758b07b5f8c6705a1afa33ec3619 (patch) | |
tree | 86de335d9ad474f7973fb0071b17d95d5db6931f /src/libserver/spf.c | |
parent | b778d2b93377ef12de0ab6b4b6772f30207c0f7c (diff) | |
download | rspamd-dac58faa8449758b07b5f8c6705a1afa33ec3619.tar.gz rspamd-dac58faa8449758b07b5f8c6705a1afa33ec3619.zip |
[Fix] Fix parsing includes and redirects in SPF
Issue: #1009
Reported by: @moisseev
Diffstat (limited to 'src/libserver/spf.c')
-rw-r--r-- | src/libserver/spf.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/libserver/spf.c b/src/libserver/spf.c index 2d6f864ba..5eb8dbd1c 100644 --- a/src/libserver/spf.c +++ b/src/libserver/spf.c @@ -670,11 +670,8 @@ spf_record_dns_callback (struct rdns_reply *reply, gpointer arg) break; case SPF_RESOLVE_REDIRECT: if (elt_data->type == RDNS_REQUEST_TXT) { - if (spf_process_txt_record (rec, cb->resolved, reply)) { - cb->addr->flags |= RSPAMD_SPF_FLAG_RESOLVED; - } - else { - cb->addr->flags &= ~RSPAMD_SPF_FLAG_RESOLVED; + cb->addr->flags |= RSPAMD_SPF_FLAG_RESOLVED; + if (!spf_process_txt_record (rec, cb->resolved, reply)) { cb->addr->flags |= RSPAMD_SPF_FLAG_PERMFAIL; } } @@ -683,12 +680,8 @@ spf_record_dns_callback (struct rdns_reply *reply, gpointer arg) break; case SPF_RESOLVE_INCLUDE: if (elt_data->type == RDNS_REQUEST_TXT) { - if (spf_process_txt_record (rec, cb->resolved, reply)) { - cb->addr->flags |= RSPAMD_SPF_FLAG_RESOLVED; - } - else { - cb->addr->flags &= ~RSPAMD_SPF_FLAG_RESOLVED; - } + cb->addr->flags |= RSPAMD_SPF_FLAG_RESOLVED; + spf_process_txt_record (rec, cb->resolved, reply); } goto end; |