Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jcea opened this issue Feb 20, 2020 · 6 comments
Open

Comments

@jcea
Copy link

jcea commented Feb 20, 2020

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.

@sdgathman
Copy link
Owner

sdgathman commented Mar 31, 2020

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
Copy link
Owner

Can the documentation be improved?

@karolyi
Copy link

karolyi commented Jan 13, 2025

This doesn't seem to be the case with 2.0.14.

@sdgathman
Copy link
Owner

This doesn't seem to be the case with 2.0.14.

What is not the case?

@karolyi
Copy link

karolyi commented Jan 13, 2025

Oh, hello. When testing a Permerror (as to why it happened), the original Received-SPF header only contains a (mailfrom) as an explanation, and not the Void lookup limit of 2 exceeded that seems to be a result after investigating more.

That's what I meant.

If you are active on matrix, I'd like to contact you there for some help if you're available, as I don't want to pollute this issue with offtopic stuff here.

@sdgathman
Copy link
Owner

Example API call from bmsmilter.py:
self.add_header('Received-SPF',q.get_header(q.result,self.receiver,**kv),0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants