diff options
Diffstat (limited to 'model/utils.go')
-rw-r--r-- | model/utils.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/model/utils.go b/model/utils.go index 892f8c278..0d8d359a6 100644 --- a/model/utils.go +++ b/model/utils.go @@ -279,16 +279,18 @@ func IsLower(s string) bool { } func IsValidEmail(email string) bool { - if !IsLower(email) { return false } - if _, err := mail.ParseAddress(email); err == nil { - return true + if addr, err := mail.ParseAddress(email); err != nil { + return false + } else if addr.Name != "" { + // mail.ParseAddress accepts input of the form "Billy Bob <billy@example.com>" which we don't allow + return false } - return false + return true } var reservedName = []string{ |