Let’s take a closer look at configuring DKIM for EXIM. At Bobcares, with our Server Management Service, we can handle your DKIM issues.
Configuring DKIM For EXIM
DKIM is a protocol that enables an organization to accept responsibility for the transmission of a message by signing outbound mail messages and their headers and validating the signatures on incoming messages. The main functions of DKIM include:
- DKIM initially confirms that the signing domain starts the message exchange.
- DKIM validates signatures on incoming messages as early as possible and signs outbound messages as late as possible.
- The outcome of the validation procedure is added to the message in an “Authentication-Results” header, and DKIM does not block messages.
- Verify the message’s accompanying digital signature to see if it is authentic.
Configuring DKIM For EXIM: A Simple Method
The following steps from our Support team help us to configure DKIM for EXIM.
- Firstly, login to the Exim Server.
- Then create the Dkim folder using the below command:
sudo mkdir /etc/exim4/dkim
- Now create a private key for each domain in the /etc/exim4/dkim folder.
cd /etc/exim4/dkim sudo openssl genrsa -out domain.com-private.pem 2048 -outform PEM
- Then generate the Public key using the command:
openssl rsa -in domain.com-private.pem -out domain.com-public.pem -pubout -outform PEM
- Also, create the /etc/exim4/conf.d/main/00_local_macros file with the command:
sudo nano /etc/exim4/conf.d/main/00_local_macros
- Now, complete the content.
DKIM_CANON = relaxed DKIM_SELECTOR = 20200422
# Get the domain from the outgoing mail. DKIM_DOMAIN = ${sg{${lc:${domain:$h_from:}}}{^www\.}{}}
# The file is based on the outgoing domain name in the From header. DKIM_FILE = /etc/exim4/dkim/{DKIM_DOMAIN}-private.pem
# If a key exists then use it, else don't. DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
- Now set the permissions on the file using the code:
sudo chown -R Debian-exim:Debian-exim /etc/exim4/dkim/ sudo chmod 640 /etc/exim4/dkim/*
- Then update the /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost file.
sudo nano /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost
- Add the following code to the bottom of the file and save it.
.ifdef DKIM_DOMAIN dkim_domain = DKIM_DOMAIN .endif .ifdef DKIM_SELECTOR dkim_selector = DKIM_SELECTOR .endif .ifdef DKIM_PRIVATE_KEY dkim_private_key = DKIM_PRIVATE_KEY .endif .ifdef DKIM_CANON dkim_canon = DKIM_CANON .endif .ifdef DKIM_STRICT dkim_strict = DKIM_STRICT .endif .ifdef DKIM_SIGN_HEADERS dkim_sign_headers = DKIM_SIGN_HEADERS .endif
- Now update the Exim4 Configuration using the command:
sudo update-exim4.conf
- Finally, restart the Exim4 Service with the below command:
sudo service exim4 restart
With these steps, the configuration of DKIM for EXIM is complete. Now, emails from DKIM-enabled domains will be signed.
[Need help with another query? We’re available 24/7.]
Conclusion
To summarize, we have briefly explained the steps from our Tech Support for configuring DKIM for EXIM.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
This used to work but with Exim 4.94 or later, it generates the “Tainted filename” error because the domain names are derived directly from the headers of the outgoing mail.
Do you have a fix for this?
Hi Roger,
Please contact our support team via live chat(click on the icon at right-bottom).
Hi Roger, Hiba
Could you please share the fix?
Thank you
Hello ManuG,
Our experts can help you with the issue.we will be happy to talk to you through our live chat(click on the icon at right-bottom).