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.



LinkBack URL
About LinkBacks
Reply With Quote





