diff --git a/install/install.py b/install/install.py index b12222dd8..841d72227 100644 --- a/install/install.py +++ b/install/install.py @@ -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]") diff --git a/mailServer/mailserverManager.py b/mailServer/mailserverManager.py index 30a37ca43..d21432d34 100644 --- a/mailServer/mailserverManager.py +++ b/mailServer/mailserverManager.py @@ -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, diff --git a/plogical/dnsUtilities.py b/plogical/dnsUtilities.py index 01616d9d5..46500fd48 100644 --- a/plogical/dnsUtilities.py +++ b/plogical/dnsUtilities.py @@ -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,