X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/d502442ac32f8964f6cf86469869cecb035d12c0..bb07bcd32250965a896b0856dd1b839b5795e2f4:/src/src/spf.c diff --git a/src/src/spf.c b/src/src/spf.c index 7167f5778..2741c7baf 100644 --- a/src/src/spf.c +++ b/src/src/spf.c @@ -4,7 +4,9 @@ /* Experimental SPF support. Copyright (c) Tom Kistner 2004 - 2014 - License: GPL */ + License: GPL + Copyright (c) The Exim Maintainers 2016 +*/ /* Code for calling spf checks via libspf-alt. Called from acl.c. */ @@ -13,16 +15,17 @@ /* must be kept in numeric order */ static spf_result_id spf_result_id_list[] = { - { US"invalid", 0}, - { US"neutral", 1 }, - { US"pass", 2 }, - { US"fail", 3 }, - { US"softfail", 4 }, - { US"none", 5 }, - { US"err_temp", 6 }, /* Deprecated Apr 2014 */ - { US"err_perm", 7 }, /* Deprecated Apr 2014 */ - { US"temperror", 6 }, /* RFC 4408 defined */ - { US"permerror", 7 } /* RFC 4408 defined */ + /* name value */ + { US"invalid", 0}, + { US"neutral", 1 }, + { US"pass", 2 }, + { US"fail", 3 }, + { US"softfail", 4 }, + { US"none", 5 }, + { US"err_temp", 6 }, /* Deprecated Apr 2014 */ + { US"err_perm", 7 }, /* Deprecated Apr 2014 */ + { US"temperror", 6 }, /* RFC 4408 defined */ + { US"permerror", 7 } /* RFC 4408 defined */ }; SPF_server_t *spf_server = NULL; @@ -74,9 +77,9 @@ int spf_init(uschar *spf_helo_domain, uschar *spf_remote_addr) { context (if any), retrieves the result, sets up expansion strings and evaluates the condition outcome. */ -int spf_process(uschar **listptr, uschar *spf_envelope_sender, int action) { +int spf_process(const uschar **listptr, uschar *spf_envelope_sender, int action) { int sep = 0; - uschar *list = *listptr; + const uschar *list = *listptr; uschar *spf_result_id; uschar spf_result_id_buffer[128]; int rc = SPF_RESULT_PERMERROR; @@ -100,10 +103,10 @@ int spf_process(uschar **listptr, uschar *spf_envelope_sender, int action) { SPF_request_query_mailfrom(spf_request, &spf_response); /* set up expansion items */ - spf_header_comment = (uschar *)SPF_response_get_header_comment(spf_response); - spf_received = (uschar *)SPF_response_get_received_spf(spf_response); - spf_result = (uschar *)SPF_strresult(SPF_response_result(spf_response)); - spf_smtp_comment = (uschar *)SPF_response_get_smtp_comment(spf_response); + spf_header_comment = US SPF_response_get_header_comment(spf_response); + spf_received = US SPF_response_get_received_spf(spf_response); + spf_result = US SPF_strresult(SPF_response_result(spf_response)); + spf_smtp_comment = US SPF_response_get_smtp_comment(spf_response); rc = SPF_response_result(spf_response);