class SPF::Result::SPF::Result::Fail

Public Instance Methods

authority_explanation() click to toggle source
# File lib/spf/result.rb, line 20
def authority_explanation
  if self.instance_variable_defined?(:@authority_explanation)
    return @authority_explanation
  end

  @authority_explanation = nil

  server  = @server
  request = @request

  authority_explanation_macrostring = request.state('authority_explanation')

  # If an explicit explanation was specified by the authority domain...
  if authority_explanation_macrostring
    begin
      # ... then try to expand it:
      @authority_explanation = authority_explanation_macrostring.expand
    rescue SPF::InvalidMacroString
      # Igonre expansion errors and leave authority explanation undefined.
    end
  end

  # If no authority explanation could be determined so far...
  unless @authority_explanation
    @authority_explanation = server.default_authority_explanation.new({:request => request}).expand
  end
  return @authority_explanation
end
code() click to toggle source
# File lib/spf/result.rb, line 16
def code
  :fail
end