smtp_configure.go: allow empty username/password
Closes https://gitlab.com/commento/commento/issues/126
This commit is contained in:
parent
b67d2ba58c
commit
0b37b33530
@ -13,12 +13,16 @@ func smtpConfigure() error {
|
|||||||
password := os.Getenv("SMTP_PASSWORD")
|
password := os.Getenv("SMTP_PASSWORD")
|
||||||
host := os.Getenv("SMTP_HOST")
|
host := os.Getenv("SMTP_HOST")
|
||||||
port := os.Getenv("SMTP_PORT")
|
port := os.Getenv("SMTP_PORT")
|
||||||
if username == "" || password == "" || host == "" || port == "" {
|
if host == "" || port == "" {
|
||||||
logger.Warningf("smtp not configured, no emails will be sent")
|
logger.Warningf("smtp not configured, no emails will be sent")
|
||||||
smtpConfigured = false
|
smtpConfigured = false
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if username == "" || password == "" {
|
||||||
|
logger.Warningf("no SMTP username/password set, Commento will assume they aren't required")
|
||||||
|
}
|
||||||
|
|
||||||
if os.Getenv("SMTP_FROM_ADDRESS") == "" {
|
if os.Getenv("SMTP_FROM_ADDRESS") == "" {
|
||||||
logger.Errorf("COMMENTO_SMTP_FROM_ADDRESS not set")
|
logger.Errorf("COMMENTO_SMTP_FROM_ADDRESS not set")
|
||||||
smtpConfigured = false
|
smtpConfigured = false
|
||||||
|
Loading…
Reference in New Issue
Block a user