Tuesday, 8 September 2015

Enable DKIM and SPF for all accounts in cPanel

Email authentication lets you verify the origin of an email message sent to or from your domain. This feature assists in combating spam, or unwanted email.

What is DKIM?

DKIM (DomainKeys Identified Mail) provides a way to verify the sender and integrity of a message. It allows an email system to prove that a message was not altered during transit (meaning it is not forged), and that the message came from the specified domain.

Enable or disable DKIM

    Click Enable to enable DKIM.
    Click Disable to disable DKIM.

Note: DKIM is only effective if enabled on the authoritative DNS server for the zone.

What is SPF?

Sender Policy Framework (SPF) allows a recipient server to verify that an email message was truly sent from the domain specified in the From: field. Enabling SPF can prevent your server from receiving replies to spam that forged your domain name as part of the sender’s address (also known as “backscatter”).

SPF works by specifying which servers are authorized to send email from your domain. Only mail sent through an authorized server will appear as valid when a recipient checks a message’s SPF records.
Enable or disable SPF

Click Enable to enable SPF or click Disable to disable SPF.

Note: SPF is only effective if enabled on the authoritative DNS server for the zone and if both the sending and receiving mail servers have SPF enabled.

Change advanced SPF settings

Click Add or Remove to add or remove additional hosts, servers, and IP blocks in the corresponding lists.

Click the All Entry (ALL) box if you have entered all hosts that will send to your domain and wish to exclude all other domains.

Click the Overwrite Existing Entries box if you wish to overwrite all existing SPF records for all your domains with these settings.

If you need to enable DKIM and SPF for all accounts in cPanel, it is not possible to manually enable them via cPanel. In that case you can use the following script.

for user in `ls -A /var/cpanel/users` ; do /usr/local/cpanel/bin/dkim_keys_install $user &&/usr/local/cpanel/bin/spf_installer $user ; done

That’s it!

No comments:

Post a Comment