The spf_installer Script  طباعة

Overview:

The /usr/local/cpanel/bin/spf_installer 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 Deliverability in cPanel documentation.

Note:

The /scripts/enable_spf_dkim_globally script allows you to enable SPF and DKIM for accounts that exist on the server, and to create the appropriate DNS records for their domains. For more information, read our The Enable SPF DKIM Globally Script documentation.

Run the script

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

/usr/local/cpanel/bin/spf_installer username policy complete overwrite preserve

Options

Use the following options with this script:

Options Description Example
username The username to whose domains you wish to assign SPF records. cpaneluser
policy A comma-delimited list of SPF records that you wish to assign to or remove from the user’s domains. v=spf1 +a +mx +ip4:192.0.2.0/24,-ip4:203.0.113.5,+ip6:2001:db8:1a34::/64
complete Whether the SPF key is a complete SPF entry (ends with -all).
  • 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 domains’ and subdomains’ SPF records with the value of the policy option.
  • A value of 1 indicates that you wish to overwrite the user’s current SPF records.
  • A value of 0 indicates that you do not wish to overwrite the user’s current SPF records.
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 append 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. /usr/local/cpanel/bin/spf_installer --help

Success and failure

If the function does not succeed, 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 Deliverability in cPanel interface (cPanel >> Home >> Email >> Email Deliverability) for each domain that the user owns.

هل كانت المقالة مفيدة ؟

مقالات مشابهة

WHM Scripts
Overview: The cPanel & WHM installation process adds important scripts to your server’s...
The dbmaptool Script
Overview: You can use the /usr/local/cpanel/bin/dbmaptool script to grant ownership of databases...
The servers_queue Script
Overview: This script allows you to manage the task queue system. The task queue system allows...
The auto-adjust-mysql-limits Script
Overview: The /usr/local/cpanel/scripts/auto-adjust-mysql-limits script updates MySQL®...
The autossl_check Script
Overview: The /usr/local/cpanel/bin/autossl_check script allows you to manually check the SSL...