summaryrefslogtreecommitdiff
path: root/domain.go
diff options
context:
space:
mode:
Diffstat (limited to 'domain.go')
-rw-r--r--domain.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/domain.go b/domain.go
index c7b5102..0e3bfcc 100644
--- a/domain.go
+++ b/domain.go
@@ -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, "@")