diff --git a/install/FileManager/.idea/workspace.xml b/install/FileManager/.idea/workspace.xml index 6abcfb429..26ed2d730 100644 --- a/install/FileManager/.idea/workspace.xml +++ b/install/FileManager/.idea/workspace.xml @@ -112,6 +112,7 @@ + @@ -128,7 +129,6 @@ @@ -94,6 +94,15 @@ + +
+
+ +
+
diff --git a/websiteFunctions/templates/websiteFunctions/website.html b/websiteFunctions/templates/websiteFunctions/website.html index 2901e7517..5b6b01407 100644 --- a/websiteFunctions/templates/websiteFunctions/website.html +++ b/websiteFunctions/templates/websiteFunctions/website.html @@ -302,7 +302,7 @@
- +
{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}
diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index 65990f9e0..6a0ae96ed 100644 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -290,7 +290,7 @@ def submitWebsiteCreation(request): execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py" execPath = execPath + " createVirtualHost --virtualHostName " + domain + " --administratorEmail " + adminEmail + " --phpVersion '" + phpSelection + "' --virtualHostUser " + externalApp + " --numberOfSites " + numberOfWebsites + " --ssl " + str( - data['ssl']) + " --sslPath " + sslpath + data['ssl']) + " --sslPath " + sslpath + " --dkimCheck " + str(data['dkimCheck']) output = subprocess.check_output(shlex.split(execPath)) @@ -404,6 +404,68 @@ def submitWebsiteCreation(request): disabled=0, auth=1) record.save() + + ## TXT Records for mail + + record = Records(domainOwner=zone, + domain_id=zone.id, + name=topLevelDomain, + type="TXT", + content="v=spf1 a mx ip4:" + ipAddress + " ~all", + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() + + record = Records(domainOwner=zone, + domain_id=zone.id, + name="_dmarc." + topLevelDomain, + type="TXT", + content="v=DMARC1; p=none", + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() + + record = Records(domainOwner=zone, + domain_id=zone.id, + name="_domainkey." + topLevelDomain, + type="TXT", + content="t=y; o=~;", + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() + + + ## DKIM Support + + if data['dkimCheck'] == 1: + + path = "/etc/opendkim/keys/" + topLevelDomain + "/default.txt" + command = "sudo cat " + path + output = subprocess.check_output(shlex.split(command)) + + record = Records(domainOwner=zone, + domain_id=zone.id, + name="default._domainkey." + topLevelDomain, + type="TXT", + content="v=DKIM1; k=rsa; p=" + output[53:269], + ttl=3600, + prio=0, + disabled=0, + auth=1) + record.save() + + + + + + + else: if Domains.objects.filter(name=topLevelDomain).count() == 0: