smtp

package
v2.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailAddress

type EmailAddress struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}

EmailAddress represents an email address.

type EventStorer

type EventStorer interface {
	HandleIncoming(ctx context.Context, inc *event.Incoming) error
}
type Link struct {
	URL    string `json:"url"`
	Text   string `json:"text,omitempty"`
	Source string `json:"source"` // "html" or "text"
}

Link represents a URL extracted from a message.

type MessageFilter

type MessageFilter struct {
	To              string
	From            string
	Cc              string
	Subject         string
	SubjectContains string
	SubjectRegex    string
	BodyContains    string
	Project         string
	Since           float64 // unix timestamp (seconds)
	Until           float64 // unix timestamp (seconds)
	Limit           int
	Offset          int
	Order           string // "asc" or "desc"
}

MessageFilter holds filter criteria for SMTP message queries.

type Module

type Module struct {
	module.BaseModule
	// contains filtered or unexported fields
}

func New

func New(addr string, attachments *storage.AttachmentStore, db *sql.DB) *Module

func (*Module) Name

func (m *Module) Name() string

func (*Module) OnEventStored

func (m *Module) OnEventStored(ev event.Event)

OnEventStored notifies any long-poll waiters when a new SMTP event arrives.

func (*Module) OnEventsDeleted

func (m *Module) OnEventsDeleted(uuids []string)

OnEventsDeleted removes the attachment rows of deleted events.

func (*Module) PreviewMapper

func (m *Module) PreviewMapper() event.PreviewMapper

func (*Module) RegisterProtectedRoutes

func (m *Module) RegisterProtectedRoutes(mux *http.ServeMux, protect func(http.Handler) http.Handler)

RegisterProtectedRoutes adds the SMTP testing API behind the API auth.

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(_ *http.ServeMux, store event.Store)

RegisterRoutes keeps the store for the SMTP testing API; the routes themselves go behind the API auth in RegisterProtectedRoutes.

func (*Module) SetEventService

func (m *Module) SetEventService(es EventStorer)

func (*Module) TCPServers

func (m *Module) TCPServers() []tcp.ServerConfig

func (*Module) Type

func (m *Module) Type() string

type ParsedEmail

type ParsedEmail struct {
	ID      *string        `json:"id"`
	Subject string         `json:"subject"`
	From    []EmailAddress `json:"from"`
	To      []EmailAddress `json:"to"`
	Cc      []EmailAddress `json:"cc"`
	Bcc     []string       `json:"bcc"`
	ReplyTo []EmailAddress `json:"reply_to"`
	Text    string         `json:"text"`
	HTML    string         `json:"html"`
	Raw     string         `json:"raw"`
}

ParsedEmail is the structure stored as event payload. Field names match the original PHP Buggregator Message::jsonSerialize().

Jump to

Keyboard shortcuts

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