SPF: Making error definitions public

16 views
Skip to first unread message

Adrian Martinez

unread,
Aug 19, 2021, 12:08:44 AM8/19/21
to chas...@googlegroups.com
Hi!

Thanks for creating your SPF library, it has been super handy.

I have a use-case where on top of the SPF result, I'd like to know why the result occurred. For example, given a result I'd want to distinguish whether it was due to exceeding lookup depth, missing config etc.

This can be found currently by inspecting the error string (because the error definitions are private), but that approach isn't resilient to changes in the library's error messages.

Are you open to making those error definitions public? Happy to submit a PR if this is the case.

Thanks!
Adrian

Alberto Bertogli

unread,
Aug 19, 2021, 4:31:52 PM8/19/21
to Adrian Martinez, chas...@googlegroups.com
On Thu, Aug 19, 2021 at 02:08:32PM +1000, Adrian Martinez wrote:
>Hi!
>
>Thanks for creating your SPF library, it has been super handy.

I'm happy to hear that!


>I have a use-case where on top of the SPF result, I'd like to know why the
>result occurred. For example, given a result I'd want to distinguish
>whether it was due to exceeding lookup depth, missing config etc.
>
>This can be found currently by inspecting the error string (because the
>error definitions are private), but that approach isn't resilient to
>changes in the library's error messages.
>
>Are you open to making those error definitions public? Happy to submit a PR
>if this is the case.

I am, and thanks for offering to send a PR!

I think it's something we need to implement carefully, to make sure it's
reasonably future proof. But it's a reasonable request and I'm sure we
can find a way, I have a couple of ideas as well.

I'm going to be with limited connectivity for the next 10 days or so,
but am happy to look into this when I come back.

Thanks a lot again,
Alberto

Alberto Bertogli

unread,
Sep 3, 2021, 6:16:26 AM9/3/21
to Adrian Martinez, chas...@googlegroups.com
I wrote a patch for this, it's currently in the `next` branch.

https://blitiri.com.ar/git/r/spf/c/515d9b8907b67b30f2a48ee52549c3d69585b2f0/

Can you please take a look and let me know how it goes? Once we're happy
enough with it, I'll move it to `master`.

Thanks!
Alberto

Reply all
Reply to author
Forward
0 new messages