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 + }) + } + ) + }