-
Notifications
You must be signed in to change notification settings - Fork 10
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
Does not process redirect global mod correctly #12
Comments
I apologize - The output above was actually with some of my attempted fixes.
|
Thanks for looking into this, and sorry that you wound up in a rabbit hole! Can you try with the latest code? Handling of redirect: modifiers was pretty horribly broken in a couple places. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've spent a significant amount of time trying to debug/fix this issue but the further down the rabbit hole I get, the more I'm worried that I don't fully understand how to handle global modifiers.
If you have an spf record that has
includes:gmail.com
- Gmail subsequently uses a redirect global modifierredirect=_spf.google.com
(the entire txt record isv=spf1 redirect=_spf.google.com
)When this gem goes into
SPF::Record#eval
there are no@terms
for this subrequest so the.each
block just returns[]
and therescue SPF::Result => result
on line 1001 never gets hit which would break into the processing of the global mods. Result for this subrequest isnil
and when that's being raised (since we never processed the global_mod to get a result) we getTypeError: exception object expected
Even when I modify the conditional to check if there are global_mods present but no terms present and then hit
global_mod.process(server, request, result)
for the one global_mod -SPF::Mod::Redirect
seems to incorrectly try and callauthority_domain = @domain_spec.new({:server => server, :request => request})
(@domain_spec
is already aSPF::MacroString
and doesn't respond tonew
). IfSPF::Mod::Redirect
is modified to act likeSPF::Mech::Include
and callauthority_domain = self.domain(server, request)
it will try to process all the sub requests for theredirect:_spf.google.com
but eventually returnsnil
which bubbles up through the call stack and I'm eventually left in the same place withnil
trying to be raised somewhere along the line which producesTypeError: exception object expected
I would be more than happy to work on this with someone more knowledgeable but at this point I've just followed this so far down the hole to the point that I'm not sure I fully understand what's going on or would be able to without some assistance. 🤘
Here's what happens if you just call the gem without any of the debugging/fixes that I've tried to put in place:
The text was updated successfully, but these errors were encountered: