diff options
Diffstat (limited to 'domain.go')
| -rw-r--r-- | domain.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -45,6 +45,23 @@ func (vD VirtualDomain) ValidateDomain() bool { } return true } +func (vD VirtualDomain) ValidateDomainMX(ref string) bool { + if vD.Name == "" { + return false + } + mx, err := net.LookupMX(vD.Name) + if err != nil { + log.Println(err) + return false + } + match := false + for _, v := range mx { + if v.Host == ref { + match = true + } + } + return match +} func GetDomain(email string) string { fragments := strings.Split(email, "@") |
