Skip to content

Invalid E-Mail error on valid email #9

Description

@moritztim

I ran just this function locally and it worked, but when I try to sign up on the production website, I get an Email invalid. error for an email that is registered using cloudflare e-mail forwarding.

func IsEmailValid(email string) bool {
length := len(email)
if length < 3 && length > 254 {
return false
}
if !emailRegex.MatchString(email) {
return false
}
parts := strings.Split(email, "@")
mx, err := net.LookupMX(parts[1])
if err != nil || len(mx) == 0 {
return false
}
return true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions