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.

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
spf_keysThe SPF record that you wish to assign to the user's domain.
v=spf1 +a +mx +ip4:10.1.100.35
is_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 SPF record with the value of the spf_keys 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 a new set of keys.

  • A value of 1 indicates that you wish to add the spf_keys 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 spf_keys value.

 

0

 

If the function is successful, you will not receive confirmation from the command line. Instead, navigate to the Email Authentication interface (Home >> Mail >> Email Authentication) on each domain that the user owns. The SPF status will show as Enabled.

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

Failed to set up SPF for this user.