From f8a4da578bc8f58924ef060b60c472ade8390d55 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Tue, 2 Jun 2015 05:38:12 +0200 Subject: Bug fix and better wording. --- Makefile | 2 +- domain.go | 28 +++++++++++--- html/about.html | 65 ++++++++++++++++++++++++++++++++ html/about_de.html | 66 ++++++++++++++++++++++++++++++++ html/alert.html | 24 ++++++++++++ html/footer.html | 56 +++++++++++++++++++++++++++ html/header.html | 17 +++++++++ html/howto.html | 52 +++++++++++++++++++++++++ html/howto_de.html | 49 ++++++++++++++++++++++++ html/index.html | 47 +++++++++++++++++++++++ html/index_de.html | 46 +++++++++++++++++++++++ html/navbar.html | 56 +++++++++++++++++++++++++++ html/navbar_de.html | 56 +++++++++++++++++++++++++++ html/password.html | 76 +++++++++++++++++++++++++++++++++++++ html/password_de.html | 76 +++++++++++++++++++++++++++++++++++++ html/privacy.html | 44 ++++++++++++++++++++++ html/privacy_de.html | 44 ++++++++++++++++++++++ html/register.html | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ html/register_de.html | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ html/server.html | 79 ++++++++++++++++++++++++++++++++++++++ html/server_de.html | 81 +++++++++++++++++++++++++++++++++++++++ html/tos.html | 40 ++++++++++++++++++++ html/tos_de.html | 39 +++++++++++++++++++ html/user.html | 46 +++++++++++++++++++++++ html/user_de.html | 43 +++++++++++++++++++++ main.go | 3 +- statistics/mailgraph.cgi | 3 -- views/about.html | 65 -------------------------------- views/about_de.html | 66 -------------------------------- views/alert.html | 24 ------------ views/email/index.html | 0 views/footer.html | 56 --------------------------- views/header.html | 17 --------- views/howto.html | 52 ------------------------- views/howto_de.html | 49 ------------------------ views/index.html | 47 ----------------------- views/index_de.html | 46 ----------------------- views/navbar.html | 56 --------------------------- views/navbar_de.html | 56 --------------------------- views/password.html | 76 ------------------------------------- views/password_de.html | 76 ------------------------------------- views/privacy.html | 42 --------------------- views/privacy_de.html | 42 --------------------- views/register.html | 98 ------------------------------------------------ views/register_de.html | 98 ------------------------------------------------ views/server.html | 79 -------------------------------------- views/server_de.html | 81 --------------------------------------- views/tos.html | 38 ------------------- views/tos_de.html | 37 ------------------ views/user.html | 46 ----------------------- views/user_de.html | 43 --------------------- 51 files changed, 1322 insertions(+), 1302 deletions(-) create mode 100644 html/about.html create mode 100644 html/about_de.html create mode 100644 html/alert.html create mode 100644 html/footer.html create mode 100644 html/header.html create mode 100644 html/howto.html create mode 100644 html/howto_de.html create mode 100644 html/index.html create mode 100644 html/index_de.html create mode 100644 html/navbar.html create mode 100644 html/navbar_de.html create mode 100644 html/password.html create mode 100644 html/password_de.html create mode 100644 html/privacy.html create mode 100644 html/privacy_de.html create mode 100644 html/register.html create mode 100644 html/register_de.html create mode 100644 html/server.html create mode 100644 html/server_de.html create mode 100644 html/tos.html create mode 100644 html/tos_de.html create mode 100644 html/user.html create mode 100644 html/user_de.html delete mode 100644 views/about.html delete mode 100644 views/about_de.html delete mode 100644 views/alert.html delete mode 100644 views/email/index.html delete mode 100644 views/footer.html delete mode 100644 views/header.html delete mode 100644 views/howto.html delete mode 100644 views/howto_de.html delete mode 100644 views/index.html delete mode 100644 views/index_de.html delete mode 100644 views/navbar.html delete mode 100644 views/navbar_de.html delete mode 100644 views/password.html delete mode 100644 views/password_de.html delete mode 100644 views/privacy.html delete mode 100644 views/privacy_de.html delete mode 100644 views/register.html delete mode 100644 views/register_de.html delete mode 100644 views/server.html delete mode 100644 views/server_de.html delete mode 100644 views/tos.html delete mode 100644 views/tos_de.html delete mode 100644 views/user.html delete mode 100644 views/user_de.html diff --git a/Makefile b/Makefile index 95cb3b5..6f76677 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ pack: gen_config if [ ! -d $(FREEMAIL_DB_DIR) ]; then \ mkdir $(FREEMAIL_DB_DIR); \ fi - tar czf $(APP).tar.gz start.sh $(APP) _env.sh views static $(FREEMAIL_DB_DIR) statistics 2>/dev/null && \ + tar czf $(APP).tar.gz start.sh $(APP) _env.sh html static $(FREEMAIL_DB_DIR) statistics 2>/dev/null && \ rm start.sh 2>/dev/null && \ echo "\n/$(APP).tar.gz is ready." || \ (echo "Run \"make build\" first." && exit 1) diff --git a/domain.go b/domain.go index 252cab4..e18b379 100644 --- a/domain.go +++ b/domain.go @@ -32,6 +32,7 @@ func (vD VirtualDomain) CreateDomain() bool { return true } +// TODO: Needs better handling with multiple IPs. func (vD VirtualDomain) ValidateDomain(ref string) bool { log.Println("Info: Validating " + vD.Name) if vD.Name == "" { @@ -52,36 +53,51 @@ func (vD VirtualDomain) ValidateDomain(ref string) bool { } return reflect.DeepEqual(serverIP, addr) } + func (vD VirtualDomain) ValidateDomainMX(ref string) bool { log.Println("Info: Validating MX " + vD.Name) + var isValid bool = false // Has the domain an MX entry pointing to this server? + if vD.Name == "" { log.Println("Info: Empty domain.") return false } + + // All the MX entries for the desired domain. mx, err := net.LookupMX(vD.Name) if err != nil { log.Println("Info: Lookup error " + vD.Name + " " + err.Error()) return false } - match := false - serverIP, err := net.LookupIP(ref) + // Our IPs. + serverIPs, err := net.LookupIP(ref) if err != nil { log.Println("Info: Lookup error for server " + ref + " " + err.Error()) return false } + + // We loop over MX entries, each one has a host field. for _, v := range mx { - mxIP, err := net.LookupIP(v.Host) + // Each host field may have multiple IPs. + mxIPs, err := net.LookupIP(v.Host) if err != nil { log.Println("Info: ", err) } - if reflect.DeepEqual(serverIP, mxIP) { - match = true + // Our server has probably more than one IP as well... + for _, serverIP := range serverIPs { + // ... thus we need to compare all of them. + for _, mxIP := range mxIPs { + if string(serverIP) == string(mxIP) { + isValid = true + } + } } } - return match + return isValid } +// Returns the last fragment from a string splitted by '@'. func GetDomain(email string) string { fragments := strings.Split(email, "@") return fragments[len(fragments)-1] diff --git a/html/about.html b/html/about.html new file mode 100644 index 0000000..364bc28 --- /dev/null +++ b/html/about.html @@ -0,0 +1,65 @@ +{{template "header.html" "About | Libremail"}} +{{template "navbar.html"}} +{{template "alert.html" .}} + +
We host your E-Mail, like GMail or Yahoo mail. But without ads or selling your data.
+Because Libremail is young, free (without commercial aim) and open source. If you don't want it hosted, grab the source and run it on your own server.
+
+ Also we run a secure setup. Read here more.
Libremail is hosted on a dedicated server and managed by Maximilian Möhring . +
+Our IMAP login server enforces TLS 1.0, 1.1 or 1.2 with Perfect Forward Secrecy.
+
If you are interested, those SSL ciphers are allowed: ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
+
In regards of SMTP, since enforcing strict security may prevent a remote client from connecting, we have to allow incomming mails with the SSLv3 protocol. On the other hand, SMTP is not vulnerable to POODLE either way.
+
Please note: Since Libremail is hosted we can't provide end-to-end encryption, but we strongly suggest to use GPG.
+
Because it's fun and useful. There is no plan to make money with Libremail. +
+Please look here.
+
+
+
+
+ THERE IS ABSOLUT NO WARRANTY IN ANY WAY, BE IT UPTIME, BACKUP OR ABUSE. THE USER IS RESPONSIBLE FOR HIS OWN DOING. +
+Wir hosten Ihre E-Mails, so wie GMail oder Yahoo mail. Aber ohne Werbung und ohne Ihre Daten zu verkaufen.
+Libremail ist jung, frei (ohne kommerzielle Absicht) und Open Source. Wenn Sie uns nicht vertrauen, setzen Sie sich es selber auf!
+
+ Außerdem legen wir Wert auf Sicherheit. Lesen Sie hier mehr.
Libremail liegt auf einem sicherem Server und wird von Maximilian Möhring betrieben. +
+Unser IMAP Login Server erzwingt TLS 1.0, 1.1 oder 1.2 mit Perfect Forward Secrecy.
+
Falls Sie interessiert sind, nur diese SSL ciphers sind zugelassen: ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
+
In Bezug auf eingehende E-Mails, das erzwingen von absoluter Sicherheit könnte unter Umständen einen entfernen Klienten daran hindern E-Mails zuzustellen. Deswegen überlauben wir für unseren SMTP Server immer noch das SSLv3 Protokoll. Auf der anderen Seite, SMTP war sowieso nie durch POODLE betroffen.
+
+
+ Beachtung: Weil Libremail auf unserem Server liegt können wir keine wahre Ende-zu-Ende Verschlüsselung erzwingen. Wir empfehlen aber trotzdem den Gebrauch von GnuPG.
+
Weil es Spaß macht und es nützlich ist. Libremail ist nicht dafür gebaut worden um Geld zu machen. +
+Schauen Sie hier nach.
+ ++ ES WIRD KEINERLEI GARANTIE IN IRGENDEINER ART UND WEISE GEWÄHRLEISTET, SEI ES ERREICHBARKEIT, BACKUPS ODER MISSBRAUCH. JEDER NUTZER IST FÜR SEIN EIGENES VERHALTEN VERANTWORTLICH. +
+