list

server

This is the main dovel repository, it has the Go code to run dovel SMTP server.

curl https://dovel.email/server.tar tar

7ea8e99

Author: bmayer3 (bmayer@sibros.tech)

Date: Mon Feb 13 18:19:17 2023 -0300

Parent: f41ab4f

Ajusted style

Diff

interfaces/backend/backend.go

commit 7ea8e99a20a979bd73f8d6cd8eea19182d539e96
Author: bmayer3 <bmayer@sibros.tech>
Date:   Mon Feb 13 18:19:17 2023 -0300

    Ajusted style

diff --git a/interfaces/backend/backend.go b/interfaces/backend/backend.go
index c6b8d50..48f9b4a 100644
--- a/interfaces/backend/backend.go
+++ b/interfaces/backend/backend.go
@@ -216,7 +216,7 @@ func (b Backend) SendHandler(saveFunction func(e interfaces.Email, b []byte) err
 				return
 			}
 
-			saveFunction(email, body.Bytes())
+			saveFunction(email, payload.Bytes())
 		}
 		http.Redirect(w, r, "/", http.StatusFound)
 	}

interfaces/file/file.go

commit 7ea8e99a20a979bd73f8d6cd8eea19182d539e96
Author: bmayer3 <bmayer@sibros.tech>
Date:   Mon Feb 13 18:19:17 2023 -0300

    Ajusted style

diff --git a/interfaces/file/file.go b/interfaces/file/file.go
index 9ffc14a..74b4b72 100644
--- a/interfaces/file/file.go
+++ b/interfaces/file/file.go
@@ -100,6 +100,8 @@ func (f FileHandler) Save(email interfaces.Email, content []byte) error {
 		println("file create", err.Error())
 		return err
 	}
+	defer file.Close()
+
 	_, err = file.Write(content)
 	if err != nil {
 		println("file write", err.Error())
@@ -118,6 +120,8 @@ func (f FileHandler) SaveSent(email interfaces.Email, content []byte) error {
 		println("file create", err.Error())
 		return err
 	}
+	defer file.Close()
+
 	_, err = file.Write(content)
 	if err != nil {
 		println("file write", err.Error())

www/inboxes.html

commit 7ea8e99a20a979bd73f8d6cd8eea19182d539e96
Author: bmayer3 <bmayer@sibros.tech>
Date:   Mon Feb 13 18:19:17 2023 -0300

    Ajusted style

diff --git a/www/inboxes.html b/www/inboxes.html
index 92cb382..84d1b9a 100644
--- a/www/inboxes.html
+++ b/www/inboxes.html
@@ -1,15 +1,16 @@
 {{template "head.html"}}
 
-{{with $inbox := (index .inbox 0)}}
-// <a href="index.html">index</a>
+<section>
+	<b>inbox {{.Get "inbox"}}</b><br><br>
+	<a href="index.html">index</a>&emsp;
+	<a href="compose.html?inbox={{.Get "inbox"}}">compose</a>
+</section>
+<br>
 
-<p>// <b>inbox {{$inbox}}</b></p>
-
-// <a href="compose.html?inbox={{$inbox}}">compose</a>
-{{range (inboxes $inbox)}}
-<p>
-// <a href="mails.html?inbox={{$inbox}}&subj={{.Title}}">{{.Title}}</a><br>
-// Updated: {{.LastMod.Format "Mon, 02 Jan 2006 15:04:05 MST"}}
-</p>
-{{end}}
+<section>
+{{range (inboxes (.Get "inbox"))}}
+	<a href="mails.html?inbox={{$.Get "inbox"}}&subj={{.Title}}">{{.Title}}</a><br>
+	Updated: {{.LastMod.Format "Mon, 02 Jan 2006 15:04:05 MST"}}<br>
+	<br>
 {{end}}
+</section>

www/index.html

commit 7ea8e99a20a979bd73f8d6cd8eea19182d539e96
Author: bmayer3 <bmayer@sibros.tech>
Date:   Mon Feb 13 18:19:17 2023 -0300

    Ajusted style

diff --git a/www/index.html b/www/index.html
index f094d48..ed981cb 100644
--- a/www/index.html
+++ b/www/index.html
@@ -1,13 +1,16 @@
 {{template "head.html"}}
 
-// <b>inboxes!</b>
+<section>
+	<b>inboxes!</b><br><br>
 
-<p>// <a href=compose.html>compose</a></p>
+	<a href=compose.html>compose</a>
+</section>
+<br>
 
+<section>
 {{range (inboxes ".")}}
-<p>
-	// <a href="inboxes.html?inbox={{.Title}}">{{.Title}}</a><br>
-	// Updated: {{.LastMod.Format "Mon, 02 Jan 2006 15:04:05 MST"}}
-</p>
+	<a href="inboxes.html?inbox={{.Title}}">{{.Title}}</a><br>
+	Updated: {{.LastMod.Format "Mon, 02 Jan 2006 15:04:05 MST"}}
+	<br><br>
 {{end}}
-
+</section>

www/mail.html

commit 7ea8e99a20a979bd73f8d6cd8eea19182d539e96
Author: bmayer3 <bmayer@sibros.tech>
Date:   Mon Feb 13 18:19:17 2023 -0300

    Ajusted style

diff --git a/www/mail.html b/www/mail.html
index 8dca6de..69a198f 100644
--- a/www/mail.html
+++ b/www/mail.html
@@ -1,29 +1,35 @@
 {{template "head.html"}}
 
-{{with $subj := printf "%s/%s" (index .inbox 0) (index .subj 0)}}
-{{with $inbox := (index $.inbox 0)}}
-// <a href="mails.html?inbox={{$inbox}}&subj={{index $.subj 0}}">back</a>
-
-<p>// <a href="compose.html?inbox={{$inbox}}&subj={{index $.subj 0}}">compose</a><p>
+{{with $subj := printf "%s/%s" (.Get "inbox") (.Get "subj")}}
+{{with $inbox := ($.Get "inbox")}}
+<section>
+	<a href="mails.html?inbox={{$inbox}}&subj={{index $.subj 0}}">back</a><br><br>
 
+	<a href="compose.html?inbox={{$inbox}}&subj={{index $.subj 0}}">compose</a>
+</section>
+<br>
 {{range (mails $subj)}}
-<p>
-// From: {{.From}}<br>
-// To: {{index .To 0}}<br>
-// Date: {{.Date.Format "Mon, 02 Jan 2006 15:04:05 MST"}}<br>
-{{if .Cc}}
-// Cc: .Cc<br>
-{{end}}
-// Subject: {{.Subject}}<br>
-// Body:<br><br>
-{{.Body}}<br><br>
-{{if .Attachments}}
-// Attachments:<br>
-{{range .Attachments}}
-// <a href="data:{{.ContentType}};base64,{{.Data}}" download="{{.Name}}">{{.Name}}</a><br>
-{{end}}
-{{end}}
-</p>
+	<section>
+	From: {{.From}}<br>
+	To: {{index .To 0}}<br>
+	Date: {{.Date.Format "Mon, 02 Jan 2006 15:04:05 MST"}}<br>
+	{{if .Cc}}
+	Cc: .Cc<br>
+	{{end}}
+	Subject: {{.Subject}}<br>
+	{{if .Attachments}}
+	<br>
+	Attachments:<br>
+	{{range .Attachments}}
+	<a href="data:{{.ContentType}};base64,{{.Data}}" download="{{.Name}}">{{.Name}}</a><br>
+	{{end}}
+	{{end}}
+	{{if .Body}}
+	<br>
+	Body:<br><br>
+	{{.Body}}
+	{{end}}
+	</section>
 {{end}}
 
 {{end}}

www/mails.html

commit 7ea8e99a20a979bd73f8d6cd8eea19182d539e96
Author: bmayer3 <bmayer@sibros.tech>
Date:   Mon Feb 13 18:19:17 2023 -0300

    Ajusted style

diff --git a/www/mails.html b/www/mails.html
index b1e2f63..dad7112 100644
--- a/www/mails.html
+++ b/www/mails.html
@@ -1,30 +1,33 @@
 {{template "head.html"}}
 
-{{with $subj := (index .subj 0)}}
-{{with $inbox := (index $.inbox 0)}}
-// <a href="inboxes.html?inbox={{$inbox}}">inbox</a>
+<section>
+	<b>about {{.Get "inbox"}}</b><br><br>
+	<a href="inboxes.html?inbox={{.Get "inbox"}}">inbox</a>&emsp;
+	<a href="compose.html?inbox={{.Get "inbox"}}">compose</a>
+</section>
+<br>
 
-<p>// <b>about {{$inbox}}</b><p>
-
-{{range (mails (print $inbox "/" $subj))}}
-<p>// <a href="mail.html?inbox={{$inbox}}&subj={{$subj}}&id={{.ID}}">{{$subj}}</a><br>
-{{if eq $inbox .From}}
-// To: {{index .To 0}}</a><br>
-{{else}}
-// From: {{.From}}<br>
-{{end}}
-// Date: {{.Date.Format "Mon, 02 Jan 2006 15:04:05 MST"}}<br>
-{{if .Cc}}
-// Cc: .Cc<br>
-{{end}}
-// Body: {{heading .Body 30}}<br>
-{{if .Attachments}}
-// Attachments:<br>
-{{range .Attachments}}
-// {{.Name}}<br>
-{{end}}
-</p>
-{{end}}
-{{end}}
-{{end}}
+<section>
+{{range (mails (print (.Get "inbox") "/" (.Get "subj")))}}
+	<a href="mail.html?inbox={{$.Get "inbox"}}&subj={{$.Get "subj"}}&id={{.ID}}">{{$.Get "subj"}}</a><br>
+	{{if eq ($.Get "inbox") .From}}
+	To: {{index .To 0}}</a><br>
+	{{else}}
+	From: {{.From}}<br>
+	{{end}}
+	Date: {{.Date.Format "Mon, 02 Jan 2006 15:04:05 MST"}}<br>
+	{{if .Cc}}
+	Cc: .Cc<br>
+	{{end}}
+	{{if .Attachments}}
+	Attachments:<br>
+	{{range .Attachments}}
+	{{.Name}}<br>
+	{{end}}
+	{{end}}
+	{{if .Body}}
+	Body: {{heading .Body 40}}<br>
+	{{end}}
+	<br>
 {{end}}
+</section>

www/style-min.html

commit 7ea8e99a20a979bd73f8d6cd8eea19182d539e96
Author: bmayer3 <bmayer@sibros.tech>
Date:   Mon Feb 13 18:19:17 2023 -0300

    Ajusted style

diff --git a/www/style-min.html b/www/style-min.html
index 8f21fdd..24fb2a0 100644
--- a/www/style-min.html
+++ b/www/style-min.html
@@ -1,12 +1,16 @@
 <style>
-	body{
+	body {
 		width: 541;
 		margin: 99 auto;
 		background: #000;
 		color: #0f0;
 		font-family: monospace;
 	}
-	a{
+	section {
+		border: 2px solid #0f0;
+		padding: 12px;
+	}
+	a {
 		color:#f0f
 	}
 	input, textarea {