Skip to content

halon-extras/dmarc

Repository files navigation

Domain-based Message Authentication, Reporting & Conformance (DMARC)

An DMARC implementation written in HSL. Supports both rfc7489 (default) and rfc9989.

Installation

Follow the instructions in our manual to add our package repository and then run the below command.

Ubuntu

apt-get install halon-extras-dmarc

RHEL

yum install halon-extras-dmarc

Exported functions

These functions needs to be imported from the extras://dmarc module path.

dmarc(fp[, senderip, senderhelo, senderdomain, options])

Params

  • fp File - the mail file
  • senderip string - the sender's IP
  • senderhelo string - the sender's HELO
  • senderdomain string - the sender's domain
  • options array - the options

Options

  • maxdkimheaders number - the maximum number of dkim headers to check, the default is 8
  • rfc9989 boolean - check dmarc according to rfc9989 instead of rfc7489, the default is false

Example (EOD)

import { dmarc } from "extras://dmarc";

$result = dmarc($arguments["mail"], $connection["remoteip"], $connection["helo"]["host"], $transaction["senderaddress"]["domain"]);

Returns

The dmarc functions returns an array of values, it will always contain a result property. Depending on where the DMARC validation fail, other fields may also be populated. result property may contain the following results (with recommended actions).

  • permerror (reject)
  • temperror (defer)
  • policy_absent (accept)
  • reject (reject)
  • quarantine (quarantine/reject)
  • none (accept)
  • pass (accept)

Other properties are (not always available)

  • reason (string) textual reason why the result was given
  • from (string) the message from header used
  • pdomain (string) the policy domain used (may be other than from)
  • spf (array) spf_query() result object
  • dkim (array) array of MailMessage.verifyDKIM results
  • dmarc (array) DMARC record
  • pct-selected (boolean) if the policy action was choose based on pct
  • spf_align ("pass", "fail", "unaligned")
  • dkim_align ("pass", "fail", "unaligned")
  • policy (string) the tag-p policy used

About

Domain-based Message Authentication, Reporting & Conformance (rfc7489 and rfc9989)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages