Comments on Set Up DKIM (DomainKeys Identified Mail) Working With Postfix On CentOS Using OpenDKIM
Set Up DKIM (DomainKeys Identified Mail) Working With Postfix On CentOS Using OpenDKIM This tutorial shows how to get DKIM working on a CentOS box running Postfix using OpenDKIM, I'll also cover some simple trouble shooting tips and advice for future upgrade on your OpenDKIM installation.
14 Comment(s)
Comments
useradd -r -g -s /sbin/nologin opendkim
generates the error:
useradd: group '-s' does not exist
on centOS 6.4
Use -U instead of -g
yum install libbsd.x86_64 libbsd-devel.x86_64
Hey there, how can I install Dkim in my server, I setup my server using this tutorial: https://www.howtoforge.com/perfect-server-centos-7-apache2-mysql-php-pureftpd-postfix-dovecot-and-ispconfig3
Thanks in advance
Thanks for this guide, worked like a charm.
I got an error regarding de compiler which was solved by installing the development package:
yum groupinstall "Development Tools"
Thank you. It helps us a lot setting this up.
This command:
/usr/local/bin/opendkim-genkey -D /etc/opendkim/keys/example.com/ -d example.com -s default
generates the error (with the -- currently -- latest version of OpenDKIM - 2.10.3 and CentOS 6.7 Final):
bash: /usr/local/bin/opendkim-genkey: No such file or directory
The correct command should be:
/usr/local/sbin/opendkim-genkey -D /etc/opendkim/keys/example.com/ -d example.com -s default (the binary is in sbin, not bin)
Thanks for the guide. Really useful.
i have tried your recommendation and i still get the no such file error. I have opened up filezilla and looked for the folder/file as will and there is nothing
did i miss a step?
Excellent tutorial - worked fine for me with CentOS7. However, I do have selinux enabled so there are few things one needs to do to make opendkim work from step 10 (Start opendkim and restart postfix).
The standard SELinux expected location for the binaries (see http://linux.die.net/man/8/dkim_milter_selinux) is /usr/sbin, whereas here the binaries are built to /usr/local/sbin. So you need
semanage fcontext -a -t dkim_milter_exec_t "/usr/local/sbin/opendkim"
restorecon -v /usr/local/sbin/opendkim
Otherwise, the opendkim process doesn't have the correct process type and thus the correct selinux "profile" to access the files it needs to, as well as to become a listener on its correct port 8891.
I also had to:
mkdir /var/run/opendkim
restorecon -Rv /var/run/opendkim
You may also find you have to "allow" port access (I think this depends on the history of the server, so I accept some may not need this):
semanage port -a -t milter_port_t -p tcp 8891
Hope this helps (2016-04-08)
Is it any special reason to compile opendkim 2.4.2 from source instead of using opendkim 2.10.3 from epel library? I'm hoping it's just that this article is old (don't see any date, only hint is rhel6.3)
The article is for RHEL / CentOS 6.3 as mentioned in the text. If you use CentOS 7, then better use the EPEL package.
Thanks for the step-by-step tutorial. Thanks also to those who posted update comments for later versions.
I run the commands from Jay, and copy the default.private key to /etc/opendkim/keys/ (mv /etc/opendkim/keys/example.com/default.private /etc/opendkim/keys/example.com/default doesn´t work properly), and add milter_protocol 2 to main.cf from postfix (i´m using centos 6.9); and after that it works.
./configure --sysconfdir=/etc --prefix=/usr/local --localstatedir=/var line doesn't works, it shows error as :
checking for library containing ERR_peek_error... none required
checking for library containing SSL_library_init... none required
checking whether SHA256_DIGEST_LENGTH is declared... yes
checking for milter library and includes... configure: error: milter not found
please let me how can i install