DKIM Not Working On AlmaLinux 9 with CWP


INTRODUCTION

If DKIM signature isn’t working or showing when sending emails.

Make sure you have your DKIM TXT file in the DNS.
If it is, and DKIM still isn’t showing, the below will probably fix the error with CWP on AlmaLinux 9.


READ ME FIRST

This article is provided as a courtesy.
Installing, configuring, and troubleshooting third-party applications is outside the scope of basic support provided by Starburst Services.

We are not liable for any damages and/or data loss.


REQUIRMENTS

  • SSH credentials or File Manager access Logged In as Root
  • Text editor of your choice. (The example uses nano)

PROCEDURE

STEP 1

Make sure OpenDKIM and OpenDKIM-Tools are installed:

dnf install opendkim opendkim-tools

STEP 2

Make sure OpenDKIM is Started & Enabled at startup:

systemctl start opendkim
systemctl enable opendkim

STEP 3

Verify your /etc/opendkim.conf looks like:

nano /etc/opendkim.conf
AutoRestart             Yes
AutoRestartRate         10/1h
LogWhy                  Yes
Syslog                  Yes
SyslogSuccess           Yes
Mode                    sv
Canonicalization        relaxed/simple
ExternalIgnoreList      refile:/etc/opendkim/TrustedHosts
InternalHosts           refile:/etc/opendkim/TrustedHosts
KeyTable                refile:/etc/opendkim/KeyTable
SigningTable            refile:/etc/opendkim/SigningTable
SignatureAlgorithm      rsa-sha256
Socket                  inet:8891@localhost
PidFile                 /var/run/opendkim/opendkim.pid
UMask                   022
UserID                  opendkim:opendkim
TemporaryDirectory      /var/tmp

STEP 4

Now that you’ve made sure OpenDKIM is installed and running, it’s time to implement Postfix DKIM.
Let’s follow the Postfix OpenDKIM configuration process.

Edit Postfix main configuration file:

nano /etc/postfix/main.cf

Add the following lines at the end of the main.cf file, only if they are missing:

milter_default_action = accept
milter_protocol = 6
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891

Save and close the file.


STEP 5

Restart OpenDKIM and Postfix:

systemctl restart opendkim
systemctl restart postfix

Now, you’ve configured OpenDKIM with Postfix on AlmaLinux 9.

Send a test email using a test site like mail-tester.com


Thanks for learning with Starburst Services.

Learn more about our services


Did you found this Knowledge Base Article useful?

Please considering thanking our SysOp Team.


KB Article Written: 2024-08-20
KB Article Updated: 2024-12-29

people found this article helpful. What about you?