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

Getting unexpected error when trying to validate SPF containing an "exp" modifier #28

Open
julienfromentc opened this issue Oct 4, 2021 · 0 comments

Comments

@julienfromentc
Copy link

When running the below command:

spf_server = SPF::Server.new
spf_server.process(SPF::Request.new(scope: "mfrom", identity: "[email protected]", ip_address: "206.123.2.240"))

I am getting the following error:

NoMethodError: undefined method `new' for #<SPF::MacroString:0x0000564e0fca8830>
from /home/user/.rvm/gems/ruby-2.7.4/gems/spf-0.0.54/lib/spf/model.rb:748:in `process'
Caused by SPF::Result::SoftFail: softfail (SPF::Result::SoftFail)
from /home/user/.rvm/gems/ruby-2.7.4/gems/spf-0.0.54/lib/spf/model.rb:1000:in `block in eval'

According the the error, the gem is trying to parse the exp modifier.

I tried to validate the ip address/identity using the spf-check package, and it returned a Pass result, so the issue does not seem to be caused by malformed SPF record.


In case the SPF record of the domain gatineau.ca changes, here are the current SPF records:

gatineau.ca     text =
        "v=spf1 include:spf.cyberimpact.com include:shops.shopify.com include:servers.mcsv.net include:outgoing1.vircom.com ip4:192.69.1.7/32 ip4:207.115.110.7/32 ip4:207.115.110.252/32 ip4:64.254.21.171/32 ip4:206.123.2.240/32 -all"

spf.cyberimpact.com     text =
        "v=spf1 ip4:50.56.176.200 ip4:50.56.187.251 ip4:45.61.49.183 ip4:45.61.49.253 ip4:67.212.92.20 ip4:184.149.61.112 ip4:204.154.174.0/23 ~all exp=spfexp.cyberimpact.com"

spfexp.cyberimpact.com  text =
        "Please see http://www.openspf.org/Why?s=mfrom;id=%{S};ip=%{C};r=%{R}"

shops.shopify.com       text =
        "v=spf1 ip4:35.203.94.235 ip4:35.203.3.51 ~all"

servers.mcsv.net        text =
        "v=spf1 ip4:205.201.128.0/20 ip4:198.2.128.0/18 ip4:148.105.8.0/21 -all"

outgoing1.vircom.com    text =
        "v=spf1 a ip4:207.115.110.0/24 ip4:207.115.106.114 ip4:192.69.1.0/24 ip4:207.96.143.7/32 a:outgoing1.vircom.com a:outgoing2.vircom.com -all"
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

Successfully merging a pull request may close this issue.

1 participant