1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-04 15:54:48 +01:00

Manage the local Postgrey whitelist in the admin console

This commit is contained in:
downtownallday
2021-04-09 09:47:07 -04:00
parent 9a9a699be6
commit 0df9de30c9
4 changed files with 97 additions and 0 deletions

View File

@@ -94,6 +94,7 @@
<li><a href="#custom_dns" onclick="return show_panel(this);">Custom DNS</a></li>
<li><a href="#external_dns" onclick="return show_panel(this);">External DNS</a></li>
<li><a href="/admin/munin" target="_blank">Munin Monitoring</a></li>
<li><a href="#postgrey_whitelist" onclick="return show_panel(this);">Postgrey whitelist</a></li>
</ul>
</li>
<li class="dropdown">
@@ -135,6 +136,10 @@
{% include "custom-dns.html" %}
</div>
<div id="panel_postgrey_whitelist" class="admin_panel">
{% include "postgrey-whitelist.html" %}
</div>
<div id="panel_mfa" class="admin_panel">
{% include "mfa.html" %}
</div>

View File

@@ -0,0 +1,53 @@
<style>
</style>
<h2>Postgrey Whitelist</h2>
<p>The text box below contains the contents of the system's Postgrey local client whitelist. It's comprised of a list of <em>hosts</em>, one per line, whose incoming email to this server should never be greylisted.</p>
<p>Entries may be a fully qualified domain name, an IP address, or a regular expression. Regular expressions begin and end with the character "/".</p>
<p>This file augments the whilelist provided by Postgrey.</p>
<textarea style="width:100%; height:12em" id="postgrey_whitelist"></textarea>
<button class="btn-success" onclick="save_postgrey_whitelist()">Save</button>
<script>
function show_postgrey_whitelist() {
get_postgrey_whitelist();
}
function get_postgrey_whitelist() {
api(
"/system/postgrey-whitelist",
"GET",
{ },
function(whitelist) {
var e = document.getElementById('postgrey_whitelist');
e.value = whitelist
}
);
}
function save_postgrey_whitelist() {
var e = document.getElementById('postgrey_whitelist');
api(
"/system/postgrey-whitelist",
"POST",
{
contents: e.value
},
function(data) {
if (data == "")
data = "Nothing changed.";
else
data = $("<pre/>").text(data);
show_modal_error("Postgrey Whitelist Update", data, function() {
get_postgrey_whitelist();
});
});
}
</script>