Subversion Repositories libspf2

Compare Revisions

Ignore whitespace Rev 93 → Rev 94

/trunk/debian/changelog
1,3 → 1,11
libspf2 (1.2.10-7) unstable; urgency=low
 
* error_results.patch: Return information to use in the mail header and
such when no or multiple SPF records exist (Closes: #806313). Thanks
to Sebastian Schweizer <sebastian@schweizer.tel>.
 
-- Magnus Holmgren <holmgren@debian.org> Fri, 25 Mar 2016 17:38:19 +0100
 
libspf2 (1.2.10-6) unstable; urgency=medium
 
* gcc5-variadicmacros.patch: Fix syntax error with variadic macro with
/trunk/debian/patches/error_results.patch
0,0 → 1,86
From: Sebastian Schweizer <sebastian@schweizer.tel>
Subject: Return header info also in case of missing or multiple SPF records.
Bug: https://bugs.debian.org/806313
Forwarded: https://github.com/shevek/libspf2/pull/9
 
diff --git a/src/libspf2/spf_interpret.c b/src/libspf2/spf_interpret.c
index a35b58c..5f15df4 100644
--- a/src/libspf2/spf_interpret.c
+++ b/src/libspf2/spf_interpret.c
@@ -104,7 +104,6 @@ SPF_i_set_smtp_comment(SPF_response_t *spf_response)
case SPF_RESULT_FAIL:
case SPF_RESULT_SOFTFAIL:
case SPF_RESULT_NEUTRAL:
- case SPF_RESULT_NONE:
err = SPF_i_set_explanation(spf_response);
if (err != SPF_E_SUCCESS)
@@ -126,6 +125,7 @@ SPF_i_set_smtp_comment(SPF_response_t *spf_response)
case SPF_RESULT_PASS:
case SPF_RESULT_TEMPERROR:
case SPF_RESULT_PERMERROR:
+ case SPF_RESULT_NONE:
default:
break;
}
@@ -380,7 +380,7 @@ SPF_i_set_received_spf(SPF_response_t *spf_response)
* This must be called with EITHER
* spf_response->spf_record_exp != NULL
* OR
- * result in { SPF_RESULT_PASS SPF_RESULT_INVALID
+ * result in { SPF_RESULT_NONE SPF_RESULT_PASS SPF_RESULT_INVALID
* SPF_RESULT_TEMPERROR SPF_RESULT_PERMERROR }
* or the library will abort when it tries to generate an explanation.
*/
diff --git a/src/libspf2/spf_server.c b/src/libspf2/spf_server.c
index d648b4e..66beb69 100644
--- a/src/libspf2/spf_server.c
+++ b/src/libspf2/spf_server.c
@@ -361,8 +361,9 @@ retry:
}
spf_response->result = SPF_RESULT_NONE;
spf_response->reason = SPF_REASON_FAILURE;
- return SPF_response_add_error(spf_response, SPF_E_NOT_SPF,
- "Host '%s' not found.", domain);
+ return SPF_i_done(spf_response, SPF_RESULT_NONE, SPF_REASON_FAILURE,
+ SPF_response_add_error(spf_response, SPF_E_NOT_SPF,
+ "Host '%s' not found.", domain));
// break;
case NO_DATA:
@@ -375,8 +376,9 @@ retry:
}
spf_response->result = SPF_RESULT_NONE;
spf_response->reason = SPF_REASON_FAILURE;
- return SPF_response_add_error(spf_response, SPF_E_NOT_SPF,
- "No DNS data for '%s'.", domain);
+ return SPF_i_done(spf_response, SPF_RESULT_NONE, SPF_REASON_FAILURE,
+ SPF_response_add_error(spf_response, SPF_E_NOT_SPF,
+ "No DNS data for '%s'.", domain));
// break;
case TRY_AGAIN:
@@ -453,17 +455,18 @@ retry:
}
spf_response->result = SPF_RESULT_NONE;
spf_response->reason = SPF_REASON_FAILURE;
- return SPF_response_add_error(spf_response, SPF_E_NOT_SPF,
- "No SPF records for '%s'", domain);
+ return SPF_i_done(spf_response, SPF_RESULT_NONE, SPF_REASON_FAILURE,
+ SPF_response_add_error(spf_response, SPF_E_NOT_SPF,
+ "No SPF records for '%s'", domain));
}
if (num_found > 1) {
SPF_dns_rr_free(rr_txt);
// rfc4408 requires permerror here.
- /* XXX This could be refactored with SPF_i_done. */
spf_response->result = SPF_RESULT_PERMERROR;
spf_response->reason = SPF_REASON_FAILURE;
- return SPF_response_add_error(spf_response, SPF_E_MULTIPLE_RECORDS,
- "Multiple SPF records for '%s'", domain);
+ return SPF_i_done(spf_response, SPF_RESULT_PERMERROR, SPF_REASON_FAILURE,
+ SPF_response_add_error(spf_response, SPF_E_MULTIPLE_RECORDS,
+ "Multiple SPF records for '%s'", domain));
}
/* try to compile the SPF record */
/trunk/debian/patches/series
1,3 → 1,4
spf_dns-include-std-headers.patch
abolish-spf-rrtype.patch
gcc5-variadicmacros.patch
error_results.patch