Install & Setup
Install
apt install opendmarc
# R8
yum install opendmarc # epel
Config
/etc/opendmarc.conf
# "Authentication-Results:" header field AuthservID OpenDMARC # tells OpenDMARC to trust authentication result with mail.yourdomain.com TrustedAuthservIDs mail.yourdomain.com # By default, OpenDMARC won’t reject emails RejectFailures true # ignore SMTP clients that are successfully authenticated via SMTP AUTH. IgnoreAuthenticatedClients true # if an incoming email doesn’t have From: header or date: header, it will be rejected. RequiredHeaders true # This will make OpenDMARC perform a fallback SPF check itself when it can find no SPF results in the message header. SPFSelfValidate true # mkdir -p /var/spool/postfix/opendmarc # chown opendmarc:opendmarc /var/spool/postfix/opendmarc -R # chmod 750 /var/spool/postfix/opendmarc/ -R # adduser postfix opendmarc Socket local:/var/spool/postfix/opendmarc/opendmarc.sock
systemctl enable opendmarc --now
postfix config
main.cf
milter_default_action = accept milter_protocol = 6 smtpd_milters = local:opendkim/opendkim.sock non_smtpd_milters = $smtpd_milters
# 當使用 opendkim 時
smtpd_milters = local:opendkim/opendkim.sock,local:opendmarc/opendmarc.sock