1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-25 19:17:22 +01:00

Added support of mail only configuration

- added checkboxes to disable web and/or dns on alias or user creation
- added ignore lists for domain not being handled on either web or dns
- added API for managing ignore lists

Signed-off-by: Bernard `Guyzmo` Pratz <guyzmo+github@m0g.net>
This commit is contained in:
Bernard `Guyzmo` Pratz
2016-01-24 14:43:16 +00:00
parent 62b6117638
commit 1d9b678d89
6 changed files with 120 additions and 14 deletions

View File

@@ -64,6 +64,23 @@
</div>
</div>
</div>
<div class="form-group">
<label for="addaliasDnsHandling" class="col-sm-1 control-label">New domain</label>
<div class="col-sm-10">
<div class="checkbox">
<label>
<input id="addaliasDnsHandling" name="addaliasDnsHandling" type="checkbox" checked>
If the email is of a non-managed domain, create DNS configuration for the domain.
</label>
</div>
<div class="checkbox">
<label>
<input id="addaliasWebHandling" name="addaliasWebHandling" type="checkbox" id="addaliasWebHandling" checked>
If the email is of a non-managed domain, create Web configuration for the domain.
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<button id="add-alias-button" type="submit" class="btn btn-primary">Add Alias</button>
@@ -174,6 +191,8 @@ function do_add_alias() {
var form_address = $("#addaliasAddress").val();
var form_forwardsto = $("#addaliasForwardsTo").val();
var form_senders = ($('#addaliasForwardsToAdvanced').prop('checked') ? $("#addaliasSenders").val() : '');
var form_dns = $('#addaliasDnsHandling').prop('checked');
var form_web = $('#addaliasWebHandling').prop('checked');
if ($('#addaliasForwardsToAdvanced').prop('checked') && !/\S/.exec($("#addaliasSenders").val())) {
show_modal_error(title, "You did not enter any permitted senders.");
return false;
@@ -185,7 +204,9 @@ function do_add_alias() {
update_if_exists: is_alias_add_update ? '1' : '0',
address: form_address,
forwards_to: form_forwardsto,
permitted_senders: form_senders
permitted_senders: form_senders,
dns_enabled: form_dns,
web_enabled: form_web
},
function(r) {
// Responses are multiple lines of pre-formatted text.
@@ -204,6 +225,8 @@ function aliases_reset_form() {
$("#addaliasAddress").val('')
$("#addaliasForwardsTo").val('')
$("#addaliasSenders").val('')
$('#addaliasDnsHandling').prop('disabled', false);
$('#addaliasWebHandling').prop('disabled', false);
$('#alias-cancel').addClass('hidden');
$('#add-alias-button').text('Add Alias');
is_alias_add_update = false;
@@ -232,6 +255,8 @@ function aliases_edit(elem) {
$('#addaliasForwardsToAdvanced').prop('checked', senders != "");
$('#addaliasForwardsToNotAdvanced').prop('checked', senders == "");
$("#addaliasSenders").val(senders);
$('#addaliasDnsHandling').prop('disabled', true);
$('#addaliasWebHandling').prop('disabled', true);
$('#add-alias-button').text('Update');
$('body').animate({ scrollTop: 0 })
is_alias_add_update = true;