class Truemail::Audit::Ptr

Constants

PTR_NOT_FOUND
PTR_NOT_REFER

Public Instance Methods

run() click to toggle source
# File lib/truemail/audit/ptr.rb, line 9
def run
  return add_warning(Truemail::Audit::Ptr::PTR_NOT_FOUND) if ptr_records.empty?
  return if ptr_refer_to_verifier_domain?
  add_warning(Truemail::Audit::Ptr::PTR_NOT_REFER)
end

Private Instance Methods

current_host_reverse_lookup() click to toggle source
# File lib/truemail/audit/ptr.rb, line 17
def current_host_reverse_lookup
  ::IPAddr.new(current_host_ip).reverse
end
ptr_records() click to toggle source
# File lib/truemail/audit/ptr.rb, line 21
def ptr_records
  @ptr_records ||= Truemail::Wrapper.call(configuration: configuration) do
    Truemail::Dns::Resolver.ptr_records(
      current_host_reverse_lookup,
      configuration: configuration
    ).map { |ptr_record| ptr_record.name.to_s }
  end || []
end
ptr_refer_to_verifier_domain?() click to toggle source
# File lib/truemail/audit/ptr.rb, line 30
def ptr_refer_to_verifier_domain?
  ptr_records.include?(verifier_domain)
end