Add non-mtp source info to ${authres }
[exim.git] / src / src / expand.c
index a1ac7d1983372323cb6a3523f22a7f1df7215c3d..f878e7b7f6f91753e43ab480586ce61f1f2257c2 100644 (file)
@@ -1662,6 +1662,21 @@ return yield;
 
 
 
+/* Append a "local" element to an Autherntication-Results: header
+if this was a non-smtp message.
+*/
+
+static gstring *
+authres_local(gstring * g, const uschar * sysname)
+{
+if (!authentication_local)
+  return g;
+g = string_append(g, 3, US";\n\tlocal=pass (non-smtp, ", sysname, US")");
+if (authenticated_id) g = string_append(g, 2, " u=", authenticated_id);
+return g;
+}
+
+
 /* Append an "iprev" element to an Autherntication-Results: header
 if we have attempted to get the calling host's name.
 */
@@ -4141,6 +4156,7 @@ while (*s != 0)
                        US"Authentication-Results: ", sub_arg[0], US"; none");
       yield->ptr -= 6;
 
+      yield = authres_local(yield, sub_arg[0]);
       yield = authres_iprev(yield);
       yield = authres_smtpauth(yield);
 #ifdef SUPPORT_SPF