relay

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationChecker

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 NewServer

func NewServer(cfg *config.Config, store *identity.Store, usage usage.UsageTracker, hub *ws.Hub) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) ProcessIntake

func (srv *Server) ProcessIntake(ctx context.Context, it *identity.InboundIntake) error

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

func (s *Server) SetEnforcer(e limits.Enforcer)

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.

Jump to

Keyboard shortcuts

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