DKIM always invalid

SYSTEM INFORMATION
OS type and version Ubuntu 22.04 LTS
Virtualmin version Latest

I added DKIM record for my domain but evertime when i’m sending emails or check using mail tester my DKIM record is not valid, I tried everything but it does not work for me

I’m using cloudflare for adding my DNS record

Can anyone help me? I tried but not getting results

First. Are you hosting your DNS locally or with the registrar.
If with the registrar, you must put the records there.

Virtualmin pretty much ‘just works’ otherwise.

1 Like

Hello,

Virtualmin Pro can automatically update Cloudflare DNS zone for domain. Virtualmin GPL cannot do it, so you should go manually put DKIM records which can be found on either Server Configuration ⇾ Suggested DNS Records: DNS Records page or Server Configuration ⇾ DomainKey Options page.

I’m using cloudflare, I added the DNS record over there but still it says DKIM is not signed

Yes i installed the DKIM and i also added the key in DNS record in cloudflare, but it still says DKIM is not signed

Sound like that is something you need to raise with cloudflare

whats mxtools reporting?

What should I do? Any solution

Mxtools report the DKIM is correct

Send a email to a google address and use Show Original, does it show this?
image

Please check there is no DKIM

weird, you have enable on outbound?

Yes i do

Hmm, never had that that issue, has always worked. Not sure what would stop it working. Virtualmin should add DKIM record onto the outbound mail, I presume thats not happening for some reason.

this should be in the header

Maybe OpenDKIM isn’t working.

in the postfix config you should have these 3 lines in the main.cf

image

When you send a email check the mail log for errors.

Also try adding the domain in the “Extra Domains to sign for” section.

Hello,

I assume that DNS record is fine, as mxtoolbox says that the test have succesfully passed. On the other hand, gmail says that the email have not been signed by DKIM, so I assume there will be problem with opendkim tool.

My guess is that it will be related to “default” DKIM selector, as we can see from a picture you have posted → There should be a DKIM selector you have selected when enabling DKIM. “Default” is a problem I guess.

I would try to disable and enable it again from scratch. Maybe reinstallation of opendkim helps if issue persist? I know that once upon a time, in /etc, there was afew configuration files which described with which key is opendkim supposed to sign specified domains, but right now I can not find those files.

Can you share exact file location where should I check?

I don’t know how to reinstall the OpenDKIM
Does I need to reinstall the virtualmin?

That should be last resort.

Reinstall the virtualmin?