1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-05 15:57:23 +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

@@ -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>