Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    8

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

    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):
    iplist.append(str(iptaglist[q].childNodes[0].toxml()))
    q = q + 1



    f = open('/var/cpanel/userdata/' + newuser + '/main')
    ydata = yaml.load(f)
    f.close()
    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)
    else:
    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'};
    system("/usr/local/cpanel/bin/domain_keys_installer",$user);
    system("/usr/local/cpanel/bin/spf_installer",$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. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default 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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. install domain keys & spf record
    By crazyaboutlinux in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 05-13-2010, 08:12 AM
  2. SPF and Domain Keys ...
    By Spiral in forum E-mail Discussions
    Replies: 1
    Last Post: 12-29-2009, 03:36 AM
  3. spf and domain keys - set all to on?
    By impload in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-24-2009, 05:15 AM
  4. SPF, Domain Keys and Other SMTP Server
    By noworyz in forum E-mail Discussions
    Replies: 11
    Last Post: 02-26-2008, 03:50 PM
  5. Automatic massive add of SPF records on all existing domain zones
    By COBRAws in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 09-21-2007, 07:05 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube