Documentation
¶
Index ¶
- type EmailAddress
- type EventStorer
- type Link
- type MessageFilter
- type Module
- func (m *Module) Name() string
- func (m *Module) OnEventStored(ev event.Event)
- func (m *Module) OnEventsDeleted(uuids []string)
- func (m *Module) PreviewMapper() event.PreviewMapper
- func (m *Module) RegisterProtectedRoutes(mux *http.ServeMux, protect func(http.Handler) http.Handler)
- func (m *Module) RegisterRoutes(_ *http.ServeMux, store event.Store)
- func (m *Module) SetEventService(es EventStorer)
- func (m *Module) SetRelay(cfg RelayConfig)
- func (m *Module) TCPServers() []tcp.ServerConfig
- func (m *Module) Type() string
- type ParsedEmail
- type RelayConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailAddress ¶
EmailAddress represents an email address.
type EventStorer ¶
type Link ¶
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 (*Module) OnEventStored ¶
OnEventStored notifies any long-poll waiters when a new SMTP event arrives.
func (*Module) OnEventsDeleted ¶
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 ¶
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) SetRelay ¶ added in v2.13.0
func (m *Module) SetRelay(cfg RelayConfig)
SetRelay sets the outgoing SMTP server caught messages can be released to. Without it release is off.
func (*Module) TCPServers ¶
func (m *Module) TCPServers() []tcp.ServerConfig
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().
type RelayConfig ¶ added in v2.13.0
type RelayConfig struct {
Host string
Port int // default: 587 for starttls, 465 for tls, 25 for none
TLS string // "starttls" (default), "tls" (implicit, port 465) or "none"
Username string // empty: no AUTH
Password string
From string // MAIL FROM; empty: Username when it is an address, else the message's From
AllowedRecipients []string // address patterns like "*@example.com"; empty: any
InsecureSkipVerify bool // accept any TLS certificate (a local test relay)
// AuthOn is the server's API auth, not a relay setting: without it a
// release is taken only from this machine.
AuthOn bool
}
RelayConfig is the outgoing SMTP server a caught message can be released to. Off while Host is empty. Password never leaves the server.
func (RelayConfig) Enabled ¶ added in v2.13.0
func (c RelayConfig) Enabled() bool
Enabled reports whether a relay is configured.