Gitweb:
https://git.exim.org/exim.git/commitdiff/85e453f622a540ecc8c86b3817e8b85d8218c474
Commit: 85e453f622a540ecc8c86b3817e8b85d8218c474
Parent: 17ba0f52b8df4e6ece849deac1b9d6b88bdc26c6
Author: Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Dec 28 21:54:51 2019 +0000
Committer: Jeremy Harris <jgh146exb@???>
CommitDate: Sat Dec 28 21:54:51 2019 +0000
SPF: library version reporting
---
src/src/exim.c | 3 +++
src/src/spf.c | 14 +++++++++++++-
src/src/spf.h | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/src/exim.c b/src/src/exim.c
index 81b7bdc..3fda222 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -1114,6 +1114,9 @@ show_db_version(fp);
#ifdef SUPPORT_I18N
utf8_version_report(fp);
#endif
+#ifdef SUPPORT_SPF
+ spf_lib_version_report(fp);
+#endif
for (auth_info * authi = auths_available; *authi->driver_name != '\0'; ++authi)
if (authi->version_report)
diff --git a/src/src/spf.c b/src/src/spf.c
index 7192ef4..1015d77 100644
--- a/src/src/spf.c
+++ b/src/src/spf.c
@@ -34,6 +34,18 @@ SPF_response_t *spf_response_2mx = NULL;
SPF_dns_rr_t * spf_nxdomain = NULL;
+void
+spf_lib_version_report(FILE * fp)
+{
+int maj, min, patch;
+SPF_get_lib_version(&maj, &min, &patch);
+fprintf(fp, "Library version: spf2: Compile: %d.%d.%d\n",
+ SPF_LIB_VERSION_MAJOR, SPF_LIB_VERSION_MINOR, SPF_LIB_VERSION_PATCH);
+fprintf(fp, " Runtime: %d.%d.%d\n",
+ maj, min, patch);
+}
+
+
static SPF_dns_rr_t *
SPF_dns_exim_lookup(SPF_dns_server_t *spf_dns_server,
@@ -107,7 +119,7 @@ for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr;
gstring * g = NULL;
uschar chunk_len;
- if (strncmpic(rr->data+1, US"v=spf1", 6) != 0)
+ if (strncmpic(rr->data+1, US SPF_VER_STR, 6) != 0)
{
HDEBUG(D_host_lookup) debug_printf("not an spf record\n");
continue;
diff --git a/src/src/spf.h b/src/src/spf.h
index 1c87669..2283277 100644
--- a/src/src/spf.h
+++ b/src/src/spf.h
@@ -25,6 +25,7 @@ typedef struct spf_result_id {
} spf_result_id;
/* prototypes */
+void spf_lib_version_report(FILE *);
BOOL spf_init(void);
BOOL spf_conn_init(uschar *, uschar *);
int spf_process(const uschar **, uschar *, int);