This is the main dovel repository, it has the Go code to run dovel SMTP server.
Author: bmayer3 (bmayer@sibros.tech)
Date: Mon Jan 23 13:44:33 2023 -0300
Parent: 4a25455
Updated docs
commit e459d8a1e5c275963f81bcb54b157664af42f88f
Author: bmayer3 <bmayer@sibros.tech>
Date: Mon Jan 23 13:44:33 2023 -0300
Updated docs
diff --git a/config/config.go b/config/config.go
index 6341e49..0bf7a34 100644
--- a/config/config.go
+++ b/config/config.go
@@ -9,11 +9,11 @@ type Handler func(email interfaces.Email, content []byte) error
// Config is the configuration structure used to set up dovel
// server and web interface. This should be a JSON file located
// in $HOME/.dovel-config.json
+// Server field configures the server, and WebPort is an optional field
+// used to specify the HTTP server port for the web interface, if present
+// the HTTP web server is started.
type Config struct {
- Server ServerConfig
-
- // WebPort is an optional field used to specify the HTTP server port
- // for the web interface, if present the HTTP web server is started.
+ Server ServerConfig
WebPort *string
}
@@ -25,16 +25,14 @@ type InboxConfig struct {
}
// ServerConfig is used to configure your email server.
+// Address is used to specify which address the server should listen
+// to connections, a typicall value is :2525.
+// Domain is what the server should respond in a HELO or EHLO request.
+// Inboxes are the accounts available is this server, i.e. the accepted
+// domains on emails: "example@example.domain". Each domain is handled
+// separetly, so you can receive email for multiple domains.
type ServerConfig struct {
- // Address is used to specify which address the server should listen
- // to connections, a typicall value is :2525.
Address string
-
- // Domain is what the server should respond in a HELO or EHLO request.
- Domain string
-
- // Inboxes are the accounts available is this server, i.e. the accepted
- // domains on emails: "example@example.domain". Each domain is handled
- // separatly, so you can receive email for multiple domains.
+ Domain string
Inboxes []InboxConfig
}
commit e459d8a1e5c275963f81bcb54b157664af42f88f
Author: bmayer3 <bmayer@sibros.tech>
Date: Mon Jan 23 13:44:33 2023 -0300
Updated docs
diff --git a/doc.go b/doc.go
index c1aa906..f565c23 100644
--- a/doc.go
+++ b/doc.go
@@ -5,7 +5,7 @@
// 1. The dovel binary
// 2. The interfaces library
//
-// # 1. The binary
+// # The binary
//
// This binary is the main server, it is configured using a single config
// file which should be located in ~/.dovel-config.json. This server is
@@ -16,28 +16,47 @@
// The structure of this config file is [blmayer.dev/x/dovel/config.Config]. See that doc for more
// info.
//
-// # 2. The library
+// # The library
//
// This package also delivers a subpackage called interfaces, it contains
// structs that are used through this project. Those are also used in templates
// and you can use them in other projects.
//
-// # Setting up you email server
+// # Setting up your email server
//
// Email works in a complex way, DNS records must match your server's
// configuration. This guide will try to give more detailed information
// in comparison with the website tutorial.
//
-// # Server configuration
-//
// An email server typically listens on ports 25, 2525, 587 or 465 for mail
// exchange. But their use differ:
//
-// - 25: is the original SMTP port and first to be official by RFC.
-// - 465: is marked as deprecated.
-// - 587: is also official by RFC, this port is used for TLS encrypted mail.
+// - 25: is the original SMTP port and first to be official by RFC.
+// - 465: is marked as deprecated.
+// - 587: is also official by RFC, this port is used for TLS encrypted mail.
+//
+// The current recomendation in to use port 586. To configure this server see
+// [blmayer.dev/x/dovel/config.Config].
+//
+// The server itself only receives email, for this feature only the MX record
+// is enough. There are 2 handlers included in this project:
+//
+// - gwi: to be used with the gwi project, saves email by subject, ish.
+// - file: closer to the standard, saves email using to and subject fields.
+//
+// The "file" handler gives you multiple inboxes, so you can separate by giving
+// different addresses, for example, email1@my.domain and email2@my.domain,
+// will have different inboxes. Inside each inbox emails are separated by
+// subject.
+//
+// The "gwi" handler is intended for mailing lists, or issues on git
+// repositories, email is added to the open folder, and then separated by
+// subject. See the gwi project for more information.
//
-// The current recomendation in to use port 586.
+// # Configuring DNS records
//
-// To configure this server see the [Config] struct.
+// 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.
package dovel