How to force a specific DKIM on all emails

On the past I made a similar question here on the forum, but this time my setup is a little different, so that is the reason for this new forum post.

I use Hestia just as a SMTP Relay for my websites hosted on other servers to be able to send email using SMTP.

On Hestia I use Mailbaby as external Smarthost and have all my webservers IPs set on Exim configuration at: “hostlist relay_from_hosts” so that they can send without authentication (user/pass) or being present as a email domain on Hestia.

So my Hestia just has 1 domain as web a mail domain, and that is the server hostname: hostname.myserver.com. DKIM is enable on Hestia and I added the record to my DNS (that is hosted externally on Cloudflare).

I tested sending a email from a WordPress website using a SMTP plugin and it works! Emails are send and delivered.

There is just one issue: the emails are not being signed with DKIM. I want to force all emails to always be signed with Hestia hostname DKIM.

Can anyone please help me on this? How to force all emails to always be signed with the same Hestia hostname DKIM?

Tried to ask ChatGPT and Grok and they both told me to edit on Exim configuration, the following lines. It did not work.

Thanks

Replace this:

DKIM_DOMAIN = ${lc:${domain:$h_from:}}
DKIM_FILE = /etc/exim4/domains/${lookup{${lc:${domain:$h_from:}}}dsearch{/etc/exim4/domains/}}/dkim.pem
DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}

For this:

DKIM_DOMAIN = hostname.mydomain.com
DKIM_FILE = /etc/exim4/domains/hostname.mydomain.com/dkim.pem
DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}

Issue is resolved!

Solved by comment out send_via_smtp_relay to force emails to use dnslookup.

This post can be closed.

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