summaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorHorus32015-03-20 17:30:11 +0100
committerHorus32015-03-20 17:30:11 +0100
commit410504e069d37c522dca6bf820e9fc4cea2de871 (patch)
tree75db9c44b5e852652fd8e54b8d4db91147fb77a2 /server.go
parent9ab1f49c4c4aa5dcaa0dd50ec606ca06ca071c71 (diff)
downloadfreemail-410504e069d37c522dca6bf820e9fc4cea2de871.tar.gz
Check if domain points to mail server. Add http handler to create a new entry.
Diffstat (limited to 'server.go')
-rw-r--r--server.go9
1 files changed, 5 insertions, 4 deletions
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() {