This is the main dovel repository, it has the Go code to run dovel SMTP server.
Author: blmayer (bleemayer@gmail.com)
Date: Thu Sep 14 18:27:13 2023 -0300
Parent: 7b5d4ee
Improved docs
commit 6e42d9bb7b6bcf0e8185e43a6b4c2d5945e25253
Author: blmayer <bleemayer@gmail.com>
Date: Thu Sep 14 18:27:13 2023 -0300
Improved docs
diff --git a/doc.go b/doc.go
index e5f3ecf..1ee8182 100644
--- a/doc.go
+++ b/doc.go
@@ -4,8 +4,7 @@
// file which should be located in ~/.config/dovel/config.json. This server is
// responsible to receive your emails and save them according to your hooks.
//
-// The structure of this config file is
-// [git.derelict.garden/dovel/email/config.Config]. See that doc for more
+// The structure of this config file is [Config]. See that doc for more
// info.
//
// # Setting up your email server
@@ -23,7 +22,7 @@
//
// The current recomendation is to use port 586. Dovel works with any port,
// and the value must be set in the port field of the config file. To
-// configure this server see [git.derelict.garden/dovel/email/config.Config].
+// configure this server see [Config].
//
// To receive email only the MX record is enough. Everytime dovel receives an
// email it searches for an executable file in $XDG_CONFIG_DIR/dovel/hooks/
@@ -47,8 +46,15 @@
//
// To receive emails you need to setup the MX record in your domain registrar,
// sending email is more complicated, some receiving servers only need the SPF
-// and PTR records, some also need DKIM and DMARK, adjust according to your
-// needs.
+// and PTR records, some also need DKIM and DMARC, adjust according to your
+// needs. Configuring DNS records is not the goal of this doc.
+//
+// # DKIM configuration
+//
+// DKIM in dovel is handled in a per-user basis only for sending emails,
+// for receiving emails it is up to the corresponding hook. This means that
+// each user have to setup its DKIM key. Luckily this is simply pointing
+// the key path in the [User] struct.
//
// # Sending email
//
@@ -56,6 +62,8 @@
// config. That means you need at least one user descrived on the json file.
// The format of that file is a JSON array of the [User] struct.
//
-// Dovel is listening to commands on the port specified in the config file
-// use any email client to communicate with dovel.
+// Dovel is listening to connections on the port specified in the config file
+// use any email client to communicate with dovel. When an email comes from
+// the domain configured Dovel will check if the sending user is valid using
+// the Vault interface, in positive case the email is sent.
package email
commit 6e42d9bb7b6bcf0e8185e43a6b4c2d5945e25253
Author: blmayer <bleemayer@gmail.com>
Date: Thu Sep 14 18:27:13 2023 -0300
Improved docs
diff --git a/model.go b/model.go
index 94d528a..53ad37e 100644
--- a/model.go
+++ b/model.go
@@ -1,6 +1,3 @@
-// package email contains interfaces that are passed to the common
-// functions on the server and web projects. You can import this to use
-// on templates and handlers.
package email
import (
@@ -19,6 +16,9 @@ type Config struct {
VaultFile string
}
+// User represents a user that should be able to send emails. This struct is
+// found in the users json file, that is on the path pointed by VaultFile field
+// in [Config]. PrivateKey is the path to a private key for the DKIM signature.
type User struct {
Name string
Email string