This article will help to how to add SPF records for all accounts on cPanel server

Advertisement
1. For Single Account

cPanel provides scripts to add SPF record in accounts. If you want to add SPF record in single account use following command as root user.

# /usr/local/cpanel/bin/spf_installer <username>

<username> : cPanel account name to which SPF need to configure.

2. For All Accounts

Use following script to add SPF records for all accounts on cPanel server.

# for USER in /var/cpanel/users/*; do /usr/local/cpanel/bin/spf_installer "${USER##*/}"; done

Reference:

http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/EmailAuthentication

Share.

3 Comments

  1. RoseHosting on

    first of all, thank you for sharing such useful information. it’s always a pleasure to read great helpful articles.

    however, you have a typo in your ‘one-liner’ that you may want it fixed. It should be ‘$USER’ instead of ‘$USRE’.

    as for the one liner, you can use the following recommended and simpler solution:

    [code]# for USER in /var/cpanel/users/*; do /usr/local/cpanel/bin/SPF_installer “${USER##*/}”; done [/code]

    thanks

Leave A Reply