Skip to content

Commit

Permalink
Only compile SMTPRelayConfig.AllowedRecipients if set
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Apr 16, 2024
1 parent 7f430d3 commit 7085690
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 7085690

Please sign in to comment.