]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] SPF: Fix debugging domain
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 26 Aug 2022 21:14:24 +0000 (22:14 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 26 Aug 2022 21:31:00 +0000 (22:31 +0100)
src/libserver/spf.c

index 29780dce51943eab3ed827c97276e954da6b49e0..8f7a596d9489cf62a52a3f79273d9d085be9713e 100644 (file)
@@ -975,14 +975,15 @@ spf_record_dns_callback (struct rdns_reply *reply, gpointer arg)
                                        break;
                                case SPF_RESOLVE_INCLUDE:
                                        if (elt_data->type == RDNS_REQUEST_TXT) {
-                                               if (reply->entries) {
+                                               struct rdns_reply_entry *selected = NULL;
+
+                                               cb->addr->flags |= RSPAMD_SPF_FLAG_RESOLVED;
+                                               spf_process_txt_record (rec, cb->resolved, reply, &selected);
+                                               if (selected) {
                                                        msg_debug_spf ("got include record for %s: '%s'",
                                                                        req_name->name,
-                                                                       reply->entries[0].content.txt.data);
+                                                                       selected->content.txt.data);
                                                }
-
-                                               cb->addr->flags |= RSPAMD_SPF_FLAG_RESOLVED;
-                                               spf_process_txt_record (rec, cb->resolved, reply, NULL);
                                        }
                                        goto end;