smtpd

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package smtpd is the in-process SMTP listener. Receives RFC822 from any local sender, parses it with enmime, and hands the structured payload to the store.

Co-housed with the HTTP API in the same binary — no JSON-over-HTTP hop between SMTP ingest and persistence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// Listen is the bind address; default "127.0.0.1:3535". Comma-
	// separated host:port pairs spin up multiple listeners (used to
	// bind both 127.0.0.1 and ::1 so clients that resolve "localhost"
	// to ::1 — Node 17+, modern macOS — reach us without an explicit
	// 127.0.0.1).
	Listen string

	// MaxMessageBytes caps a single DATA body. Default 25 MB.
	MaxMessageBytes int64

	Store *store.Store

	// AfterInsert fires after a successful SMTP-driven Insert so the
	// outer process can dispatch background jobs / live broadcasts.
	// Not called when Insert fails.
	AfterInsert func(msgID string)
	// contains filtered or unexported fields
}

func (*Server) Addrs

func (s *Server) Addrs() []string

Addrs returns the TCP addresses the server is listening on (after Start). Useful for tests + boot logs.

func (*Server) Close

func (s *Server) Close()

Close stops the server and closes all listeners. Safe to call multiple times.

func (*Server) Start

func (s *Server) Start() error

Start binds + serves. Non-blocking — runs each listener in its own goroutine. Call Close to stop.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL