From 7085690e3db57ffbfd49db633aefa5094efb7b88 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Tue, 16 Apr 2024 22:15:09 +1200 Subject: [PATCH] Only compile SMTPRelayConfig.AllowedRecipients if set --- config/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 019b9f49a..dea0b3bca 100644 --- a/config/config.go +++ b/config/config.go @@ -501,9 +501,8 @@ func validateRelayConfig() error { logger.Log().Infof("[smtp] enabling message relaying via %s:%d", SMTPRelayConfig.Host, SMTPRelayConfig.Port) - allowlistRegexp, err := regexp.Compile(SMTPRelayConfig.AllowedRecipients) - if SMTPRelayConfig.AllowedRecipients != "" { + allowlistRegexp, err := regexp.Compile(SMTPRelayConfig.AllowedRecipients) if err != nil { return fmt.Errorf("[smtp] failed to compile relay recipient allowlist regexp: %s", err.Error()) }