DKIM fails, how to handle connection to main server domain

SYSTEM INFORMATION
Rocky Linux 9.1, Almalinux 9.1 in Virtualnin REQUIRED
Virtualmin 7.5 REQUIRED

I am hosting a server at Netcup Gmbh and that server has an identical name domain.
Virtualmin uses this domain when I log in as root.
I have created multiple users/domains with external DNS, with email addresses among them.
Everything is protected with SSL certificates.
Then about DKIM.
Virtualmin provides a private and public key that is valid for the root domain and the underlying domains, at least thatā€™s what I read in Virtualminā€™s screen.
Now I use the public key in the DNS of the domains that I have all hosted externally, except for the main domain.
You may already have sensed it coming: The DKIM key in the sent e-mail is a completely different one and it is rejected. This is because the DNS contains the DKIM key created from the main domain.
Example of a domain where DKIM goes wrong: karimari.nl
My question is: How can I handle the main server domain / How do I make sure that the created key in Virtualmin is correct?

I hope You can help me with this issue, I canā€™t find it in internet sources.

@mterlouw,

A single DKIM private/public key is created for ALL domains hosted by your server. It should be used for ALL mail being sent by that server.

If a domain is being sent by a ā€œdifferentā€ server, the DKIM key for that server would be added to your DNS instead.

1 Like

Thank you so much

Dear

Thank you for your contribution.
In Virtualmin, I searched for the serverā€™s DNS recorders. Those are at the DNS host.
From there, I copied the _domainkey TXT-record to the domain whose email I am testing and voila, it works WELL now!!!.
That confusion is at an end.

The mail server now sends ā€˜vserver.localdomainā€™ as the server name in the header.
Do you perhaps also know where I can change the hostname in an Almalinux 9.1 system with postfix?

Kind regards, Mari

Found the solution also for ā€œhe mail server now sends ā€˜vserver.localdomainā€™ as the server name in the header.ā€:

in directory /etc/postfix is the configuration file main.cf
In the section # INTERNET HOST AND DOMAIN NAMES we can add the hostname we like to use in the e-mail header of the sent mail.
After adding an existing one in the DNS where the servername is mentioned, the right servername will be there.

For me the result is fine.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.