Introduction
This article describes how to update existing SPF records for all domains on the server. This is useful if you need to add a new local IP address or remote smart host to all of the records.
Procedure
The utility /usr/local/cpanel/bin/spf_installer can be used to automatically add SPF records to domains owned by an account. The example commands below can be used to add entries to all accounts on the server.
This command would add example.domain.tld to the SPF record for all domains on the server and preserve the existing records:
awk '{print $2}' /etc/trueuserdomains | sort | uniq | egrep -v '^$' | xargs -n 1 -I account sh -c 'echo Installing for account...;
/usr/local/cpanel/bin/spf_installer account include:example.domain.tld is-complete preserve 1; echo Done.'
While this command adds the 192.88.99.21 IP address to the SPF record for all domains on the server and preserves their existing SPF record:
awk '{print $2}' /etc/trueuserdomains | sort | uniq | egrep -v '^$' | xargs -n 1 -I account sh -c 'echo Installing for account...;
/usr/local/cpanel/bin/spf_installer account +ip4:192.88.99.22 is-complete preserve 1; echo Done.'
If you wish to overwrite instead, you can replace preserve with overwrite in the above example commands.
Comments
0 comments
Article is closed for comments.