chatmail

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: GPL-3.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

View Source
const AdminTokenFileName = "admin_token"

AdminTokenFileName is the filename in state_dir where the auto-generated admin token is stored.

Variables

View Source
var ErrTokenExhausted = errors.New("registration token has been fully used")

ErrTokenExhausted means the token has reached its max_uses (including pending reservations).

View Source
var ErrTokenExpired = errors.New("registration token has expired")

ErrTokenExpired means the token has passed its expiration date.

View Source
var ErrTokenNotFound = errors.New("registration token not found")

ErrTokenNotFound means the token does not exist.

View Source
var WWWFiles embed.FS

Functions

func New

func New(_ string, args []string) (module.Module, error)

func NormalizeMailDomain added in v0.34.0

func NormalizeMailDomain(mailDomain string) []string

NormalizeMailDomain returns the canonical forms of the server's mail domain. For IP-based domains like "[1.1.1.1]", it returns both "[1.1.1.1]" and "1.1.1.1". For hostname domains like "example.com", it returns just ["example.com"].

func ValidateAllRecipients added in v0.34.0

func ValidateAllRecipients(mailTo []string, validDomains []string) (accepted []string, rejected map[string]error)

ValidateAllRecipients runs domain and admin-block checks on all recipients. Returns two slices: accepted recipients and rejected recipients with their errors.

func ValidateMxDelivTLS added in v0.34.0

func ValidateMxDelivTLS(isTLS bool) error

ValidateMxDelivTLS checks that the /mxdeliv request arrived over TLS. Unencrypted HTTP delivery between servers must be rejected.

func ValidateRecipientDomain added in v0.34.0

func ValidateRecipientDomain(rcptTo string, validDomains []string) error

ValidateRecipientDomain checks that a recipient address belongs to this server. It extracts the domain part from the email address and compares it against all valid domain forms for this server.

Valid forms for server with mailDomain "[1.1.1.1]":

  • user@[1.1.1.1] ← bracket-wrapped IP
  • user@1.1.1.1 ← bare IP

Valid forms for server with mailDomain "example.com":

  • user@example.com

Rejected:

  • user@2.2.2.2 ← different server
  • user@other.com ← different domain
  • admin@[1.1.1.1] ← handled by ValidateRecipientNotAdmin

func ValidateRecipientNotAdmin added in v0.34.0

func ValidateRecipientNotAdmin(rcptTo string) error

Types

type AccountResponse

type AccountResponse struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

func (*Endpoint) Close

func (e *Endpoint) Close() error

func (*Endpoint) Init

func (e *Endpoint) Init(cfg *config.Map) error

func (*Endpoint) InstanceName

func (e *Endpoint) InstanceName() string

func (*Endpoint) Name

func (e *Endpoint) Name() string

type MxDelivSecurityError added in v0.34.0

type MxDelivSecurityError struct {
	Code    int
	Message string
}

MxDelivSecurityError represents a security validation failure on the /mxdeliv endpoint.

func (*MxDelivSecurityError) Error added in v0.34.0

func (e *MxDelivSecurityError) Error() string

Jump to

Keyboard shortcuts

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