2019-12-30 17:52:08 +01:00
|
|
|
{% extends 'dashboard/domain_detail/base.html' %}
|
|
|
|
|
|
|
|
{% set domain_detail_page = "info" %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{{ custom_domain.domain }} Info
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block domain_detail_content %}
|
2021-09-17 11:38:07 +02:00
|
|
|
<h1 class="h2 mb-1"> {{ custom_domain.domain }} </h1>
|
2019-12-30 17:52:08 +01:00
|
|
|
|
2021-09-17 11:38:07 +02:00
|
|
|
<div class="small-text">Created {{ custom_domain.created_at | dt }}. {{ nb_alias }} aliases</div>
|
2019-12-30 17:52:08 +01:00
|
|
|
|
2019-12-30 18:20:49 +01:00
|
|
|
<hr>
|
2021-09-17 17:41:36 +02:00
|
|
|
<h3 class="mb-1">Auto create/on the fly alias </h3>
|
|
|
|
|
2019-12-30 18:20:49 +01:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<form method="post">
|
|
|
|
<input type="hidden" name="form-name" value="switch-catch-all">
|
2021-09-17 17:41:36 +02:00
|
|
|
|
2019-12-30 18:20:49 +01:00
|
|
|
<label class="custom-switch cursor mt-2 pl-0"
|
|
|
|
data-toggle="tooltip"
|
|
|
|
{% if custom_domain.catch_all %}
|
|
|
|
title="Disable catch-all"
|
|
|
|
{% else %}
|
|
|
|
title="Enable catch-all"
|
|
|
|
{% endif %}
|
|
|
|
>
|
|
|
|
<input type="checkbox" class="custom-switch-input"
|
|
|
|
{{ "checked" if custom_domain.catch_all else "" }}>
|
|
|
|
|
|
|
|
<span class="custom-switch-indicator"></span>
|
2021-09-17 17:41:36 +02:00
|
|
|
<spam class="ml-2">
|
|
|
|
Catch All
|
|
|
|
</spam>
|
|
|
|
|
2019-12-30 18:20:49 +01:00
|
|
|
</label>
|
|
|
|
</form>
|
2021-09-17 17:41:36 +02:00
|
|
|
<div class="">
|
|
|
|
Simply use <b>anything@{{ custom_domain.domain }}</b>
|
|
|
|
next time you need an alias: it'll be <b>automatically</b>
|
|
|
|
created the first time it receives an email.
|
|
|
|
To have more fine-grained control, you can also use the
|
|
|
|
<a data-toggle="collapse" href="#regex-section">regular expression <i class="fe fe-chevrons-down"></i></a>.
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="{% if custom_domain.auto_create_regex is none %} collapse {% endif %}
|
|
|
|
{% if custom_domain.catch_all %} disabled-content {% endif %}
|
|
|
|
border border-info p-2"
|
|
|
|
id="regex-section">
|
2021-09-18 19:16:43 +02:00
|
|
|
<span class="badge badge-info">Advanced</span>
|
|
|
|
<span class="badge badge-warning">Beta</span> <br>
|
2021-09-17 17:41:36 +02:00
|
|
|
You can also set a regular expression (regex): if an alias matches the expression, it'll be automatically created.
|
|
|
|
<br>
|
|
|
|
Please note that only the local part of the alias (i.e. <b>@{{ custom_domain.domain }}</b> is ignored) during the
|
|
|
|
regex
|
|
|
|
test.
|
|
|
|
|
|
|
|
<form method="post" class="form-inline" data-parsley-validate>
|
|
|
|
<input type="hidden" name="form-name" value="set-auto_create_regex">
|
|
|
|
<div class="form-group">
|
|
|
|
<input class="form-control mr-2"
|
|
|
|
value="{{ custom_domain.auto_create_regex or "" }}"
|
|
|
|
name="auto_create_regex"
|
|
|
|
required
|
2021-09-19 09:36:19 +02:00
|
|
|
data-parsley-pattern="[0-9a-z-_.(\\)(\*)(\|)]{1,}"
|
2021-09-17 17:41:36 +02:00
|
|
|
data-parsley-trigger="change"
|
|
|
|
data-parsley-error-message="Only lowercase letter, number, dot (.), dash (-), underscore (_), backslash (\), star (*) are currently supported."
|
|
|
|
placeholder="prefix\..*">
|
|
|
|
</div>
|
|
|
|
<button class="btn btn-outline-primary" name="action" value="save">Save</button>
|
|
|
|
{% if custom_domain.auto_create_regex %}
|
|
|
|
<button class="btn btn-outline-danger float-right ml-2" name="action" value="remove">Remove</button>
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
|
|
|
|
|
|
|
For example, if you want aliases that starts with <b>prefix.</b> to be automatically created, you can set the
|
|
|
|
regex to <em data-toggle="tooltip"
|
|
|
|
title="Click to copy"
|
|
|
|
class="clipboard"
|
|
|
|
data-clipboard-text="prefix\..*">prefix\..*</em>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
If you want aliases that ends with <b>.suffix</b> to be automatically created, you can use the regex
|
|
|
|
<em data-toggle="tooltip"
|
|
|
|
title="Click to copy"
|
|
|
|
class="clipboard"
|
|
|
|
data-clipboard-text=".*\.suffix">.*\.suffix</em>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
To test out regex, we recommend using regex tester tool like <a href="https://regex101.com" target="_blank">https://regex101.com↗</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
The new alias will belong to
|
|
|
|
{% for mailbox in custom_domain.mailboxes %}
|
|
|
|
<b>{{ mailbox.email }}</b>
|
|
|
|
{% if not loop.last %},{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2019-12-30 18:20:49 +01:00
|
|
|
</div>
|
|
|
|
|
2021-09-17 17:41:36 +02:00
|
|
|
<div class="{% if not custom_domain.auto_create_alias_enabled %} disabled-content {% endif %}">
|
2021-09-17 11:54:37 +02:00
|
|
|
<div>Auto-created aliases are automatically owned by these mailboxes</div>
|
|
|
|
{% set domain_mailboxes=custom_domain.mailboxes %}
|
|
|
|
<form method="post" class="mt-2">
|
|
|
|
<input type="hidden" name="form-name" value="update">
|
|
|
|
<input type="hidden" name="domain-id" value="{{ custom_domain.id }}">
|
|
|
|
|
|
|
|
<div class="d-flex">
|
|
|
|
<div class="flex-grow-1 mr-2">
|
|
|
|
<select data-width="100%" required
|
|
|
|
class="mailbox-select" multiple name="mailbox_ids">
|
|
|
|
{% for mailbox in mailboxes %}
|
|
|
|
<option value="{{ mailbox.id }}" {% if mailbox in domain_mailboxes %}
|
|
|
|
selected {% endif %}>
|
|
|
|
{{ mailbox.email }}
|
|
|
|
</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<button class="btn btn-outline-primary btn-sm">Update</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2020-05-03 16:05:34 +02:00
|
|
|
<hr>
|
2021-09-17 11:38:07 +02:00
|
|
|
<h3 class="mb-1">Default Display Name</h3>
|
|
|
|
<div class="">
|
|
|
|
Default display name for aliases created with <b>{{ custom_domain.domain }}</b>
|
2021-09-17 11:54:37 +02:00
|
|
|
unless overwritten by the alias display name.
|
2020-05-03 16:05:34 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2021-09-17 11:38:07 +02:00
|
|
|
<form method="post" class="form-inline">
|
2020-05-03 16:05:34 +02:00
|
|
|
<input type="hidden" name="form-name" value="set-name">
|
|
|
|
<div class="form-group">
|
2021-09-17 11:38:07 +02:00
|
|
|
<input class="form-control mr-2"
|
2020-05-03 16:05:34 +02:00
|
|
|
value="{{ custom_domain.name or "" }}"
|
|
|
|
name="alias-name"
|
2021-09-17 11:38:07 +02:00
|
|
|
placeholder="Alias Display Name">
|
2020-05-03 16:05:34 +02:00
|
|
|
</div>
|
2021-09-17 11:38:07 +02:00
|
|
|
<button class="btn btn-outline-primary" name="action" value="save">Save</button>
|
2020-11-24 12:02:47 +01:00
|
|
|
{% if custom_domain.name %}
|
2021-09-17 11:38:07 +02:00
|
|
|
<button class="btn btn-outline-danger float-right ml-2" name="action" value="remove">Remove</button>
|
2020-11-24 12:02:47 +01:00
|
|
|
{% endif %}
|
2020-05-03 16:05:34 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2020-10-09 22:54:13 +02:00
|
|
|
<hr>
|
2021-09-17 11:38:07 +02:00
|
|
|
<h3 class="mb-1">Random Prefix Generation</h3>
|
|
|
|
<div class="">
|
|
|
|
Add a random prefix for this domain when creating a new alias.
|
2020-10-09 22:54:13 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<form method="post">
|
|
|
|
<input type="hidden" name="form-name" value="switch-random-prefix-generation">
|
|
|
|
<label class="custom-switch cursor mt-2 pl-0"
|
|
|
|
data-toggle="tooltip"
|
|
|
|
{% if custom_domain.random_prefix_generation %}
|
|
|
|
title="Disable random prefix generation"
|
|
|
|
{% else %}
|
|
|
|
title="Enable random prefix generation"
|
|
|
|
{% endif %}
|
|
|
|
>
|
|
|
|
<input type="checkbox" class="custom-switch-input"
|
|
|
|
{{ "checked" if custom_domain.random_prefix_generation else "" }}>
|
|
|
|
|
|
|
|
<span class="custom-switch-indicator"></span>
|
|
|
|
</label>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2019-12-30 18:51:55 +01:00
|
|
|
<hr>
|
2021-09-17 11:38:07 +02:00
|
|
|
<h3 class="mb-1">Delete Domain</h3>
|
|
|
|
<div class="mb-3">This operation is <b>irreversible</b>.
|
|
|
|
All aliases associated with this domain will be deleted.
|
2019-12-30 18:51:55 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<form method="post">
|
|
|
|
<input type="hidden" name="form-name" value="delete">
|
2021-09-17 11:38:07 +02:00
|
|
|
<span class="delete-custom-domain btn btn-danger">Delete domain</span>
|
2019-12-30 18:51:55 +01:00
|
|
|
</form>
|
|
|
|
|
2019-12-30 17:52:08 +01:00
|
|
|
{% endblock %}
|
|
|
|
|
2019-12-30 18:20:49 +01:00
|
|
|
{% block script %}
|
|
|
|
<script>
|
2021-09-17 11:54:37 +02:00
|
|
|
$('.mailbox-select').multipleSelect();
|
|
|
|
|
2019-12-30 18:20:49 +01:00
|
|
|
$(".custom-switch-input").change(function (e) {
|
|
|
|
$(this).closest("form").submit();
|
2019-12-30 18:51:55 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$(".delete-custom-domain").on("click", function (e) {
|
2020-04-30 22:37:39 +02:00
|
|
|
let that = $(this);
|
|
|
|
|
|
|
|
bootbox.confirm({
|
2020-11-12 17:41:47 +01:00
|
|
|
message: "All aliases associated with <b>{{ custom_domain.domain }}</b> will be also deleted. <br>" +
|
|
|
|
"This operation is not reversible, please confirm.",
|
2020-04-30 22:37:39 +02:00
|
|
|
buttons: {
|
|
|
|
confirm: {
|
|
|
|
label: 'Yes, delete it',
|
|
|
|
className: 'btn-danger'
|
|
|
|
},
|
|
|
|
cancel: {
|
|
|
|
label: 'Cancel',
|
|
|
|
className: 'btn-outline-primary'
|
|
|
|
}
|
2019-12-30 18:51:55 +01:00
|
|
|
},
|
2020-04-30 22:37:39 +02:00
|
|
|
callback: function (result) {
|
|
|
|
if (result) {
|
|
|
|
that.closest("form").submit();
|
|
|
|
}
|
2019-12-30 18:51:55 +01:00
|
|
|
}
|
2020-04-30 22:37:39 +02:00
|
|
|
})
|
2019-12-30 18:51:55 +01:00
|
|
|
});
|
2019-12-30 18:20:49 +01:00
|
|
|
</script>
|
2020-10-09 22:54:13 +02:00
|
|
|
{% endblock %}
|
2021-09-17 11:54:37 +02:00
|
|
|
|