lib/spf/model.rb in spf-0.0.46 vs lib/spf/model.rb in spf-0.0.47

- old
+ new

@@ -569,11 +569,11 @@ def nested_record(server=nil, request=nil, loose_match = false) return @nested_record if @nested_record return nil unless server and request authority_domain = self.domain(server, request) sub_request = request.new_sub_request({:authority_domain => authority_domain}) - return @nested_record = server.select_record(sub_request, loose_match) + return @nested_record = server.selectrecord(sub_request, loose_match) end end class SPF::Mech::MX < SPF::Mech @@ -784,18 +784,18 @@ def params return @domain_spec end def process(server, request, result) + server.count_dns_interactive_term(request) # Only perform redirection if no mechanism matched (RFC 4408, 6.1/1): return unless SPF::Result::NeutralByDefault === result # Create sub-request with mutated authorithy domain: - authority_domain = @domain_spec.new({:server => server, :request => request}) - sub_request = request.new_sub_request({:authority_domain => authority_domain}) + sub_request = request.new_sub_request({:authority_domain => @domain_spec}) # Process sub-request: result = server.process(sub_request) @nested_record = sub_request.record @@ -805,11 +805,11 @@ server.throw_result(:permerror, request, "Redirect domain '#{authority_domain}' has no applicable sender policy") end # Propagate any other results as-is: - result.throw + raise result end def nested_record(server=nil, request=nil) return @nested_record if @nested_record return nil unless server and request @@ -996,9 +996,11 @@ else # Invalid term object encountered: error(SPF::UnexpectedTermObjectError.new("Unexpected term object '#{term}' encountered.")) end end + server.throw_result(:neutral_by_default, request, + 'Default neutral result due to no mechanism matches') rescue SPF::Result => result # Process global modifiers in ascending order of precedence: global_mods.each do |global_mod| global_mod.process(server, request, result) end