From 785280c86be85c4a2fece5c330be58d44f8cce71 Mon Sep 17 00:00:00 2001 From: David Duque Date: Thu, 16 Apr 2020 17:01:49 +0100 Subject: [PATCH] Submission --- management/templates/smtp-relays.html | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/management/templates/smtp-relays.html b/management/templates/smtp-relays.html index 2bc4524e..d87ea363 100644 --- a/management/templates/smtp-relays.html +++ b/management/templates/smtp-relays.html @@ -11,7 +11,7 @@

SMTP Relay Configuration

-
+
@@ -103,7 +103,6 @@ "GET", {}, data => { - console.log("Hi!") use_relay.checked = data.enabled relay_host.value = data.host relay_use_auth.checked = data.auth_enabled @@ -114,4 +113,23 @@ } ) } + + function set_smtp_relay_config() { + api( + "/system/smtp/relay", + "POST", + { + enabled: use_relay.checked, + host: relay_host.value, + auth_enabled: relay_use_auth.checked, + user: relay_auth_user.value, + key: relay_auth_pass.value + }, + () => { + show_modal_error("Done!", "The configuration has been updated and Postfix was restarted successfully. Please make sure everything is functioning as intended.", () => { + return false + }) + } + ) + }