mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-09 16:25:15 +03:00
smtp: add debug option
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -275,6 +275,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="idSMTPDebug" name="smtp_debug"
|
||||
{{if gt .Configs.SMTP.Debug 0}}checked{{end}}>
|
||||
<label for="idSMTPDebug" class="form-check-label">Debug logs</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<div class="input-group">
|
||||
@@ -352,6 +360,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
$('#smtpTestResultModal').modal('show');
|
||||
return;
|
||||
}
|
||||
let debug = 0;
|
||||
if ($('#idSMTPDebug').is(':checked')){
|
||||
debug = 1;
|
||||
}
|
||||
$('#smtpSuccessMsg').hide();
|
||||
$('#smtpErrorMsg').hide();
|
||||
showSpinner();
|
||||
@@ -360,7 +372,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
url: "{{.ConfigsURL}}/smtp/test",
|
||||
type: 'POST',
|
||||
headers: {'X-CSRF-TOKEN' : '{{.CSRFToken}}'},
|
||||
data: JSON.stringify({"host": $('#idSMTPHost').val(),"port": parseInt($('#idSMTPPort').val()),"from": $('#idSMTPFrom').val(),"user": $('#idSMTPUsername').val(),"password": $('#idSMTPPassword').val(),"auth_type": parseInt($('#idSMTPAuth').val()),"encryption": parseInt($('#idSMTPEncryption').val()), "domain": $('#idSMTPDomain').val(),"recipient": recipient}),
|
||||
data: JSON.stringify({"host": $('#idSMTPHost').val(),"port": parseInt($('#idSMTPPort').val()),"from": $('#idSMTPFrom').val(),"user": $('#idSMTPUsername').val(),"password": $('#idSMTPPassword').val(),"auth_type": parseInt($('#idSMTPAuth').val()),"encryption": parseInt($('#idSMTPEncryption').val()), "domain": $('#idSMTPDomain').val(),"debug": debug, "recipient": recipient}),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
timeout: 15000,
|
||||
|
||||
Reference in New Issue
Block a user