From 0b37b33530cc47c08ca84f0b26d6b26fd1944d17 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Wed, 1 May 2019 18:34:37 -0400 Subject: [PATCH] smtp_configure.go: allow empty username/password Closes https://gitlab.com/commento/commento/issues/126 --- api/smtp_configure.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/smtp_configure.go b/api/smtp_configure.go index c801091..4be4d82 100644 --- a/api/smtp_configure.go +++ b/api/smtp_configure.go @@ -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