Allow email to be enabled without dns setup
This helps in importing existing mail and also configuring mailboxes before going live
This commit is contained in:
@@ -7,21 +7,30 @@
|
||||
<h4 class="modal-title">Enable Email for {{selectedDomain.domain}}?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div ng-show="selectedDomain.provider === 'noop' || selectedDomain.provider === 'manual'">
|
||||
No DNS provider is setup. The DNS records listed below have to be setup manually.<br/>
|
||||
</div>
|
||||
<div ng-hide="selectedDomain.provider === 'noop' || selectedDomain.provider === 'manual'">
|
||||
Cloudron will setup Email related DNS records automatically for {{selectedDomain.domain}}. Status of DNS Records below
|
||||
may show an error while DNS is propagating (~5 minutes).
|
||||
<br/><br/>
|
||||
If this domain is already configured to handle email with some other provider, it will overwrite those DNS records.
|
||||
<div>This will configure Cloudron to receive emails for <b>{{selectedDomain.domain}}</b>. See the
|
||||
documentation for opening up the <a href="https://cloudron.io/documentation/email/#required-ports-for-cloudron-email" target="_blank">required ports</a>
|
||||
for Cloudron Email.
|
||||
</div>
|
||||
<br/>
|
||||
<div>Any installed webmail clients will be automatically re-configured to reflect this change.</div>
|
||||
|
||||
<div ng-show="selectedDomain.provider === 'noop' || selectedDomain.provider === 'manual'">
|
||||
No DNS provider is setup. The DNS records listed in the Status tab have to be setup manually.<br/>
|
||||
</div>
|
||||
<div ng-hide="selectedDomain.provider === 'noop' || selectedDomain.provider === 'manual'">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="incomingEmail.setupDns"> Setup Mail DNS records now
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Use this option to automatically setup Email related DNS records. Leaving this option unchecked
|
||||
is useful for creating mail boxes and <a href="https://cloudron.io/documentation/email/#import-email">importing email</a>
|
||||
before going live.
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-success" ng-click="incomingEmail.enable()">I understand, enable</button>
|
||||
<button type="button" class="btn btn-success" ng-click="incomingEmail.enable()">Enable</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,9 +44,9 @@
|
||||
<h4 class="modal-title">Disable Email Server for {{selectedDomain.domain}}?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div>Any installed webmail clients will be automatically re-configured to reflect this change.</div>
|
||||
<br/>
|
||||
<div><b>Mailboxes and lists associated with this domain will not be deleted</b>.</div>
|
||||
<div>This will configure Cloudron to stop receiving emails for <b>{{selectedDomain.domain}}</b>. Mailboxes and lists associated with this
|
||||
domain will not be deleted.
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -521,9 +530,14 @@
|
||||
<div class="card card-large" style="margin-bottom: 15px;" ng-show="selectedDomain.mailConfig.relay.provider === 'cloudron-smtp'">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h4>DNS Status <sup><a href="https://cloudron.io/documentation/troubleshooting/#mail-dns" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup></h4>
|
||||
<h4>DNS Status
|
||||
<button class="btn btn-xs btn-primary btn-outline pull-right" ng-click="incomingEmail.setDnsRecords()">
|
||||
<i class="fa fa-circle-notch fa-spin" ng-show="incomingEmail.setupDnsBusy"></i> Re-setup DNS
|
||||
</button>
|
||||
</h4>
|
||||
|
||||
Set the following DNS records for <b><tt>{{ selectedDomain.domain }}</tt></b> to guarantee email delivery:
|
||||
Status of DNS Records may show an error while DNS is propagating (~5 minutes). See the
|
||||
<a href="https://cloudron.io/documentation/troubleshooting/#mail-dns" target="_blank">troubleshooting</a> docs for help.
|
||||
|
||||
<br/><br/>
|
||||
|
||||
|
||||
@@ -189,6 +189,8 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
|
||||
$scope.incomingEmail = {
|
||||
busy: false,
|
||||
setupDns: true,
|
||||
setupDnsBusy: false,
|
||||
|
||||
toggleEmailEnabled: function () {
|
||||
if ($scope.selectedDomain.mailConfig.enabled) {
|
||||
@@ -198,6 +200,18 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
}
|
||||
},
|
||||
|
||||
setDnsRecords: function (callback) {
|
||||
$scope.incomingEmail.setupDnsBusy = true;
|
||||
|
||||
Client.setDnsRecords($scope.selectedDomain.domain, function (error) {
|
||||
if (error) console.error(error);
|
||||
|
||||
$timeout(function () { $scope.incomingEmail.setupDnsBusy = false; }, 2000); // otherwise, it's too fast
|
||||
|
||||
if (callback) callback();
|
||||
});
|
||||
},
|
||||
|
||||
enable: function () {
|
||||
$('#enableEmailModal').modal('hide');
|
||||
|
||||
@@ -208,7 +222,9 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
|
||||
$scope.reconfigureEmailApps();
|
||||
|
||||
Client.setDnsRecords($scope.selectedDomain.domain, function (error) {
|
||||
let maybeSetupDns = $scope.incomingEmail.setupDns ? $scope.incomingEmail.setDnsRecords : function (next) { next(); };
|
||||
|
||||
maybeSetupDns(function (error) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.refreshDomain();
|
||||
|
||||
Reference in New Issue
Block a user