X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fspf.c;h=0b00a5c7cb6b32596998e3b9723ee4977261518e;hb=96c5bd4049c62215b741ff7b6ff7a3bf24bea7c0;hp=12994a690d226b363d1b7a4282cb889925b6b1fa;hpb=e34f8ca2022e340d3c0e36260a0232fab306dfcc;p=exim.git diff --git a/src/src/spf.c b/src/src/spf.c index 12994a690..0b00a5c7c 100644 --- a/src/src/spf.c +++ b/src/src/spf.c @@ -22,8 +22,6 @@ static spf_result_id spf_result_id_list[] = { { US"fail", 3 }, { US"softfail", 4 }, { US"none", 5 }, - { US"err_temp", 6 }, /* Deprecated Apr 2014 */ - { US"err_perm", 7 }, /* Deprecated Apr 2014 */ { US"temperror", 6 }, /* RFC 4408 defined */ { US"permerror", 7 } /* RFC 4408 defined */ }; @@ -105,14 +103,17 @@ if (!(spf_server && spf_request)) rc = SPF_RESULT_PERMERROR; else if (SPF_request_set_env_from(spf_request, CS spf_envelope_sender)) - /* Invalid sender address. This should be a real rare occurence */ + /* Invalid sender address. This should be a real rare occurrence */ rc = SPF_RESULT_PERMERROR; else { /* get SPF result */ if (action == SPF_PROCESS_FALLBACK) + { SPF_request_query_fallback(spf_request, &spf_response, CS spf_guess); + spf_result_guessed = TRUE; + } else SPF_request_query_mailfrom(spf_request, &spf_response); @@ -151,10 +152,17 @@ return FAIL; gstring * authres_spf(gstring * g) { +uschar * s; if (!spf_result) return g; -return string_append(g, 4, US";\n\tspf=", spf_result, - US" smtp.mailfrom=", expand_string(US"$sender_address_domain")); +g = string_append(g, 2, US";\n\tspf=", spf_result); +if (spf_result_guessed) + g = string_cat(g, US" (best guess record for domain)"); + +s = expand_string(US"$sender_address_domain"); +return s && *s + ? string_append(g, 2, US" smtp.mailfrom=", s) + : string_cat(g, US" smtp.mailfrom=<>"); }