Skip to main content

Removing and adding SPF files to cPanel accounts.

Comments

1 comment

  • cPRex Jurassic Moderator

    Hey there!  We do have a tool for this you can find at https://api.docs.cpanel.net/specifications/cpanel.openapi/email-dns-settings/emailauth-install_spf_records

    This will install an SPF record on one or more domains, replacing what is already there.  You can just pass multiple domains to the installer with your desired record, such as this example showing two domains:

    whmapi1 install_spf_records \
      domain-1=example.com record-1='v=spf1 a mx include:spf.example.net -all' \
      domain-2=example.net record-2='v=spf1 a mx include:spf.example.net -all'

    This API call also updates the zone's serial number, so you don't need to do any additional work there.

    As always, I would make a backup of your records first, and test this on an individual or small batch of domains before applying it to all 500 accounts.

    0

Please sign in to leave a comment.