Skip to content

Commit

Permalink
Updated regex pattern to allow longer TLDs
Browse files Browse the repository at this point in the history
  • Loading branch information
glennzw authored Dec 16, 2022
1 parent 2d08bef commit d2efb18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit d2efb18

Please sign in to comment.