Page tree
Skip to end of metadata
Go to start of metadata

Overview

The /bin/spf_install script allows you to add an SPF record to all of a user's domains' zone files from the command line.

Note:

On servers that run CentOS 7, you may see a named warning about the absence of SPF resource records on DNS.

  • This warning is not relevant on CentOS 7 servers, because RFC 7208 deprecated SPF records. CentOS 7 servers use TXT records instead of SPF records.
  • Red Hat 7.1 and CentOS 7.1 both contain bind-9.9.4-23.el7, which is an updated version of bind that complies with RFC 7208. To resolve this issue, update your operating system to a version that contains the updated version of bind. For more information, read the the Red Hat Bugzilla case about SPF record errors.

For more information about SPF records, read our Email Authentication documentation.

Run the /bin/spf_installer script.

To run the /bin/spf_install script from the command line, use the following format:

/usr/local/cpanel/bin/spf_installer [options]

The following table lists the options that you can pass with this script:

Option
Description
Example
userThe username to whose domain(s) you wish to assign an SPF record.John
policyA comma delimited list of SPF records that you wish to assign to or remove from the user's domain.
v=spf1 +a +mx +ip4:10.1.100.35,-ip4:192.168.0.20
complete

Whether the SPF key is a complete SPF entry.

  • A value of 1 indicates that the spf_key option's value is a complete SPF record.
  • A value of 0 indicates that the spf_key option's value is not a complete SPF record.

    Important:

    This option is required when you use the overwrite and preserve options.

 
1
overwrite

Whether to overwrite the existing domain and subdomain SPF records with the value of the policy option.

  • A value of 1 indicates that you wish to overwrite the user's current SPF record.
  • A value of 0 indicates that you do not wish to overwrite the user's current SPF record.

    Important:

    This option is required when you use the preserve option.

1
preserve

Whether to add the new set of keys to the existing records.

  • A value of 1 indicates that you wish to add the policy option's value to the user's current SPF records.
  • A value of 0 indicates that you wish to replace the user's current SPF record with the policy option's value.
0
help Displays the help text for this script. help

If the function is not successful, you will receive the following error message:

Failed to set up SPF for this user.

If the function succeeds, you will not receive confirmation from the command line. To confirm that the function succeeded, navigate to cPanel's Email Authentication interface (Home >> Mail >> Email Authentication) on each domain that the user owns. The SPF status will show as Enabled.