mirror of
https://github.com/AfterShip/email-verifier.git
synced 2025-02-06 10:02:30 +00:00
return HasMXRecord as true when at least one valid mx records exist
This commit is contained in:
parent
e58b22c46c
commit
eb1b3afde3
4
mx.go
4
mx.go
@ -12,8 +12,8 @@ type Mx struct {
|
||||
func (v *Verifier) CheckMX(domain string) (*Mx, error) {
|
||||
domain = domainToASCII(domain)
|
||||
mx, err := net.LookupMX(domain)
|
||||
if err != nil {
|
||||
return nil, ParseSMTPError(err)
|
||||
if err != nil && len(mx) == 0 {
|
||||
return nil, err
|
||||
}
|
||||
return &Mx{
|
||||
HasMXRecord: len(mx) > 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user