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

b38a81a

Author: brian (git@myr.sh)

Date: Sun Sep 10 18:27:53 2023 -0300

Parent: abf55a1

Added /hooks to config dir

Diff

cmd/dovel/backend.go

commit b38a81af22921b4586891e99d2f4cfc683777d8d
Author: brian <git@myr.sh>
Date:   Sun Sep 10 18:27:53 2023 -0300

    Added /hooks to config dir

diff --git a/cmd/dovel/backend.go b/cmd/dovel/backend.go
index c5f9949..8d45119 100644
--- a/cmd/dovel/backend.go
+++ b/cmd/dovel/backend.go
@@ -76,7 +76,7 @@ func (s *Session) Data(raw io.Reader) error {
 		return err
 	}
 	domain := strings.Split(from.Address, "@")[1]
-	h := path.Join(configPath, "send-"+domain)
+	h := path.Join(configPath, "hooks", "send-"+domain)
 	if _, err := os.Stat(h); err == nil {
 		err := s.Send(s.from, s.tos, strings.NewReader(string(cont)))
 		if err != nil {
@@ -98,7 +98,7 @@ func (s *Session) Data(raw io.Reader) error {
 		}
 		domain := strings.Split(toAddr.Address, "@")[1]
 
-		h := path.Join(configPath, "receive-"+domain)
+		h := path.Join(configPath, "hooks", "receive-"+domain)
 		if _, err := os.Stat(h); err != nil {
 			println(domain, "receive error:", err.Error())
 			continue
@@ -109,7 +109,6 @@ func (s *Session) Data(raw io.Reader) error {
 		if err := c.Run(); err != nil {
 			return err
 		}
-
 	}
 
 	return nil

doc.go

commit b38a81af22921b4586891e99d2f4cfc683777d8d
Author: brian <git@myr.sh>
Date:   Sun Sep 10 18:27:53 2023 -0300

    Added /hooks to config dir

diff --git a/doc.go b/doc.go
index da7e951..edb7e06 100644
--- a/doc.go
+++ b/doc.go
@@ -38,9 +38,10 @@
 //
 // The server itself only receives email, for this feature only the MX record
 // is enough. Everytime dovel receives an email it searches for an executable
-// file in $XDG_CONFIG_DIR/dovel/ named receive-DOMAIN, for the DOMAIN the is
+// file in $XDG_CONFIG_DIR/dovel/hooks/ named receive-DOMAIN, for the DOMAIN
 // receiving the email and executes it passing the email in mbox format as
-// standard input.
+// standard input. Then it is up to the script to decide what to do. See the
+// scripts repo for examples.
 //
 // # Configuring DNS records
 //