How to set up DKIM

I’ve never been able to send mail from my sites.
Trying to set them up via config mail-enable-dkim-signing I get a popup Opcenter\Admin\Settings\Mail\DkimSigning::set(): rspamd must be enabled.

When I go to config mail – rspamd-piggyback it says it is enabled.

What am I doing wrong?

rspamd is not installed.

rpm -qa rspamd reports nothing. Run cpcmd scope:set mail.rspamd-piggyback true. This will install rspamd and set the appropriate flag in config.ini.

Not sure how mail – rspamd-piggyback shows as enabled but rspmad is not installed.

I tried to do it manually starting with a command I found on Google:

curl -sSL https://rspamd.com/rpm-stable/centos-8/rspamd.repo | sudo tee /etc/yum.repos.d/rspamd.repo

But it fails with a “sudo a password is required” error. If I’m already operating as root using sudo I have no idea how to add a password to the command when it doesn’t prompt for one.

After installation I should do -
sudo dnf install rspamd redis
sudo systemctl enable --now redis
sudo systemctl enable --now rspamd

Which I assume is what your cpcmd scope:set mail.rspamd-piggyback true should have done.

Don’t do this.

upcp -sbv mail/rspamd

Do this.

See also, rspamd | ApisCP Docs

I just did your upcp command but rspamd is still not installed.

I did find that the su password malfunction was caused by 000 permissions on /etc/shadow. Suggested fix was chmod 0400 which I’ve done but su still has a spack attack. Running the latest version of Rocky Linux 8

Do I need to restart the server as exit / restart session makes no difference?

Restarted server and keep getting this -
[root@host ~]# sudo dnf upgrade -y
sudo: PAM account management error: Authentication service cannot retrieve authentication info
sudo: a password is required

Commands + output is necessary if you would like further assistance.

/etc/shadow as 000 is normal on a healthy install.

[root@jib ~]# sudo su -
Last login: Tue Apr 21 17:32:50 EDT 2026 from 10.0.0.7 on pts/1
[root@jib ~]#

lgtm. You may want to check /var/log/secure to ascertain the PAM failure.

You’re already root. sudo is superfluous.

Silly me!

Did upcp again and it went on a lot longer this time.

[root@host ~]# rpm -qa rspamd
rspamd-4.0.1-1.el8.x86_64

Tried to send an email from cyberhorse.com.au to Gmail and it got refused due to no DKIM even though I enabled it successfully. Does it take time to kick in as Gmail has rejected such emails in the past? Also where do I enable SPF?

Had duplicate SFP records. Fixed.
Now I’m getting a DMARC error. DNS says “v=DMARC1; p=reject; sp=reject; adkim=s; aspf=s; rua=mailto:dd33218650be4504a8be960560a2aeac@dmarc-reports.cloudflare.net;”
What is wrong with this?

The final field in the SOA record is how long an NXDOMAIN result is held in cache. Wikipedia has a great entry on all these fields and how they work.

;; ANSWER SECTION:
cyberhorse.com.au.      0       IN      SOA     chloe.ns.cloudflare.com. dns.cloudflare.com. 2402301024 10000 2400 604800 1800

Based upon that result, it’s at least 1800 seconds. MTAs may implement their own discretionary TTLs.

I don’t know. I don’t run Google. You’re getting an “error” but that’s very imprecise.

Have you tried soliciting your DMARC record through a third-party that specializes in it? MXToolbox is a good start. Google Search is a good follow up, but bear in mind I do not run it.