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!

Need advice on postwwwacct addition to add in automatic domain keys and spf records

Discussion in 'General Discussion' started by meonsite, Apr 5, 2011.

  1. meonsite

    meonsite Member

    Aug 10, 2006
    Likes Received:
    Trophy Points:
    Hey guys, I read on a few blogs about adding in code at the end of postwwwacct to add dkim and spf to new accounts.

    This is what is there already..

    root@server [~]# vi /scripts/postwwwacct
    iplist =[]

    q = 0
    while q < len(iptaglist):
    q = q + 1

    f = open('/var/cpanel/userdata/' + newuser + '/main')
    ydata = yaml.load(f)
    sublist = ydata['sub_domains']
    addondict = ydata['addon_domains']
    parkedlist = ydata['parked_domains']
    domainlist = ydata['main_domain']
    domain = domainlist
    docroot, yip, alias = createvhosts.getvars(domain)
    if yip == iplist[0]:
    createvhosts.writeconfshared(newuser, domain, docroot, yip, alias)
    createvhosts.writeconfded(newuser, domain, docroot, yip, alias)

    proc = subprocess.Popen("/etc/init.d/nginx restart > /dev/null 2>&1", shell=True)
    output = proc.communicate()

    print "\nStarting install of Domainkeys\n";
    my %OPTS = @ARGV;
    my $user = $OPTS{'user'};
    print "\nDone with install of Domainkeys\n";exit;


    It's not working for the new accounts, but I did run the scripts to get all the existing accounts dkim and spf and verified it was setup right on those accounts. So I just need a way to make it automatic for existing accounts. Is it because python code is on the top half of it and the commands I am using are perl?

    Kind of know just enough to be dangerous.
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Oct 2, 2010
    Likes Received:
    Trophy Points:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Re: Need advice on postwwwacct addition to add in automatic domain keys and spf recor

    You are correct that you wouldn't be able to have Python and Perl code intermeshed in one script file. You'll need to pick one language or the other to perform the operations.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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