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:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: {
|
||||
|
||||
5
pkg/options/options.gen.go
generated
5
pkg/options/options.gen.go
generated
@@ -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{}) {
|
||||
|
||||
Reference in New Issue
Block a user