summaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorHorus32015-03-20 14:26:08 +0100
committerHorus32015-03-20 14:26:08 +0100
commit9ab1f49c4c4aa5dcaa0dd50ec606ca06ca071c71 (patch)
tree378bdbab80905a53c1193bfe28e22d1df0fbbcd3 /server.go
parent039fb0ce71d132a1dfe93b516bc5953dcb61285e (diff)
downloadfreemail-9ab1f49c4c4aa5dcaa0dd50ec606ca06ca071c71.tar.gz
Validate MX from domain. Improve Makefile. Add schema.txt
Diffstat (limited to 'server.go')
-rw-r--r--server.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/server.go b/server.go
index a0146b9..efe1174 100644
--- a/server.go
+++ b/server.go
@@ -2,6 +2,7 @@ package main
import (
"errors"
+ "os"
)
func CreateNewEntry(email, password string) error {
@@ -19,7 +20,9 @@ func CreateNewEntry(email, password string) error {
vD.Name = GetDomain(vU.Email)
if !vD.ValidateDomain() {
- 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("This doesn't look like a good domain. Host not found.")
+ }
}
if !vD.DomainExists() {