cPanel does not have an interface to enable DKIM like we have for SPF and Domain Keys. cPanel is still working on it for getting it implemented. However we can enable it manually by following the below steps.
Check if exim is compiled with DKIM support enabled.
root@server # /usr/sbin/exim -dd 2>&1 | grep Experimental_DKIM
Support for: crypteq iconv() IPv6 PAM Perl OpenSSL Content_Scanning Old_Demime Experimental_SPF Experimental_SRS
Experimental_DomainKeys Experimental_DKIM
Generate the SSL keys
cd /usr/local/cpanel/etc/eximopenssl genrsa -out dkim.key 1024
openssl rsa -in dkim.key -out dkim.public -pubout -outform PEM
You will find two keys, dkim.key & dkim.public
Open dkim.public and copy the contents excluding the –Begin– and –End– section. This is your DKIM key. Now open exim configuration file and append the below entries under the section ‘remote_smtp’
Sample file: vi /etc/exim.conf
——————————-
remote_smtp:
driver = smtp
#
dkim_domain=your_domain_name.com
dkim_selector=mail
dkim_private_key=/usr/local/cpanel/etc/exim/dkim.key #path to the dkim.key key.
interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}
{$primary_hostname}}
————————–
Now on WHM, open DNS editor for the particular domain and add the TXT entry with DKIM key like below.
————————–
mail._domainkey.domain_name.com. IN TXT "v=DKIM1; g=*; k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDv4PSEM9P
cxlI2tRojAUQ9hpRQ0Zj/XM4SK08/Drhm/CaspJAKZF9rZDAw18TrfuXeRgsMWAdS2vJ4Oa/kXqX0NM2eBJcmasu4GeNXANmXvC1umz+8mC6r
EPlE/Ucau4tmAHOZL0HJ9IDd/PIxoTkeTm3mjGeqvKBLbdvVIDXbcQIDAQAB"
————————–
Here p=the_key_you_have_copied_from_dkim.public
Restart exim and named services.
/scripts/restartsrv exim
/scripts/restartsrv named
To check whether DKIM is setup properly, send a mail to dkimtest@atmail.org , if setup properly, you will get a reply like below ,else a failure message.
—————————————————-
Subject: AutoReply from dkimtest@atmail.org
From: spftest@your_domain_name.com
Date: Sun, May 23, 2013 1:27 am
To: spftest@your_domain_name.com
*** DKIM TEST SUCCESSFUL ***
—————————————————–
Or you can also test from http://www.brandonchecketts.com/emailtest.php
No comments:
Post a Comment