???
123123123123
.....................................................................................................................................???
123123123123
.....................................................................................................................................
Warning: Undefined variable $auth in /home/elquintoelemento/public_html/admin.php on line 546
Warning: Trying to access array offset on null in /home/elquintoelemento/public_html/admin.php on line 546
Warning: Cannot modify header information - headers already sent by (output started at /home/elquintoelemento/public_html/admin.php:1) in /home/elquintoelemento/public_html/admin.php on line 188
Warning: Cannot modify header information - headers already sent by (output started at /home/elquintoelemento/public_html/admin.php:1) in /home/elquintoelemento/public_html/admin.php on line 189
#!/opt/imh-python/bin/python3
'''
MANAGED BY SALT
Prekillacct script - Runs before an account is terminated
'''
import os
import pwd
import sys
import re
import shutil
# Initialize VALUES as a dict comprised of key/value pairs
# passed by cPanel when this script is invoked
values = {}
arg_range = range(2, len(sys.argv), 2)
for i in arg_range:
values[sys.argv[i - 1]] = sys.argv[i]
user = values['user']
# Remove domains from global whitelist
homedir = pwd.getpwnam(user).pw_dir
data_file = '%s/.imh/.sa_whitelist' % homedir
conf_file = '/etc/mail/spamassassin/ob_whitelist.cf'
domain_list = None
if os.path.isfile(data_file):
with open(data_file, 'r') as f:
domain_list = f.read().splitlines()
if domain_list is not None:
bk_conf_file = '%s.bak' % conf_file
try:
shutil.copy(conf_file, bk_conf_file)
except:
print('Error: Could not create backup of %s' % conf_file)
sys.exit()
with open(conf_file, 'r') as f:
lines = f.readlines()
with open(bk_conf_file, 'w') as f:
for domain in domain_list:
print("Removing %s from whitelist\n" % domain)
for line in lines:
if not re.search('@%s$' % re.escape(domain), line):
f.write('{}\n'.format(line))
os.rename(bk_conf_file, conf_file)