mirror of
https://github.com/axllent/mailpit.git
synced 2025-03-19 21:28:07 +02:00
Only compile SMTPRelayConfig.AllowedRecipients if set
This commit is contained in:
parent
7f430d3a45
commit
7085690e3d
@ -501,9 +501,8 @@ func validateRelayConfig() error {
|
|||||||
|
|
||||||
logger.Log().Infof("[smtp] enabling message relaying via %s:%d", SMTPRelayConfig.Host, SMTPRelayConfig.Port)
|
logger.Log().Infof("[smtp] enabling message relaying via %s:%d", SMTPRelayConfig.Host, SMTPRelayConfig.Port)
|
||||||
|
|
||||||
allowlistRegexp, err := regexp.Compile(SMTPRelayConfig.AllowedRecipients)
|
|
||||||
|
|
||||||
if SMTPRelayConfig.AllowedRecipients != "" {
|
if SMTPRelayConfig.AllowedRecipients != "" {
|
||||||
|
allowlistRegexp, err := regexp.Compile(SMTPRelayConfig.AllowedRecipients)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("[smtp] failed to compile relay recipient allowlist regexp: %s", err.Error())
|
return fmt.Errorf("[smtp] failed to compile relay recipient allowlist regexp: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user