From 410504e069d37c522dca6bf820e9fc4cea2de871 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Fri, 20 Mar 2015 17:30:11 +0100 Subject: Check if domain points to mail server. Add http handler to create a new entry. --- server.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'server.go') diff --git a/server.go b/server.go index efe1174..66e3a94 100644 --- a/server.go +++ b/server.go @@ -19,10 +19,11 @@ func CreateNewEntry(email, password string) error { vD := VirtualDomain{} vD.Name = GetDomain(vU.Email) - if !vD.ValidateDomain() { - if !vD.ValidateDomainMX(os.Getenv("FREEMAIL_SMTP_MAILER_MX")) { - return errors.New("This doesn't look like a good domain. Host not found.") - } + if !vD.ValidateDomainMX(os.Getenv("FREEMAIL_SMTP_MAILER_MX")) { + return errors.New("The MX record doesn't point to this server.") + } + if !vD.ValidateDomain(os.Getenv("FREEMAIL_SMTP_MAILER_MX")) { + return errors.New("This doesn't look like a good domain. Host not found.") } if !vD.DomainExists() { -- cgit v1.2.3