From eb1b3afde39092131c2abac4c62f4fa7c2a79989 Mon Sep 17 00:00:00 2001 From: Aviv Shafir Date: Fri, 16 Jun 2023 16:48:49 +0300 Subject: [PATCH] return HasMXRecord as true when at least one valid mx records exist --- mx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mx.go b/mx.go index 889e034..c9cbbee 100644 --- a/mx.go +++ b/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,