diff --git a/src/views/email.html b/src/views/email.html
index 31232b630..058b0cda1 100644
--- a/src/views/email.html
+++ b/src/views/email.html
@@ -520,7 +520,10 @@
Masquerading allows users and apps to send emails with an arbitrary username in the FROM address
-
+
diff --git a/src/views/email.js b/src/views/email.js
index 587f41537..38ac5a146 100644
--- a/src/views/email.js
+++ b/src/views/email.js
@@ -184,11 +184,25 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
}
};
- $scope.toggleMailFromValidation = function () {
- Client.setMailFromValidation($scope.domain.domain, !$scope.domain.mailConfig.mailFromValidation, function (error) {
- if (error) return console.error(error);
- $scope.refreshDomain();
- });
+ $scope.mailFromValidation = {
+ busy: false,
+
+ submit: function () {
+ $scope.mailFromValidation.busy = true;
+
+ Client.setMailFromValidation($scope.domain.domain, !$scope.domain.mailConfig.mailFromValidation, function (error) {
+ if (error) {
+ $scope.mailFromValidation.busy = false;
+ return console.error(error);
+ }
+
+ // give sometime for the mail container to restart
+ $timeout(function () {
+ $scope.mailFromValidation.busy = false;
+ $scope.refreshDomain();
+ }, 5000);
+ });
+ }
};
$scope.incomingEmail = {