pyspf icon indicating copy to clipboard operation
pyspf copied to clipboard

Provide detailed explanation for SPF result, for "Received-SPF" header

Open jcea opened this issue 5 years ago • 2 comments

RFC7208 requests that the "Received-SPF" header provides details about the reason the SPF result was what it was. See https://tools.ietf.org/html/rfc7208#section-9.1 . I don't see any API call in pyspf able to provide that kind of detail.

Since I am using pyspf from a MILTER filter and I can add an appropriate "Received-SPF" header to incoming emails, it would be very nice to be able to get the SPF tests details.

Thanks.

jcea avatar Feb 20 '20 22:02 jcea

The mechanism attribute has the mechanism producing the result (e.g. failure). You also get a text diagnostic, e.g.

Received-SPF: PermError (mail.gathman.org: permanent error in processing domain of nextgen.com: Void lookup limit of 2 exceeded) client-ip=2a01:111:f400:fe5b::713; envelope-from="[email protected]"; helo=NAM12-BN8-obe.outbound.protection.outlook.com; receiver=mail.gathman.org; x-helo-spf=pass; identity=mailfrom

sdgathman avatar Mar 31 '20 21:03 sdgathman

Can the documentation be improved?

sdgathman avatar Nov 06 '21 01:11 sdgathman