It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
Howdy, Stranger!
It looks like you've been lurking for a while.
If you register, we also will remember what you have read and notify you about new comments. You will also be able to participate in discussions.
So if you'd like to get involved, register for an account, it'll only take you a minute!
screen -U -S opendkim-screen
yum update -y
wget -P /tmp http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh /tmp/epel-release-6-8.noarch.rpm
rm -f /tmp/epel-release-6-8.noarch.rpm
Installing OpenDKIM
Install the package using yum:
yum install opendkim -y
OpenDKIM configuration
The next thing to do is to configure OpenDKIM. Its main configuration file is located in /etc/opendkim.conf, so before making any changes create a backup:
cp /etc/opendkim.conf{,.orig}
nano /etc/opendkim.conf
and add/edit the following:
AutoRestart Yes
AutoRestartRate 10/1h
LogWhy Yes
Syslog Yes
SyslogSuccess Yes
Mode sv
Canonicalization relaxed/simple
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
KeyTable refile:/etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
SignatureAlgorithm rsa-sha256
Socket inet:8891@localhost
PidFile /var/run/opendkim/opendkim.pid
UMask 022
UserID opendkim:opendkim
TemporaryDirectory /var/tmp
mkdir /etc/opendkim/keys/your_domain.comadd your_domain.com to OpenDKIM’s key table:
opendkim-genkey -D /etc/opendkim/keys/your_domain.com/ -d your_domain.com -s default
chown -R opendkim: /etc/opendkim/keys/your_domain.com
mv /etc/opendkim/keys/your_domain.com/default.private /etc/opendkim/keys/your_domain.com/default
nano /etc/opendkim/KeyTableby adding the following record:
default._domainkey.your_domain.com your_domain.com:default:/etc/opendkim/keys/your_domain.com/defaultnext, edit /etc/opendkim/SigningTable:
nano /etc/opendkim/SigningTableand add the following record to OpenDKIM’s signing table:
*@your_domain.com default._domainkey.your_domain.comand in /etc/opendkim/TrustedHosts:
nano /etc/opendkim/TrustedHostsadd your domain and your hostname as trusted hosts:
127.0.0.1
your_domain.com
your_servers_hostname.com
You can find information about your public key in /etc/opendkim/keys/your_domain.com/default.txt file:
cat /etc/opendkim/keys/your_domain.com/default.txtHere is how it looks on our DNS management system:
smtpd_milters = inet:127.0.0.1:8891in /etc/postfix/main.cf:
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
milter_protocol = 2
nano /etc/postfix/main.cfNext is adding OpenDKIM to your system’s start-up and start opendkim and restart Postfix using the following commands:
service opendkim start
chkconfig opendkim on
service postfix restart
nano /etc/exim/exim.confand adding the following to the remote_smtp transport:
remote_smtp:restart Exim and Opendkim for the changes to take effect using:
driver = smtp
dkim_domain = $sender_address_domain
dkim_selector = default
dkim_private_key = ${if exists{/etc/opendkim/keys/$sender_address_domain/default}{/etc/opendkim/keys/$sender_address_domain/default}{0}}
dkim_canon = relaxed
dkim_strict = 0
service opendkim start
chkconfig opendkim on
service exim restart
Comments
While tried to install opendkim face following error:
Try this command to install OpenDKIM:
yum install opendkim opendkim-tools --enablerepo=clearos-centos
I get this error to with opendkim when I use this command
systemctl status opendkim
systemd[1]: PID file /var/run/opendkim/opendkim.pid not readable (yet?) after start.
/etc/opendkim.conf
:and i am sure that pidfile line is in opendkim.conf but still all mails without dkim and this error too
systemd[1]: PID file /var/run/opendkim/opendkim.pid not readable (yet?) after start.