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

Fix processing of exp macro #33

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
spf (0.1)
spf (0.1.1)
ruby-ip (~> 0.9.1)

GEM
Expand Down
9 changes: 4 additions & 5 deletions lib/spf/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -745,19 +745,18 @@ def params

def process(server, request, result)
begin
exp_domain = @domain_spec.new({:server => server, :request => request})
exp_domain = @domain_spec.text
txt_packet = server.dns_lookup(exp_domain, 'TXT')
txt_rrs = txt_packet.answer.select {|x| x.type == 'TXT'}.map {|x| x.answer}
unless text_rrs.length > 0
unless txt_packet.length > 0
server.throw_result(:permerror, request,
"No authority explanation string available at domain '#{exp_domain}'") # RFC 4408, 6.2/4
end
unless text_rrs.length == 1
unless txt_packet.length == 1
server.throw_result(:permerror, request,
"Redundant authority explanation strings found at domain '#{exp_domain}'") # RFC 4408, 6.2/4
end
explanation = SPF::MacroString.new(
:text => txt_rrs[0].char_str_list.join(''),
:text => txt_packet[0].strings.join(''),
:server => server,
:request => request,
:is_explanation => true
Expand Down