Expansions: new ${authresults {mch}} for an Authentication-Results header
[exim.git] / src / src / spf.c
index ffd278af8609f5b3e817929a75ec7d6bb9e3116f..a2f93b0ce535c4862f0c60d60d44b4c5aa4801e0 100644 (file)
@@ -5,13 +5,13 @@
 /* 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. */
 
 #include "exim.h"
-#ifdef EXPERIMENTAL_SPF
+#ifdef SUPPORT_SPF
 
 /* must be kept in numeric order */
 static spf_result_id spf_result_id_list[] = {
@@ -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
@@ -146,4 +146,16 @@ while ((spf_result_id = string_nextinlist(&list, &sep, NULL, 0)))
 return FAIL;
 }
 
+
+
+gstring *
+authres_spf(gstring * g)
+{
+if (!spf_result) return g;
+
+return string_append(g, 4, US";\\n\\tspf=", spf_result,
+         US" smtp.mailfrom=", expand_string(US"$sender_address_domain"));
+}
+
+
 #endif