I’ve been facing a number of problems on a fresh intall for five days and I’m starting to despair, so I sure hope someone can advice on a new problem. DKIM won’t start through the Virtualmin form, I get the following error. . .
Starting DKIM filter …
… start failed : Starting dkim-milter (via systemctl): Job for dkim-milter.service failed. See ‘systemctl status dkim-milter.service’ and ‘journalctl -xn’ for details. [FAILED]
Checking systemctl I get this. . .
Jan 13 10:03:32 en3.example.com systemd[1]: Starting SYSV: DomainKeys Identified Mail Milter…
Jan 13 10:03:32 en3.example.com runuser[31821]: pam_unix(runuser:session): session opened for user dkim-milter by (uid=0)
Jan 13 10:03:32 en3.example.com dkim-milter[31820]: Starting DomainKeys Identified Mail Milter (dkim-filter): dkim-filter: smfi_opensocket() failed
Jan 13 10:03:32 en3.example.com dkim-milter[31820]: [FAILED]
Jan 13 10:03:32 en3.example.com systemd[1]: dkim-milter.service: control process exited, code=exited status=1
Jan 13 10:03:32 en3.example.com systemd[1]: Failed to start SYSV: DomainKeys Identified Mail Milter.
Jan 13 10:03:32 en3.example.com systemd[1]: Unit dkim-milter.service entered failed state.
Doing some further investigation, I checked the /run/dkim-milter directory and the last modified date is 2010 (this is a fresh VPS install in 2015!). Investingating further the status of dkim-milter it appears to be a dead project and the bugs are catastrophic.
DKIM is now a critical part of mail delivery and should not be considered an ‘option’ (for example, Hotmail automatically null route any email not DKIM signed). Recommend Virtualmin team consider urgently removing dkim-milter and replacing with opendkim, this issue appears to be dead in the water otherwise.
Did you solve the problem?
In my case (CentOS 7 too), dkim started only first time after installation. After reboot I received similar errors.
After research I saw that folder /var/run/dkim-milter is missing.
If this is your case too, I resolved my problem creating a small script:
#!/bin/bash
mkdir /var/run/dkim-milter
chown dkim-milter:dkim-milter /var/run/dkim-milter
This script must be put in cron and run (as root) @restart
I had same problem and then just removed this old and obsolete script dkim-milter what was abandoned for several years. Aside of this, dkim-milter was the main and only culprit why my Virtualmin would not start with server reboot until manual start over SSH.
For Lanna or anyone else on Centos 7 i would like to suggest to forget dkim-milter and switch to his successor OpenDKIM. In this links you can find all info how to setup OpenDKIM in literally few minutes: http://goo.gl/tfo3W9. Tested on fresh Centos 7 with Virtualmin/Webmin and never had any problem.
The only “downside” if you want to call in this way is you will not be able to configure OpenDKIM with Virtualmin. But if you dont have dozens or hundreds domains you will be able to setup everything in no time. Really, its just 3 or 4 commands per domain with one copy and paste into your DNS.
I know that “virtualmin will install what comes with your distro” but i dont think it would be a problem to change this. Sorry but Centos 7 is new on the market and there is no real excuse to have 2-3 years old script on your server.
If anyone has a solution how to make Virtualmin to work with OpenDKIM on Centos 7 it would be great to hear.
EDIT: Actually time i saw on dkim-milter on my server was from 2010 so its 5 years not 2-3.
Yeah CentOS 7 is using the dkim-milter script that was used with CentOS 6, as it was known to work there.
However, it certainly looks like there’s some trouble in getting it to work on CentOS 7. I’ll talk to Jamie about switching that over to use opendkim, as opendkim is available in EPEL and will be relatively simple to import into the Virtualmin repository.
Great news Eric. It would be great if we can get OpenDKIM at least for Centos 7. These days if you send email without rDNS, SPF and DKIM there is big chance your mail will end in spam folder or deleted.
I successfully installed opendkim using virtualmin control panel. However still fail to start the service.
When I try to enable dkim, I see following error.
Finding virtual servers to enable DKIM for ..
.. no virtual servers with DNS and email enabled were found, but enabling for 3 extra domains
Extracting public key from private key in /etc/opendkim/keys/default.private …
… done
Setting domain and selector in DKIM filter configuration …
… done
Enabling DKIM filter at boot time …
… done
Starting DKIM filter …
… start failed : Job for opendkim.service failed. See ‘systemctl status opendkim.service’ and ‘journalctl -xn’ for details.
DKIM setup failed!
Can you help me solve this problem? I’m using centos7
well, the problem seems to be that postfix starts before the dkim-milter? Can you confirm?
BECAUSE…
the directory /var/run/dkim-milter was not there…
at first I tried to create it manually mkdir /var/run/dkim-milter
chown dkim-milter:dkim-milter /var/run/dkim-milter
but at the reboot it got deleted ! (why?)
so i put that in the script and @reboot /path/to/script.sh from crontab
after the reboot the directory was there…
BUT the dkim-milter didn’t start properly service Active: activating… and also dkim-filter[1133]: can’t write pid to /var/run/dkim-milter/dkim-milter.pid: No such file or directory
I tried to save again with Virtualmin DomainKeys Identified Mail
again failed to start because of dkim-filter[4671]: Sendmail DKIM Filter: Unable to bind to port inet:8891@localhost: Address already in use the PID 1133 was still there…
I had to kill the PID 1133
service dkim-milter stop
service dkim-milter start
service postfix restart
and now is active running… the dkim-milter.pid is regularly inside the /var/run/dkim-milter directory
who’s able to explain what’s the issue here?
Do I need to do all this at any reboot OR how to avoid this stuff?
thank you
apart from the fact that at the end of the script
I wrote service postfix start but it didn’t start… why? can’t be started from the sh script in that way?
then, the problem is always a bad PID which is there to do nothing dkim-filter[2070]: can’t write pid to /var/run/dkim-milter/dkim-milter.pid: No such file or directory
again, I had to kill that 2070 and go on with service stop/start postfix start or restart…
please, andreychek or Jamie… can you help to avoid to do this any time? thanks