if (!(s = expand_string(spf_smtp_comment_template)))
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "expansion of spf_smtp_comment_template failed");
-SPF_server_set_explanation(spf_server, s, &spf_response);
+SPF_server_set_explanation(spf_server, CCS s, &spf_response);
if (SPF_response_errcode(spf_response) != SPF_E_SUCCESS)
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s", SPF_strerror(SPF_response_errcode(spf_response)));
g = string_cat(g, US" (best guess record for domain)");
s = expand_string(US"$sender_address_domain");
+if (s && *s)
+ return string_append(g, 2, US" smtp.mailfrom=", s);
+
+s = sender_helo_name;
return s && *s
- ? string_append(g, 2, US" smtp.mailfrom=", s)
+ ? string_append(g, 2, US" smtp.helo=", s)
: string_cat(g, US" smtp.mailfrom=<>");
}