This guide is based off of these pages :



  • Enable the EPEL yum
  • Install dkim-milter
    sudo yum install dkim-milter
  • Generate keys
    dkim-genkey -r -d
    sudo mkdir /etc/mail/dkim-milter/keys/
    sudo mv default.private /etc/mail/dkim-milter/keys/
    sudo mv default.txt /etc/mail/dkim-milter/keys/
    sudo chown -R dkim-milter:dkim-milter /etc/mail/dkim-milter/keys/
  • Paste the contents of default.txt into your zone file
    cat /etc/mail/dkim-milter/keys/ >> /var/named/chroot/var/named/
  • Modify your zone file’s serial number to reflect that fact that you’ve changed it. This is necessary for the changes to be propogated
  • Change settings in /etc/mail/dkim-milter/dkim-filter.conf.orig
    • AutoRestart yes
    • Domain
    • Selector default
    • Socket inet:20209@localhost
    • Syslog Yes
    • X-Header Yes
  • Modify /etc/mail/dkim-milter/keys/keylist
  • Modify /etc/postfix/
    # dkim-milter setup
    smtpd_milters = inet:localhost:20209
    non_smtpd_milters = inet:localhost:20209
    milter_protocol = 2
    milter_default_action = accept
  • Tell dkim-filter to listen on a port instead of a socket. This is required because the init script hard codes to a socket and doesn’t respect the setting in the /etc/mail/dkim-milter/dkim-milter.conf file.
    sudo echo "SOCKET=inet:20209@localhost" >>/etc/sysconfig/dkim-milter
  • Start it up
    sudo service dkim-milter start
    sudo service postfix restart
    sudo service named reload
  • Test it out