opendkim fix for ubuntu

This commit is contained in:
usmannasir
2018-11-07 22:50:14 +05:00
parent 3d26220341
commit 5fb2b31cbd
3 changed files with 12 additions and 3 deletions

View File

@@ -2867,6 +2867,9 @@ class preFlightsChecks:
command = 'mkdir -p /etc/opendkim/keys/'
subprocess.call(shlex.split(command))
command = "sed -i 's/Socket local:/var/run/opendkim/opendkim.sock/Socket inet:8891@localhost/g' /etc/opendkim.conf"
subprocess.call(shlex.split(command))
except OSError, msg:
logging.InstallLog.writeToFile(str(msg) + " [installOpenDKIM]")

View File

@@ -390,12 +390,14 @@ class MailServerManager:
path = "/etc/opendkim/keys/" + domainName + "/default.txt"
command = "sudo cat " + path
output = subprocess.check_output(shlex.split(command))
leftIndex = output.index('(') + 2
rightIndex = output.rindex(')') - 1
path = "/etc/opendkim/keys/" + domainName + "/default.private"
command = "sudo cat " + path
privateKey = subprocess.check_output(shlex.split(command))
data_ret = {'fetchStatus': 1, 'keysAvailable': 1, 'publicKey': output[53:269],
data_ret = {'fetchStatus': 1, 'keysAvailable': 1, 'publicKey': output[leftIndex:rightIndex],
'privateKey': privateKey, 'dkimSuccessMessage': 'Keys successfully fetched!',
'error_message': "None"}
json_data = json.dumps(data_ret)
@@ -434,12 +436,14 @@ class MailServerManager:
path = "/etc/opendkim/keys/" + domainName + "/default.txt"
command = "sudo cat " + path
output = subprocess.check_output(shlex.split(command))
leftIndex = output.index('(') + 2
rightIndex = output.rindex(')') - 1
record = dnsRecords(domainOwner=zone,
domain_id=zone.id,
name="default._domainkey." + domainName,
type="TXT",
content="v=DKIM1; k=rsa; p=" + output[53:269],
content=output[leftIndex:rightIndex],
ttl=3600,
prio=0,
disabled=0,

View File

@@ -308,12 +308,14 @@ class DNS:
path = "/etc/opendkim/keys/" + topLevelDomain + "/default.txt"
command = "sudo cat " + path
output = subprocess.check_output(shlex.split(command))
leftIndex = output.index('(') + 2
rightIndex = output.rindex(')') - 1
record = Records(domainOwner=zone,
domain_id=zone.id,
name="default._domainkey." + topLevelDomain,
type="TXT",
content="v=DKIM1; k=rsa; p=" + output[53:269],
content=output[leftIndex:rightIndex],
ttl=3600,
prio=0,
disabled=0,