Add setting for mail from validation

Fixes #454
This commit is contained in:
Girish Ramakrishnan
2018-05-23 23:34:09 -07:00
parent 7df1d388f0
commit 52d1d47030
3 changed files with 30 additions and 1 deletions
+16 -1
View File
@@ -474,7 +474,22 @@
</div>
</uib-tab>
<uib-tab index="2" heading="Status">
<uib-tab index="2" heading="Settings">
<div class="card card-large" style="margin-bottom: 15px;">
<h4>Enable Masquerading</h4>
<div class="row">
<div class="col-md-10">
Masquerading allows users and apps to send emails with an arbitrary username in the FROM address
</div>
<div class="col-md-2">
<button ng-class="selectedDomain.mailConfig.mailFromValidation ? 'btn btn-danger' : 'btn btn-primary'" ng-click="toggleMailFromValidation()">{{ selectedDomain.mailConfig.mailFromValidation ? "Enable" : "Disable" }}</button>
</div>
</div>
</div>
</uib-tab>
<uib-tab index="3" heading="Status">
<div class="card card-large" style="margin-bottom: 15px;" ng-show="selectedDomain.provider !== 'caas' && selectedDomain.mailConfig.relay.provider === 'cloudron-smtp'">
<div class="row">
<div class="col-md-12">
+7
View File
@@ -181,6 +181,13 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
}
};
$scope.toggleMailFromValidation = function () {
Client.setMailFromValidation($scope.selectedDomain.domain, !$scope.selectedDomain.mailConfig.mailFromValidation, function (error) {
if (error) return console.error(error);
$scope.refreshDomain();
});
};
$scope.toggleEmailEnabled = function () {
if ($scope.selectedDomain.mailConfig.enabled) {
$('#disableEmailModal').modal('show');