Adding SPF Records and Domainkeys in cPanel

Adding Domain Keys for a Single User

/usr/local/cpanel/bin/dkim_keys_install username

Adding Domain Keys for All Users

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

Adding SPF Records for a Single User

/usr/local/cpanel/bin/spf_installer username

Adding SPF Records for a All Users

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

Setup Server to Create DKIM / SPF Records on New Account Creation

vi /scripts/postwwwacct

Add the following at the bottom of the file:

print "\nInstalling DKIM / SPF Records for $name ...";
system("/usr/local/cpanel/bin/dkim_keys_install $name");
system("/usr/local/cpanel/bin/spf_installer $name");

Shell Script for adding SKIM / SPF Records to All Users:

#!/bin/bash
for user in `ls /var/cpanel/users`
do
echo "Installing SPF Record for $user...";
/usr/local/cpanel/bin/spf_installer $user;
echo "Installing DKIM Record for $user...";
/usr/local/cpanel/bin/dkim_keys_install $user;
done


Was this answer helpful?

 Print this Article

Also Read

Assigning a Dedicated IP Address to a Subdomain using WHM

To assign a dedicated IP address to a subdomain, perform the following steps: Step 1: Add the...

Add Autoresponder in Webmail

You can add an autoresponder for your personal email address in Webmail. To create an...

Create Spam Filters for Mailing Lists

This document explains how to create mail filter rules in cPanel's Mailing Lists interface (Home...

Video: Add MX Entry in cPanel

This video tutorial provides Step-by-Step instructions for adding an MX entry in cPanel Shared...

Enable SMTP Authentication for iPhone and iPad

If you're able to receive email on your iPhone / iPad / iPod touch but cannot send email from it,...