govalidator icon indicating copy to clipboard operation
govalidator copied to clipboard

[BUG] Underscore in domain part of email are "valid"

Open sariya23 opened this issue 1 year ago • 1 comments

Bug Report

Q A
Version(s) v0.0.0-20230301143203-a9d515a09cc2

Summary

Underscore in the domain part is recognized as valid

Current behavior

Underscore in the domain part is recognized as valid

How to reproduce

import (
	"fmt"

	"github.com/asaskevich/govalidator"
)

func main() {
	e := "user@do_main.com"
	fmt.Println(govalidator.IsEmail(e)) // true
}

Expected behavior

import (
	"fmt"

	"github.com/asaskevich/govalidator"
)

func main() {
	e := "user@do_main.com"
	fmt.Println(govalidator.IsEmail(e)) // false
}

Info: https://en.wikipedia.org/wiki/Email_address#Domain

sariya23 avatar Mar 07 '25 20:03 sariya23

Agree!

fredgan avatar Mar 31 '25 08:03 fredgan