smtp: add debug option

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-05-30 19:11:28 +02:00
parent a2fc7d3cc5
commit 8339fee69d
10 changed files with 101 additions and 17 deletions

View File

@@ -2635,6 +2635,10 @@ func getSMTPConfigsFromPostFields(r *http.Request) *dataprovider.SMTPConfigs {
if err != nil {
encryption = 0
}
debug := 0
if r.Form.Get("smtp_debug") != "" {
debug = 1
}
return &dataprovider.SMTPConfigs{
Host: r.Form.Get("smtp_host"),
Port: port,
@@ -2644,6 +2648,7 @@ func getSMTPConfigsFromPostFields(r *http.Request) *dataprovider.SMTPConfigs {
AuthType: authType,
Encryption: encryption,
Domain: r.Form.Get("smtp_domain"),
Debug: debug,
}
}