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

@@ -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,