Email App

This commit is contained in:
Zarak Khan
2024-01-24 11:35:30 +05:00
parent a3efc18f28
commit 55675455b7
11 changed files with 1904 additions and 202 deletions

View File

@@ -658,22 +658,22 @@
List Emails</a>
</li>
<li>
<a href="#"
<a href="{% url 'deleteEmailAccountV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Delete Email</a>
</li>
<li>
<a href="#"
<a href="{% url 'emailForwardingV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Email Forwarding</a>
</li>
<li>
<a href="#"
<a href="{% url 'changeEmailAccountPasswordV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Change Password</a>
</li>
<li>
<a href="#"
<a href="{% url 'dkimManagerV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
DKIM Manager</a>
</li>
@@ -683,7 +683,7 @@
Email Debugger</a>
</li>
<li>
<a href="#"
<a href="/snappymail/index.php"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Access Webmail</a>
</li>

View File

@@ -183,6 +183,22 @@ class MailServerManager(multi.Thread):
{'websiteList': websitesName, "status": 1}, 'deleteEmail')
return proc.render()
def deleteEmailAccountV2(self):
userID = self.request.session['userID']
currentACL = ACLManager.loadedACL(userID)
if not os.path.exists('/home/cyberpanel/postfix'):
proc = httpProc(self.request, 'mailServer/deleteEmailAccount.html',
{"status": 0}, 'deleteEmail')
return proc.render()
websitesName = ACLManager.findAllSites(currentACL, userID)
websitesName = websitesName + ACLManager.findChildDomains(websitesName)
proc = httpProc(self.request, 'mailServer/deleteEmailAccountV2.html',
{'websiteList': websitesName, "status": 1}, 'deleteEmail')
return proc.render()
def getEmailsForDomain(self):
try:
userID = self.request.session['userID']
@@ -297,7 +313,7 @@ class MailServerManager(multi.Thread):
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = '%s setupAutoDiscover --virtualHostName %s --websiteOwner %s' % (
execPath, selectedDomain, website.admin.userName)
execPath, selectedDomain, website.admin.userName)
ProcessUtilities.executioner(execPath)
@@ -326,6 +342,22 @@ class MailServerManager(multi.Thread):
{'websiteList': websitesName, "status": 1}, 'emailForwarding')
return proc.render()
def emailForwardingV2(self):
userID = self.request.session['userID']
currentACL = ACLManager.loadedACL(userID)
if not os.path.exists('/home/cyberpanel/postfix'):
proc = httpProc(self.request, 'mailServer/emailForwardingV2.html',
{"status": 0}, 'emailForwarding')
return proc.render()
websitesName = ACLManager.findAllSites(currentACL, userID)
websitesName = websitesName + ACLManager.findChildDomains(websitesName)
proc = httpProc(self.request, 'mailServer/emailForwardingV2.html',
{'websiteList': websitesName, "status": 1}, 'emailForwarding')
return proc.render()
def fetchCurrentForwardings(self):
try:
@@ -511,7 +543,7 @@ class MailServerManager(multi.Thread):
pipeowner = externalApp
## Add Filter pipe to postfix /etc/postfix/master.cf
filterpipe = '%spipe unix - n n - - pipe flags=Rq user=%s argv=%s -f $(sender) -- $(recipient)' % (
sourceusername, pipeowner, destination)
sourceusername, pipeowner, destination)
command = "echo '" + filterpipe + "' >> /etc/postfix/master.cf"
ProcessUtilities.executioner(command)
## Add Check Recipient Hash to postfix /etc/postfix/main.cf
@@ -613,6 +645,22 @@ class MailServerManager(multi.Thread):
{'websiteList': websitesName, "status": 1}, 'changeEmailPassword')
return proc.render()
def changeEmailAccountPasswordV2(self):
userID = self.request.session['userID']
currentACL = ACLManager.loadedACL(userID)
if not os.path.exists('/home/cyberpanel/postfix'):
proc = httpProc(self.request, 'mailServer/changeEmailPasswordV2.html',
{"status": 0}, 'changeEmailPassword')
return proc.render()
websitesName = ACLManager.findAllSites(currentACL, userID)
websitesName = websitesName + ACLManager.findChildDomains(websitesName)
proc = httpProc(self.request, 'mailServer/changeEmailPasswordV2.html',
{'websiteList': websitesName, "status": 1}, 'changeEmailPassword')
return proc.render()
def submitPasswordChange(self):
try:
userID = self.request.session['userID']
@@ -674,6 +722,19 @@ class MailServerManager(multi.Thread):
{'websiteList': websitesName, 'openDKIMInstalled': openDKIMInstalled}, 'dkimManager')
return proc.render()
def dkimManagerV2(self):
userID = self.request.session['userID']
currentACL = ACLManager.loadedACL(userID)
openDKIMInstalled = 1
websitesName = ACLManager.findAllSites(currentACL, userID)
websitesName = websitesName + ACLManager.findChildDomains(websitesName)
proc = httpProc(self.request, 'mailServer/dkimManagerV2.html',
{'websiteList': websitesName, 'openDKIMInstalled': openDKIMInstalled}, 'dkimManager')
return proc.render()
def fetchDKIMKeys(self):
try:
userID = self.request.session['userID']

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,118 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="changeEmailPasswordV2" class="p-8">
<div>
<p class="text-4xl font-bold">Change Email Password</p>
<p class="text-xs text-gray-600 py-2 font-semibold">Select a website from the list, to change its
password.</p>
</div>
<div>
<div class="py-4">
<p class="text-xl font-bold">Change Email Password</p>
<img ng-hide="emailLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
{% if not status %}
<div class="col-md-12 text-center" style="margin-bottom: 2%;">
<h3>{% trans "Postfix is disabled." %}
<a href="{% url 'managePostfix' %}">
<button class="btn btn-alt btn-hover btn-blue-alt">
<span>{% trans "Enable Now" %}</span>
<i class="glyph-icon icon-arrow-right"></i>
</button>
</a></h3>
</div>
{% else %}
<div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="showEmailDetails()" ng-model="emailDomain"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="emailDetails" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Select Email</p>
</div>
<div>
<select ng-model="selectedEmail" class="w-80 bg-gray-100 rounded px-2 py-1">
<option ng-repeat="email in emails track by $index">{$ email.email $}</option>
</select>
</div>
</div>
<div ng-hide="emailDetails" class="flex py-2 px-6 dbDetails">
<div>
<p class="font-semibold w-60">Password</p>
</div>
<div>
<input type="password" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="emailPassword"
required>
</div>
<div class="w-80 ml-4">
<button ng-click="generatePassword()"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Generate
</button>
</div>
</div>
<div>
<div class="flex py-2 px-6" ng-hide="generatedPasswordView">
<div>
<p class="font-semibold w-60">Generated Password</p>
</div>
<div>
<input type="text" name="email" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="emailPassword"
required>
</div>
<div class="w-80 ml-4">
<button ng-click="usePassword()"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Use
</button>
</div>
</div>
</div>
<div ng-hide="emailDetails" class="flex justify-center mt-3">
<button ng-click="changePassword()"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Change Password
</button>
</div>
</div>
</div>
<div class="mt-3">
<div ng-hide="canNotChangePassword"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot delete email account. Error message:" %} {$ errorMessage
$}</p>
</div>
<div ng-hide="passwordChanged"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Password successfully changed for :" %} {$ passEmail $}.</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
<div ng-hide="noEmails"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Currently no email accounts exist for this domain." %}</p>
</div>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,94 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="deleteEmailAccountV2" class="p-8">
<div>
<p class="text-4xl font-bold">Delete Email Account</p>
<p class="text-xs text-gray-600 py-2 font-semibold">Select a website from the list, to delete an email
account.</p>
</div>
<div>
<div class="py-4">
<p class="text-xl font-bold">Delete Email Account</p>
<img ng-hide="emailLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
{% if not status %}
<div class="col-md-12 text-center" style="margin-bottom: 2%;">
<h3>{% trans "Postfix is disabled." %}
<a href="{% url 'managePostfix' %}">
<button class="btn btn-alt btn-hover btn-blue-alt">
<span>{% trans "Enable Now" %}</span>
<i class="glyph-icon icon-arrow-right"></i>
</button>
</a></h3>
</div>
{% else %}
<div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="showEmailDetails()" ng-model="emailDomain"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="emailDetails" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Email</p>
</div>
<div>
<select ng-model="selectedEmail" class="w-80 bg-gray-100 rounded px-2 py-1">
<option ng-repeat="email in emails track by $index">{$ email.email $}</option>
</select>
</div>
</div>
<div ng-hide="emailDetails" class="flex justify-center mt-6">
<button ng-click="deleteEmailAccount()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Delete Email
</button>
</div>
<div ng-hide="emailDetailsFinal" class="flex justify-center mt-6">
<button type="button" ng-click="deleteEmailAccountFinal()"
class="bg-gray-500 text-white font-bold px-4 py-2 text-xl">{% trans "Are you sure?" %}</button>
</div>
<div class="mt-4">
<label class="col-sm-3 control-label"></label>
<div>
<div ng-hide="canNotDelete"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot delete email account. Error message:" %} {$ errorMessage
$}</p>
</div>
<div ng-hide="successfullyDeleted"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Mailbox with username: {$ deletedID $} has been successfully deleted." %}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
<div ng-hide="noEmails"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Currently no email accounts exist for this domain." %}</p>
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,152 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="dkimManagerV2" class="p-8">
<div>
<div class="flex items-center">
<p class="text-4xl font-bold">DKIM Manager - </p>
<a target="_blank" href="http://go.cyberpanel.net/dkim"
class="bg-blue-400 px-2 py-1 text-white font-semibold ml-3"
title=""><span>{% trans "DKIM Docs" %}</span></a>
</div>
</div>
{% if openDKIMInstalled == 0 %}
<div>
<div class="py-4">
<p class="text-xl font-bold">DKIM Manager</p>
<img ng-hide="manageDKIMLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div>
<h3>{% trans "OpenDKIM is not installed. " %}
<a href="" ng-click="installOpenDKIM()"><strong>{% trans "Install Now" %}</strong></a>
</h3>
</div>
<div class="mt-3">
<div ng-hide="openDKIMNotifyBox" class="form-group">
<div class="col-sm-6">
<div ng-hide="openDKIMError"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Error message: " %} {$ errorMessage $}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect. Please refresh this page." %} </p>
</div>
<div ng-hide="openDKIMSuccessfullyInstalled"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "OpenDKIM successfully installed, refreshing page in 3 seconds.." %}</p>
</div>
</div>
</div>
</div>
<div class="mt-3">
<div ng-hide="openDKIMInstallBox" class="col-md-12">
<form action="/" id="" class="form-horizontal bordered-row panel-body">
<div class="form-group">
<div style="margin-top: 2%;" class="col-sm-12">
<textarea ng-model="requestData" rows="15"
class="form-control">{{ requestData }}</textarea>
</div>
</div>
</form>
</div>
</div>
{% else %}
<div class="panel-body">
<h3 class="content-box-header">
{% trans "DKIM Manager" %} <img ng-hide="manageDKIMLoading" src="{% static 'images/loading.gif' %}">
</h3>
<div class="example-box-wrapper">
<form action="/" class="form-horizontal bordered-row panel-body">
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="fetchKeys()" ng-model="domainName"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="noKeysAvailable" class="mt-4">
<hr>
</div>
<!------ List Domain Keys --------------->
<div ng-hide="noKeysAvailable" class="flex justify-center text-xl py-6">
<h3>{% trans "Keys not available for this domain." %}
<a href="" ng-click="createDomainDKIMKeys()"><strong
class="text-orange-500 font-semibold">{% trans "Generate Now" %}</strong></a>
</h3>
</div>
<div ng-hide="noKeysAvailable">
<hr>
</div>
<div ng-hide="domainRecords" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Domain
</th>
<th scope="col" class="px-6 py-3">
Private Key
</th>
<th scope="col" class="px-6 py-3">
Public Key
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="domainName" class="px-6 py-4">
</td>
<td class="px-6 py-4">
<textarea ng-bind="privateKey" rows="10"
class="form-control"></textarea>
</td>
<td class="px-6 py-4">
<textarea ng-bind="publicKey" rows="5"
class="form-control"></textarea>
</td>
</tr>
</tbody>
</table>
</div>
<!------ List of records --------------->
<div>
<div ng-hide="dkimSuccess"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{$ dkimSuccessMessage $}</p>
</div>
<div ng-hide="dkimError"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{$ errorMessage $}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</form>
</div>
</div>
{% endif %}
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,141 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="emailForwardingV2" class="p-8">
<div class="flex items-center">
<p class="text-4xl font-bold">Setup Email Forwarding - </p>
<a target="_blank" href="http://go.cyberpanel.net/email-forwarding"
class="bg-blue-400 px-2 py-1 text-white font-semibold ml-3"
title=""><span>{% trans "Forwarding Docs" %}</span></a>
</div>
<div>
<div class="py-4">
<p class="text-xl font-bold">Setup Email Forwarding</p>
<img ng-hide="forwardLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
{% if not status %}
<div class="col-md-12 text-center" style="margin-bottom: 2%;">
<h3>{% trans "Postfix is disabled." %}
<a href="{% url 'managePostfix' %}">
<button class="btn btn-alt btn-hover btn-blue-alt">
<span>{% trans "Enable Now" %}</span>
<i class="glyph-icon icon-arrow-right"></i>
</button>
</a></h3>
</div>
{% else %}
<div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="showEmailDetails()" ng-model="emailDomain"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="emailDetails" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Select Email</p>
</div>
<div>
<select ng-change="selectForwardingEmail()" ng-model="selectedEmail"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option ng-repeat="email in emails track by $index">{$ email.email $}</option>
</select>
</div>
</div>
<div ng-hide="emailDetails" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Forwarding Options</p>
</div>
<div>
<select ng-change="selectForwardingEmail()" ng-model="forwardingOption"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>Forward to email</option>
<option>Pipe to program</option>
</select>
</div>
</div>
</div>
</div>
<div class="mt-3">
<div ng-hide="forwardError"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{$ errorMessage $}</p>
</div>
<div ng-hide="forwardSuccess"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{$ successMessage $}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
<div ng-hide="creationBox" class="flex gap-4 justify-center mt-4">
<div>
<input placeholder="{% trans 'Source' %}" type="email"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="selectedEmail" readonly>
</div>
<div>
<input placeholder="{% trans 'Destination' %} {% trans 'or path to the program' %}" type="text"
class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="destinationEmail" required>
</div>
<div>
<button type="button" ng-click="forwardEmail()"
class="bg-orange-500 text-white font-semibold px-2 py-1">{% trans "Forward Email" %}</button>
</div>
</div>
<div class="mt-4">
<hr>
</div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
ID
</th>
<th scope="col" class="px-6 py-3">
Source
</th>
<th scope="col" class="px-6 py-3">
Destination
</th>
<th scope="col" class="px-6 py-3">
Actions
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.id" class="px-6 py-4">
</td>
<td ng-bind="record.source" class="px-6 py-4">
</td>
<td ng-bind="record.destination" class="px-6 py-4">
</td>
<td ng-click="deleteForwarding(record.source, record.destination)" class="px-6 py-4">
<img src="{% static 'images/delete.png' %}">
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -9,17 +9,16 @@
<div>
<div class="flex justify-between items-center">
<div>
<p class="text-4xl font-bold">List Email Accounts
- </p>
</div>
<div>
<a target="_blank" href="https://go.cyberpanel.net/DebugEmail" style="height: 23px;line-height: 21px;"
class="btn btn-border btn-alt border-red btn-link font-red"
title=""><span>{% trans "Debug Email Issues" %}</span></a>
<div class="flex items-center">
<p class="text-4xl font-bold">List Email Accounts - </p>
<a target="_blank" href="https://go.cyberpanel.net/DebugEmail"
class="bg-blue-400 px-2 py-1 text-white font-semibold ml-3"
title=""><span>{% trans "Debug Email Issues" %}</span></a>
</div>
</div>
<div>
<a class="bg-orange-500 text-white font-semibold px-2 py-1"
href="{% url "createEmailAccount" %}">{% trans "Create Email" %}</a>
href="{% url "createEmailAccountV2" %}">{% trans "Create Email" %}</a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">List Emails Accounts. Change their passwords or delete
@@ -60,196 +59,205 @@
</div>
<div ng-hide="emailsAccounts" class="form-group">
<div ng-hide="mailConfigured==1" class="col-sm-12">
<div class="alert alert-danger">
<div ng-hide="mailConfigured==1">
<div class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "SSL for email is not configured properly, you may get Self-Signed error on mail clients such as Outlook and Thunderbird. More details " %}<a
href="https://cyberpanel.net/docs/6-self-signed-ssl-error-on-outlook-thunderbird/">here</a>.
</p>
</div>
<a target="_blank" href="">
<button style="margin-bottom: 2%" ng-click='fixMailSSL()' class="btn btn-primary">Fix Now</button>
<a target="_blank" href="" class="flex justify-center mt-3">
<button ng-click='fixMailSSL()' class="bg-orange-500 text-white font-semibold px-2 py-1">Fix Now
</button>
</a>
</div>
<div class="col-sm-4">
<h4>{% trans "Details To Configure Mail Clients" %}</h4>
<table class="table">
<thead>
<tr>
<th>{% trans "POP3" %}</th>
<th>{% trans "Details" %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{% trans "Server Hostname" %}</td>
<td>{$ serverHostname $}</td>
</tr>
<tr>
<td>{% trans "Port" %}</td>
<td>110</td>
</tr>
<tr>
<td>{% trans "Port" %}</td>
<td>995 (SSL)</td>
</tr>
<tr>
<td>{% trans "SSL" %}</td>
<td>STARTTLS</td>
</tr>
</tbody>
</table>
<table class="table">
<thead>
<tr>
<th>{% trans "IMAP" %}</th>
<th>{% trans "Details" %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{% trans "Server Hostname" %}</td>
<td>{$ serverHostname $}</td>
</tr>
<tr>
<td>{% trans "Port" %}</td>
<td>143</td>
</tr>
<tr>
<td>{% trans "Port" %}</td>
<td>993 (SSL)</td>
</tr>
<tr>
<td>{% trans "SSL" %}</td>
<td>STARTTLS</td>
</tr>
</tbody>
</table>
<table class="table">
<thead>
<tr>
<th>{% trans "SMTP" %}</th>
<th>{% trans "Details" %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{% trans "Server Hostname" %}</td>
<td>{$ serverHostname $}</td>
</tr>
<tr>
<td>{% trans "Port" %}</td>
<td>25</td>
</tr>
<tr>
<td>{% trans "Port" %}</td>
<td>587 (SSL)</td>
</tr>
<tr>
<td>{% trans "Port" %}</td>
<td>465 (SSL)</td>
</tr>
<tr>
<td>{% trans "SSL" %}</td>
<td>STARTTLS</td>
</tr>
</tbody>
</table>
<div class="py-4">
<p class="text-xl font-bold">Details To Configure Mail Clients</p>
</div>
<div class="flex gap-6">
<div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
POP3
</th>
<th scope="col" class="px-6 py-3">
Details
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4">
Server Hostname
</td>
<td class="px-6 py-4">
{$ serverHostname $}
</td>
</tr>
<tr>
<td class="px-6 py-4">
Port
</td>
<td class="px-6 py-4">
110
</td>
</tr>
<tr>
<td class="px-6 py-4">
Port
</td>
<td class="px-6 py-4">
995 (SSL)
</td>
</tr>
<tr>
<td class="px-6 py-4">
SSL
</td>
<td class="px-6 py-4">
STARTTLS
</td>
</tr>
</tbody>
</table>
</div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
IMAP
</th>
<th scope="col" class="px-6 py-3">
Details
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4">
Server Hostname
</td>
<td class="px-6 py-4">
{$ serverHostname $}
</td>
</tr>
<tr>
<td class="px-6 py-4">
Port
</td>
<td class="px-6 py-4">
143
</td>
</tr>
<tr>
<td class="px-6 py-4">
Port
</td>
<td class="px-6 py-4">
993 (SSL)
</td>
</tr>
<tr>
<td class="px-6 py-4">
SSL
</td>
<td class="px-6 py-4">
STARTTLS
</td>
</tr>
</tbody>
</table>
</div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
SMTP
</th>
<th scope="col" class="px-6 py-3">
Details
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4">
Server Hostname
</td>
<td class="px-6 py-4">
{$ serverHostname $}
</td>
</tr>
<tr>
<td class="px-6 py-4">
Port
</td>
<td class="px-6 py-4">
25
</td>
</tr>
<tr>
<td class="px-6 py-4">
Port
</td>
<td class="px-6 py-4">
587 (SSL)
</td>
</tr>
<tr>
<td class="px-6 py-4">
465 (SSL)
</td>
<td class="px-6 py-4">
STARTTLS
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-8">
<table class="table">
<thead>
<tr>
<th>{% trans "Emails" %}</th>
<th>{% trans "Disk Usage" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="record in records track by $index">
<td ng-bind="record.email"></td>
<td ng-bind="record.DiskUsage"></td>
<td>
<a data-toggle="modal" data-target="#settings"
ng-click="changePasswordInitial(record.email)"
class="btn btn-border btn-alt border-purple btn-link font-purple"
href="#"
title=""><span>{% trans 'Change Password' %}</span></a>
<a ng-click="deleteEmailAccountFinal(record.email)"
class="btn btn-border btn-alt border-red btn-link font-red" href="#"
title=""><span>{% trans 'Delete' %}</span></a>
<!--- Modal --->
<div id="settings" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">&times;
</button>
<h4 class="modal-title">Change Password
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</h4>
</div>
<div class="modal-body">
<form name="containerSettingsForm" action="/"
class="form-horizontal">
<div ng-hide="installationDetailsForm"
class="form-group">
<label class="col-sm-3 control-label">{% trans "Email" %}</label>
<div class="col-sm-6">
<input name="name" type="text"
class="form-control"
ng-model="email" readonly>
</div>
</div>
<hr>
<div ng-hide="installationDetailsForm"
class="form-group">
<label class="col-sm-3 control-label">{% trans "Password" %}</label>
<div class="col-sm-6">
<input type="password"
class="form-control"
ng-model="$parent.password">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" ng-disabled="savingSettings"
class="btn btn-primary"
ng-click="changePassword()"
data-dismiss="modal">
Save
</button>
<button type="button" ng-disabled="savingSettings"
class="btn btn-default" data-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<!--- Modal End--->
</td>
</tr>
</tbody>
</table>
</div>
<div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Emails
</th>
<th scope="col" class="px-6 py-3">
Disk Usage
</th>
<th scope="col" class="px-6 py-3">
Actions
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.email" class="px-6 py-4">
</td>
<td ng-bind="record.DiskUsage" class="px-6 py-4">
</td>
<td class="flex gap-2 px-6 py-4">
<button ng-click="changePasswordInitial(record.email)"
class="bg-orange-500 text-white font-semibold px-2 py-1">Change Password
</button>
<button ng-click="deleteEmailAccountFinal(record.email)"
class="bg-red-500 text-white font-semibold px-2 py-1">Delete
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
</div>

View File

@@ -10,33 +10,33 @@ urlpatterns = [
url(r'^submitEmailCreation', views.submitEmailCreation, name='submitEmailCreation'),
url(r'^fetchEmails$', views.fetchEmails, name='fetchEmails'),
## Mail Forwardings
url(r'^emailForwarding$', views.emailForwarding, name='emailForwarding'),
url(r'^V2/emailForwardingV2$', views.emailForwardingV2, name='emailForwardingV2'),
url(r'^submitEmailForwardingCreation$', views.submitEmailForwardingCreation, name='submitEmailForwardingCreation'),
url(r'^fetchCurrentForwardings$', views.fetchCurrentForwardings, name='fetchCurrentForwardings'),
url(r'^submitForwardDeletion$', views.submitForwardDeletion, name='submitForwardDeletion'),
## Delete email
url(r'^deleteEmailAccount', views.deleteEmailAccount, name='deleteEmailAccount'),
url(r'^V2/deleteEmailAccountV2', views.deleteEmailAccountV2, name='deleteEmailAccountV2'),
url(r'^getEmailsForDomain$', views.getEmailsForDomain, name='getEmailsForDomain'),
url(r'^submitEmailDeletion', views.submitEmailDeletion, name='submitEmailDeletion'),
url(r'^fixMailSSL', views.fixMailSSL, name='fixMailSSL'),
## Change email password
url(r'^changeEmailAccountPassword', views.changeEmailAccountPassword, name='changeEmailAccountPassword'),
url(r'^V2/changeEmailAccountPasswordV2', views.changeEmailAccountPasswordV2, name='changeEmailAccountPasswordV2'),
url(r'^submitPasswordChange', views.submitPasswordChange, name='submitPasswordChange'),
## DKIM Manager
url(r'^dkimManager', views.dkimManager, name='dkimManager'),
url(r'^V2/dkimManagerV2', views.dkimManagerV2, name='dkimManagerV2'),
url(r'^fetchDKIMKeys', views.fetchDKIMKeys, name='fetchDKIMKeys'),
url(r'^generateDKIMKeys$', views.generateDKIMKeys, name='generateDKIMKeys'),
url(r'^installOpenDKIM', views.installOpenDKIM, name='installOpenDKIM'),
url(r'^installStatusOpenDKIM', views.installStatusOpenDKIM, name='installStatusOpenDKIM'),
]
]

View File

@@ -84,6 +84,14 @@ def deleteEmailAccount(request):
return redirect(loadLoginPage)
def deleteEmailAccountV2(request):
try:
msM = MailServerManager(request)
return msM.deleteEmailAccountV2()
except KeyError:
return redirect(loadLoginPage)
def getEmailsForDomain(request):
try:
msM = MailServerManager(request)
@@ -136,6 +144,14 @@ def emailForwarding(request):
return redirect(loadLoginPage)
def emailForwardingV2(request):
try:
msM = MailServerManager(request)
return msM.emailForwardingV2()
except KeyError:
return redirect(loadLoginPage)
def fetchCurrentForwardings(request):
try:
msM = MailServerManager(request)
@@ -198,6 +214,14 @@ def changeEmailAccountPassword(request):
return redirect(loadLoginPage)
def changeEmailAccountPasswordV2(request):
try:
msM = MailServerManager(request)
return msM.changeEmailAccountPasswordV2()
except KeyError:
return redirect(loadLoginPage)
def submitPasswordChange(request):
try:
@@ -229,6 +253,14 @@ def dkimManager(request):
return redirect(loadLoginPage)
def dkimManagerV2(request):
try:
msM = MailServerManager(request)
return msM.dkimManagerV2()
except KeyError:
return redirect(loadLoginPage)
def fetchDKIMKeys(request):
try:
msM = MailServerManager(request)

View File

@@ -15,4 +15,4 @@ find /usr/local/CyberCP -type f -exec chmod 0644 {} \;
chmod -R 755 /usr/local/CyberCP/bin
chown -R root:root /usr/local/CyberCP
chown -R lscpd:lscpd /usr/local/CyberCP/public/phpmyadmin/tmp
systemctl restart lscpd
systemctl restart lscpd