]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/spf.c
ARC: add independent-source testcase. Fix signatures by not line-terminating
[user/henk/code/exim.git] / src / src / spf.c
index 1d4e032e94ca6139f4e7a3d34e81ec138fdae232..0f0a05d4dcddd40a2994290052fc0e969d3a9682 100644 (file)
@@ -5,7 +5,7 @@
 /* Experimental SPF support.
    Copyright (c) Tom Kistner <tom@duncanthrax.net> 2004 - 2014
    License: GPL
-   Copyright (c) The Exim Maintainers 2017
+   Copyright (c) The Exim Maintainers 2015 - 2018
 */
 
 /* Code for calling spf checks via libspf-alt. Called from acl.c. */
@@ -89,7 +89,7 @@ return TRUE;
 /* spf_process adds the envelope sender address to the existing
    context (if any), retrieves the result, sets up expansion
    strings and evaluates the condition outcome.
-   
+
 Return: OK/FAIL  */
 
 int
@@ -112,7 +112,10 @@ 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);
 
@@ -146,4 +149,23 @@ while ((spf_result_id = string_nextinlist(&list, &sep, NULL, 0)))
 return FAIL;
 }
 
+
+
+gstring *
+authres_spf(gstring * g)
+{
+uschar * s;
+if (!spf_result) return g;
+
+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=<>");
+}
+
+
 #endif