Mailing List Archive

[PATCH] libspf2/spf_request.c: Fix handling of email addresses in query_rcptto().
From: Florian Forster <ff@octo.it>

The function SPF_request_query_rcptto() checks whether the "rcpt_to"
string argument contains the "@" character. If so, everything before the
at-sign is stripped. However, the at-sign itself left in front of the
string, so that the generated SPF record reads:

v=spf1 mx:@example.com

The actual checking code then tries to resolve "@example.com" rather than
"example.com", fails and returns "neutral" even when it should return
"pass".

This patch adds the missing `rcpt_to_dom++` so the at-sign is stripped,
too.
---
src/libspf2/spf_request.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/libspf2/spf_request.c b/src/libspf2/spf_request.c
index 7614141..b502fb2 100644
--- a/src/libspf2/spf_request.c
+++ b/src/libspf2/spf_request.c
@@ -363,6 +363,8 @@ SPF_request_query_rcptto(SPF_request_t *spf_request,
rcpt_to_dom = strchr(rcpt_to, '@');
if (rcpt_to_dom == NULL)
rcpt_to_dom = rcpt_to;
+ else
+ rcpt_to_dom++;
spf_request->cur_dom = rcpt_to_dom;

len = sizeof(SPF_VER_STR) + 64 + strlen(rcpt_to_dom);
--
1.7.2.3



-------------------------------------------
Sender Policy Framework: http://www.openspf.org [http://www.openspf.org]
Modify Your Subscription: http://www.listbox.com/member/ [http://www.listbox.com/member/]

Archives: https://www.listbox.com/member/archive/1007/=now
RSS Feed: https://www.listbox.com/member/archive/rss/1007/1311533-9e42a648
Modify Your Subscription: https://www.listbox.com/member/?member_id=1311533&id_secret=1311533-d322f1f1
Unsubscribe Now: https://www.listbox.com/unsubscribe/?member_id=1311533&id_secret=1311533-d59c80a0&post_id=20110123094802:D7B34FA4-26FF-11E0-8986-CD98F559ED1D
Powered by Listbox: http://www.listbox.com