From d2efb18ef1e35b7faa32eb97e191056f7157c4f6 Mon Sep 17 00:00:00 2001 From: Glenn Wilkinson Date: Fri, 16 Dec 2022 17:04:55 +0000 Subject: [PATCH] Updated regex pattern to allow longer TLDs --- models/smtp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/smtp.go b/models/smtp.go index aeedce42..89796457 100644 --- a/models/smtp.go +++ b/models/smtp.go @@ -104,7 +104,7 @@ func (s *SMTP) Validate() error { // validateFromAddress validates func validateFromAddress(email string) bool { - r, _ := regexp.Compile("^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$") + r, _ := regexp.Compile("^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,18})$") return r.MatchString(email) }