The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

spf_installer

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

  1. akamaras

    akamaras Member

    Joined:
    Dec 16, 2009
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    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:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    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.
     
  3. akamaras

    akamaras Member

    Joined:
    Dec 16, 2009
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    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:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, the "HASDKIM=1" entry is also populated in those files the same way.

    Thank you.
     

Share This Page