Module: MailAuth::Dmarc

Defined in:
lib/mailauth/dmarc.rb,
lib/mailauth/dmarc/record.rb,
lib/mailauth/dmarc/alignment.rb,
lib/mailauth/dmarc/organizational_domain.rb

Overview

RFC 7489 §3.1. Does a domain that SPF or DKIM authenticated stand for the same organization as the From: domain a reader sees?

Defined Under Namespace

Modules: Alignment, OrganizationalDomain Classes: Record

Class Method Summary collapse

Class Method Details

.check(header_from:, spf:, dkim:, resolver: Resolver.new) ⇒ Object

Takes the already-computed SPF and DKIM results — alignment is a comparison, not a check of its own. None or several From: domains is permerror, not none: the message is malformed, not simply unpolicied.



13
14
15
16
17
18
19
# File 'lib/mailauth/dmarc.rb', line 13

def check(header_from:, spf:, dkim:, resolver: Resolver.new)
  if domain = sole_domain(header_from)
    evaluate(domain, spf: spf, dkim: dkim, resolver: resolver)
  else
    DmarcResult.new(status: Status::PERMERROR)
  end
end