2020-04-13 00:16:23 +00:00
|
|
|
<style>
|
|
|
|
</style>
|
|
|
|
|
2020-04-13 16:55:00 +00:00
|
|
|
<script>
|
2020-04-14 08:52:01 +00:00
|
|
|
const use_relay = document.getElementById("use_relay")
|
|
|
|
const relay_host = document.getElementById("relay_host")
|
|
|
|
const relay_use_auth = document.getElementById("relay_use_auth")
|
|
|
|
const relay_auth_user = document.getElementById("relay_auth_user")
|
|
|
|
const relay_auth_pass = document.getElementById("relay_auth_pass")
|
|
|
|
|
2020-04-13 17:29:14 +00:00
|
|
|
function checkfields() {
|
2020-04-14 08:52:01 +00:00
|
|
|
let relay_enabled = use_relay.checked
|
|
|
|
let auth_enabled = relay_use_auth.checked
|
2020-04-13 17:29:14 +00:00
|
|
|
|
2020-04-14 08:52:01 +00:00
|
|
|
relay_host.disabled = !relay_enabled
|
|
|
|
relay_use_auth.disabled = !relay_enabled
|
|
|
|
relay_auth_auth.disabled = !(relay_enabled && auth_enabled)
|
|
|
|
relay_auth_pass.disabled = !(relay_enabled && auth_enabled)
|
2020-04-13 16:55:00 +00:00
|
|
|
}
|
2020-04-14 08:52:01 +00:00
|
|
|
|
2020-04-14 09:03:44 +00:00
|
|
|
api(
|
|
|
|
"/system/smtp/relay",
|
|
|
|
"GET",
|
|
|
|
{},
|
|
|
|
data => {
|
|
|
|
use_relay.checked = data.enabled
|
|
|
|
relay_host.value = data.host
|
|
|
|
relay_use_auth.checked = data.auth_enabled
|
|
|
|
relay_auth_user.value = data.user
|
|
|
|
relay_auth_pass.value = ""
|
2020-04-14 08:52:01 +00:00
|
|
|
|
2020-04-14 09:03:44 +00:00
|
|
|
checkfields()
|
|
|
|
}
|
|
|
|
)
|
2020-04-14 08:52:01 +00:00
|
|
|
|
2020-04-13 16:55:00 +00:00
|
|
|
</script>
|
|
|
|
|
2020-04-13 00:16:23 +00:00
|
|
|
<h2>SMTP Relays</h2>
|
|
|
|
|
2020-04-13 14:34:14 +00:00
|
|
|
<p>SMTP Relays are third-party services you can hand off the responsability of getting the mail delivered. They
|
|
|
|
can be useful when, for example, port 25 is blocked.</p>
|
|
|
|
|
2020-04-13 17:21:33 +00:00
|
|
|
<p>Here, you can configure an authenticated SMTP relay (for example, <a href="https://sendgrid.com/"
|
2020-04-13 14:34:14 +00:00
|
|
|
target="_blank">SendGrid</a>) over port 587.</p>
|
|
|
|
|
|
|
|
<div id="smtp_relay_config">
|
2020-04-13 14:53:47 +00:00
|
|
|
<h3>SMTP Relay Configuration</h3>
|
2020-04-13 14:34:14 +00:00
|
|
|
<form class="form-horizontal" role="form" onsubmit="return false;">
|
|
|
|
<div class="form-group">
|
2020-04-13 17:14:39 +00:00
|
|
|
<table style="width: 600px">
|
2020-04-13 17:29:14 +00:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<label for="use_relay" class="col-sm-1 control-label">Use Relay?</label>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="checkbox" id="use_relay" name="use_relay" value="true"
|
|
|
|
onclick="checkfields();">
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
2020-04-13 14:57:56 +00:00
|
|
|
<tr>
|
2020-04-13 15:13:26 +00:00
|
|
|
<td>
|
2020-04-13 17:14:39 +00:00
|
|
|
<label for="relay_host" class="col-sm-1 control-label">Hostname</label>
|
2020-04-13 15:13:26 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="relay_host" placeholder="host.domain.tld">
|
|
|
|
</div>
|
|
|
|
</td>
|
2020-04-13 17:14:39 +00:00
|
|
|
<td style="padding: 0; font-weight: bold;">:587</td>
|
2020-04-13 16:55:00 +00:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2020-04-13 17:05:49 +00:00
|
|
|
<td>
|
2020-04-13 17:14:39 +00:00
|
|
|
<label for="relay_use_auth" class="col-sm-1 control-label">Authenticate</label>
|
2020-04-13 17:05:49 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2020-04-13 17:09:04 +00:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<input checked type="checkbox" id="relay_use_auth" name="relay_use_auth" value="true"
|
2020-04-13 17:29:14 +00:00
|
|
|
onclick="checkfields();">
|
2020-04-13 17:09:04 +00:00
|
|
|
</div>
|
2020-04-13 17:05:49 +00:00
|
|
|
</td>
|
2020-04-13 14:57:56 +00:00
|
|
|
</tr>
|
2020-04-13 14:53:47 +00:00
|
|
|
|
2020-04-13 14:57:56 +00:00
|
|
|
<tr>
|
2020-04-13 15:13:26 +00:00
|
|
|
<td>
|
2020-04-13 15:18:26 +00:00
|
|
|
<label for="relay_auth_user" class="col-sm-1 control-label">Username</label>
|
2020-04-13 15:13:26 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="relay_auth_user" placeholder="user">
|
|
|
|
</div>
|
|
|
|
</td>
|
2020-04-13 14:57:56 +00:00
|
|
|
</tr>
|
2020-04-13 14:53:47 +00:00
|
|
|
|
2020-04-13 14:57:56 +00:00
|
|
|
<tr>
|
2020-04-13 15:13:26 +00:00
|
|
|
<td>
|
2020-04-13 15:18:26 +00:00
|
|
|
<label for="relay_auth_pass" class="col-sm-1 control-label">Password/Key</label>
|
2020-04-13 15:13:26 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="password" class="form-control" id="relay_auth_pass" placeholder="password">
|
|
|
|
</div>
|
|
|
|
</td>
|
2020-04-13 14:57:56 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2020-04-13 14:34:14 +00:00
|
|
|
</div>
|
|
|
|
|
2020-04-13 17:21:33 +00:00
|
|
|
<div>
|
2020-04-13 14:34:14 +00:00
|
|
|
<button type="submit" class="btn btn-primary">Update</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|