The enable_spf_dkim_globally Script

Valid for versions 82 through the latest version



Last modified: February 9, 2021


This script enables SPF and DKIM system-wide. It also creates the appropriate DNS records for all users’ domains. If the system detects that a DKIM record exists for a domain, it will not update it. If it detects that an SPF record exists for a domain, it will update it.


You must run this script as a root-level user.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/scripts/enable_spf_dkim_globally [options]


Use the following options with this script:

Option Description Example
-x Required.
Use this option to run the script.
If you do not use this option, the script dies with a warning message.
--user Specify an account for which to enable SPF and DKIM. The system will also create the DNS record for the user’s domain.
To run this script for multiple users, use this option multiple times. For example, --user=user1 --user=user2.

The --help option will not provide help documentation.

Additional Documentation