Documentation
¶
Index ¶
- type AuthenticationChecker
- type InboundEnqueuer
- type Server
- func (s *Server) Close() error
- func (s *Server) ListenAndServe() error
- func (srv *Server) ProcessIntake(ctx context.Context, it *identity.InboundIntake) error
- func (s *Server) SetAuthenticationChecker(check AuthenticationChecker)
- func (s *Server) SetEnforcer(e limits.Enforcer)
- func (s *Server) SetInboundEnqueuer(e InboundEnqueuer)
- func (s *Server) SetOutbox(o webhookpub.Outbox)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationChecker ¶
type AuthenticationChecker func(context.Context, net.IP, string, string, []byte, emailauth.AuthorIdentity) *emailauth.Authentication
AuthenticationChecker evaluates the connection and message identities used by the inbound trust gate. It is injectable so end-to-end tests can exercise deterministic DMARC-pass paths without depending on public DNS.
type InboundEnqueuer ¶
type InboundEnqueuer interface {
EnqueueInboundProcessTx(ctx context.Context, tx pgx.Tx, intakeID string) (int64, error)
}
InboundEnqueuer inserts the inbound_process job in the SMTP accept-tx (the same transaction as the inbound_intake insert). *inboundprocess.Jobs satisfies it. Injected via SetInboundEnqueuer; nil keeps inbound on the synchronous path.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
func (*Server) ProcessIntake ¶
ProcessIntake runs the full inbound chain for an accepted inbound_intake row — the async River worker's entry point (internal/inboundprocess.Processor). It rebuilds the connection context from the persisted row (the worker has no live session) and calls the shared processInbound with a hook that flips the intake to 'processed' ATOMICALLY with the messages insert + event publish — the worker's idempotency gate. The stored remote_ip text is parsed back to net.IP for SPF; an unparseable value yields nil, which the authentication evaluator treats as unavailable (fail-safe, not a crash).
func (*Server) SetAuthenticationChecker ¶
func (s *Server) SetAuthenticationChecker(check AuthenticationChecker)
SetAuthenticationChecker replaces the default DNS-backed evaluator. This is intended for deterministic tests; production leaves the default in place.
func (*Server) SetEnforcer ¶
SetEnforcer wires in the resource-limits enforcer used to reject inbound recipients whose owner has hit the message-flow or storage cap. When nil (the default) every RCPT TO is accepted as far as the limits subsystem is concerned — handy for tests and for self-host operators who run without limits enabled. The cmd/e2a runtime always sets it.
func (*Server) SetInboundEnqueuer ¶
func (s *Server) SetInboundEnqueuer(e InboundEnqueuer)
SetInboundEnqueuer wires the shared River client's inbound enqueuer, enabling the queue-first accept path when E2A_INBOUND_MODE=async.
func (*Server) SetOutbox ¶
func (s *Server) SetOutbox(o webhookpub.Outbox)
SetOutbox wires the transactional outbox. The inbound trigger commits the messages row and the webhook_events outbox row in a single transaction (per design §4.2); the drain fans out and enqueues River delivery jobs.