Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

spf_installer

Discussion in 'General Discussion' started by akamaras, Mar 20, 2016.

  1. akamaras

    akamaras Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    Likes Received:
    1
    Trophy Points:
    53
    I want to run the spf_installer script for all cpanel users using a simple bash script but not change spf records for accounts that already have one.

    Running spf_installer --help I saw that there are options for overwrite and preserve

    I tried something like the following
    Code:
    /usr/local/cpanel/bin/spf_installer user 0 0 1
    but the existing spf records got replaced by the default ones.

    What command should I issue so that any existing spf records are not overwritten by the command and any existing spf records are preserved?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,396
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    You could generate a list of accounts that require SPF records by searching /var/cpanel/users/$username for the "HASSPF=1" entry. EX:

    Code:
    grep HASSPF=1 /var/cpanel/users/*
    Any account with the HASSPF=1 entry already has an SPF record enabled, so you could exclude these users in your script.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. akamaras

    akamaras Member

    Joined:
    Dec 16, 2009
    Messages:
    22
    Likes Received:
    1
    Trophy Points:
    53
    Hi Michael

    Thank you very much for the answer!!!
    I could use "HASDKIM=1" in the same way, to find out the users that already have dkim keys?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,396
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Yes, the "HASDKIM=1" entry is also populated in those files the same way.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...
Similar Threads - spf_installer
  1. Haym
    Replies:
    14
    Views:
    667

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice