OpenDKIM

Installation

pacman -S opendkim
dnf install opendkim opendkim-tools

mkdir /etc/postfix/dkim
chown root:opendkim /etc/postfix/dkim -R

Create config

/etc/opendkim/opendkim.conf

AutoRestart             Yes
AutoRestartRate         10/1h
UMask                   002
Syslog                  yes
SyslogSuccess           Yes
LogWhy                  Yes
SendReports    		    yes
SoftwareHeader    	    yes

Canonicalization        relaxed/simple

KeyTable                /etc/postfix/dkim/KeyTable
ExternalIgnoreList      refile:/etc/postfix/dkim/TrustedHosts
InternalHosts           refile:/etc/postfix/dkim/TrustedHosts
SigningTable            refile:/etc/postfix/dkim/SigningTable

Mode                    sv
SignatureAlgorithm      rsa-sha256
MinimumKeyBits		    1024
OversignHeaders		    From
#QueryCache	        	yes

UserID                  opendkim:opendkim
Socket                  inet:12301@localhost

OversignHeaders		From

Add Dkim to Postfix

/etc/postfix/main.cf

# DKIM
milter_default_action 			= accept
non_smtpd_milters 			= inet:localhost:12301
smtpd_milters 				= inet:localhost:12301

Create directory for socket

mkdir /var/run/opendkim
chown opendkim:opendkim /var/run/opendkim