3
0

Fix SMTP values in settings on server restart

It addresses issue with SMTP_* setting value, which were overwritten by values from env on server restart and also, removed default value of SMTP_HOST and SMTP_PORT, which were also causing the same issue.
This commit is contained in:
Vivek Patel
2022-08-04 18:06:29 +05:30
parent 85f399d2e4
commit 75b7d78eac
4 changed files with 6 additions and 9 deletions

View File

@@ -300,8 +300,8 @@
###############################################################################
# The SMTP server hostname.
# Type: string
# Default: localhost
# SMTP_HOST=localhost
# Default: <no value>
# SMTP_HOST=<no value>
###############################################################################
# The SMTP post.

View File

@@ -806,11 +806,13 @@ func applySmtpOptionsToSettings(ctx context.Context, log *zap.Logger, opt option
log.Warn(
"Environmental variables (SMTP_*) and SMTP settings " +
"(most likely changed via admin console) are not the same. " +
"When server was restarted, values from environmental" +
"When server was restarted, values from environmental " +
"variables were copied to settings for easier management. " +
"To avoid confusion and potential issues, we suggest you to " +
"remove all SMTP_* variables")
}
return
}
// SMTP server settings do not exist but

View File

@@ -21,12 +21,10 @@ SMTP: schema.#optionsGroup & {
options: {
host: {
defaultValue: "localhost"
description: "The SMTP server hostname."
}
port: {
type: "int"
defaultGoExpr: "25"
description: "The SMTP post."
}
user: {

View File

@@ -430,10 +430,7 @@ func SCIM() (o *SCIMOpt) {
//
// This function is auto-generated
func SMTP() (o *SMTPOpt) {
o = &SMTPOpt{
Host: "localhost",
Port: 25,
}
o = &SMTPOpt{}
// Custom defaults
func(o interface{}) {