mirror of
https://gitlab.com/commento/commento.git
synced 2025-06-28 22:55:39 -04:00
smtp_configure.go: allow empty username/password
Closes https://gitlab.com/commento/commento/issues/126
This commit is contained in:
@ -13,12 +13,16 @@ func smtpConfigure() error {
|
||||
password := os.Getenv("SMTP_PASSWORD")
|
||||
host := os.Getenv("SMTP_HOST")
|
||||
port := os.Getenv("SMTP_PORT")
|
||||
if username == "" || password == "" || host == "" || port == "" {
|
||||
if host == "" || port == "" {
|
||||
logger.Warningf("smtp not configured, no emails will be sent")
|
||||
smtpConfigured = false
|
||||
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") == "" {
|
||||
logger.Errorf("COMMENTO_SMTP_FROM_ADDRESS not set")
|
||||
smtpConfigured = false
|
||||
|
Reference in New Issue
Block a user