Systemd service opendkim cannot be created unless a command is given

Hi

I was having problems with DKIM not being valid for my domains. So I disabled signing of DKIM under e-mail messages in virtualmin. I thought a disable / enable perhaps could help the issue. Now when I try to enable it again, I get this error message:

Systemd service opendkim cannot be created unless a command is given

Status: 
Active

Comments

If you go to Webmin -> System -> Bootup and Shutdown, is an entry for opendkim listed?

I have an entry for opendkim and opendkim.service - not running or set to start at boot. Tried to restart opendkim and got it to run (at least webmin reports is as running). When I tried to set it to start at boot, I got this message:

Failed to save action : Systemd service opendkim cannot be created unless a command is given

I am seeing this too and can't get DKIM signing to work at all.

Which exact Linux distribution and version are you running there?

Hi Jamie Sorry for the late reply. I'm on Ubuntu 16.04.1 Still not sure what is preventing DKIM from working...

I did a apt-get autoremove opendkim and tried to have virtualmin set it up again. It did without errors this time. But opendkim still wasn't enabled.

Tried service opendkim restart and got:

Failed to restart opendkim.service: Unit opendkim.service is masked.

Did a systemctl unmask opendkim and systemctl restart opendkim Now, opendkim is enabled in virtualmin and I can see the private key.

Ok, looks like Webmin needs to umask the opendkim unit in order to enable it. I will fix this in the next Webmin release.

But this is still not working in webmin....... Why has this not been fixed? I have a fresh install ubuntu 16.04. This costs me expensive time. Please help.

I still get this error. No solution.

Error: Finding virtual servers to enable DKIM for .. .. no virtual servers with DNS and email enabled were found, but enabling for 12 extra domains

Extracting public key from private key in /etc/dkim.key .. .. done

Setting domain and selector in DKIM filter configuration .. .. done

Enabling DKIM filter at boot time .. Failed to save DKIM settings : Systemd service opendkim cannot be created unless a command is given

Try SSHing in as root and running systemctl unmask opendkim . Then re-try enabling it in Virtualmin.

Got this problem again on Ubuntu - a systemctl unmask opendkim and systemctl restart opendkim didn't help this time. Getting this again: Failed to save DKIM settings : Systemd service opendkim cannot be created unless a command is given

Tried a

apt-get purge opendkim opendkim-tools

And installing it again through virtualmin - resolved the issue :-)

We're glad to hear it's working for you, thanks for letting us know how you fixed it!

thierry's picture
Submitted by thierry on Tue, 03/12/2019 - 05:22 Pro Licensee

I had the same problem "Failed to save DKIM settings: Systemd service opendkim can not be created unless a command is given" with a Debian9 installation that I solved by doing:

apt-get purging opendkim opendkim-tools -y
apt-get install opendkim opendkim-tools

then go to Email Messages -> DomainKeys Identified Mail Change Signing of outgoing mail enabled? to Yes. Click the Save button.

Thanks