Sha256: f3c9056a7fe31a5e13b6f9b593cbc14ab7bf5774e99e3c3b9ea40b2b0df3dd94

Contents?: true

Size: 687 Bytes

Versions: 49

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

module Truemail
  module Audit
    class Dns < Truemail::Audit::Base
      VERIFIER_DOMAIN_NOT_REFER = 'A-record of verifier domain not refers to current host ip address'

      def run
        return if verifier_domain_refer_to_current_host_ip?
        add_warning(Truemail::Audit::Dns::VERIFIER_DOMAIN_NOT_REFER)
      end

      private

      def a_record
        Truemail::Wrapper.call(configuration: configuration) do
          Truemail::Dns::Resolver.a_record(verifier_domain, configuration: configuration)
        end
      end

      def verifier_domain_refer_to_current_host_ip?
        a_record.eql?(current_host_ip)
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
truemail-3.3.1 lib/truemail/audit/dns.rb
truemail-3.3.0 lib/truemail/audit/dns.rb
truemail-3.2.0 lib/truemail/audit/dns.rb
truemail-3.1.2 lib/truemail/audit/dns.rb
truemail-3.1.1 lib/truemail/audit/dns.rb
truemail-3.1.0 lib/truemail/audit/dns.rb
truemail-3.0.9 lib/truemail/audit/dns.rb
truemail-3.0.8 lib/truemail/audit/dns.rb
truemail-3.0.7 lib/truemail/audit/dns.rb
truemail-3.0.6 lib/truemail/audit/dns.rb
truemail-3.0.5 lib/truemail/audit/dns.rb
truemail-3.0.4 lib/truemail/audit/dns.rb
truemail-3.0.3 lib/truemail/audit/dns.rb
truemail-3.0.2 lib/truemail/audit/dns.rb
truemail-3.0.1 lib/truemail/audit/dns.rb
truemail-3.0.0 lib/truemail/audit/dns.rb
truemail-2.7.5 lib/truemail/audit/dns.rb
truemail-2.7.4 lib/truemail/audit/dns.rb
truemail-2.7.3 lib/truemail/audit/dns.rb
truemail-2.7.2 lib/truemail/audit/dns.rb