Documentation
¶
Overview ¶
Package config loads and validates the perch configuration file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ACMEConfig ¶
type ACMEConfig struct {
Enabled bool `yaml:"enabled"`
Email string `yaml:"email"`
Domains []string `yaml:"domains"`
CacheDir string `yaml:"cache_dir"`
HTTPAddr string `yaml:"http_addr"`
}
ACMEConfig configures built-in Let's Encrypt issuance.
type Config ¶
type Config struct {
DataDir string `yaml:"data_dir"`
Hostname string `yaml:"hostname"`
Log LogConfig `yaml:"log"`
IMAP IMAPConfig `yaml:"imap"`
SMTP SMTPConfig `yaml:"submission"`
TLS TLSConfig `yaml:"tls"`
Storage StorageConfig `yaml:"storage"`
MXRaVen MXRaVenConfig `yaml:"mxraven"`
Limits LimitsConfig `yaml:"limits"`
Setup SetupConfig `yaml:"setup"`
}
Config is the top-level perch configuration.
func Default ¶
func Default() Config
Default returns the configuration used by a fresh local installation.
func Load ¶
Load reads path into a Config, applies environment overrides, and validates it. A missing file is an error: perch never starts with an implicit config.
func (Config) EnsureDataDir ¶
EnsureDataDir creates the private data directory.
type IMAPConfig ¶
type IMAPConfig struct {
Addr string `yaml:"addr"`
IMAPSAddr string `yaml:"imaps_addr"`
AllowPlaintextLoopback bool `yaml:"allow_plaintext_loopback"`
}
IMAPConfig configures the IMAP listeners.
type LimitsConfig ¶
type LimitsConfig struct {
MaxMessageBytes int64 `yaml:"max_message_bytes"`
MaxRecipients int `yaml:"max_recipients"`
MaxConnections int `yaml:"max_connections"`
IngestConcurrency int `yaml:"ingest_concurrency"`
SearchMaxMessages int `yaml:"search_max_messages"`
BlobCacheBytes int64 `yaml:"blob_cache_bytes"`
}
LimitsConfig bounds resource use.
type ListenerConfig ¶
type ListenerConfig struct {
ID string `yaml:"id"`
Kind string `yaml:"kind"` // mta or submission
KeyPrefix string `yaml:"key_prefix"`
KeySecret string `yaml:"key_secret"`
KeySecretEnv string `yaml:"key_secret_env"`
Consumer string `yaml:"consumer"`
}
ListenerConfig identifies one mxRaven listener and its API key.
func (ListenerConfig) Secret ¶
func (l ListenerConfig) Secret() string
Secret returns the listener secret from the environment when configured.
type LogConfig ¶
type LogConfig struct {
Level string `yaml:"level"` // debug, info, warn, error
Format string `yaml:"format"` // json or text
}
LogConfig controls structured logging.
type MXRaVenConfig ¶
type MXRaVenConfig struct {
SubmissionHost string `yaml:"submission_host"`
SubmissionPort int `yaml:"submission_port"`
NotificationURL string `yaml:"notification_url"`
FeedbackURL string `yaml:"feedback_url"`
Listeners []ListenerConfig `yaml:"listeners"`
}
MXRaVenConfig configures the upstream mail transport.
type S3Config ¶
type S3Config struct {
Endpoint string `yaml:"endpoint"`
Region string `yaml:"region"`
Bucket string `yaml:"bucket"`
Prefix string `yaml:"prefix"`
AccessKey string `yaml:"access_key"`
SecretKey string `yaml:"secret_key"`
SecretKeyEnv string `yaml:"secret_key_env"`
ForcePathStyle bool `yaml:"force_path_style"`
KeyTemplate string `yaml:"key_template"`
ReconcileEvery time.Duration `yaml:"reconcile_every"`
Spool bool `yaml:"spool"`
SpoolMaxBytes int64 `yaml:"spool_max_bytes"`
}
S3Config describes the bucket mxRaven writes to and perch reads from.
type SMTPConfig ¶
SMTPConfig configures the submission listeners.
type SetupConfig ¶
type SetupConfig struct {
Domain string `yaml:"domain"`
InboundDomain string `yaml:"inbound_domain"`
SendingDomain string `yaml:"sending_domain"`
MTAListenerID string `yaml:"mta_listener_id"`
SubListenerID string `yaml:"submission_listener_id"`
StorageRef string `yaml:"storage_ref"`
}
SetupConfig records values written by the setup wizard for diagnostics.
type StorageConfig ¶
type StorageConfig struct {
Mode StorageMode `yaml:"mode"`
S3 S3Config `yaml:"s3"`
}
StorageConfig selects the raw-message store.
type StorageMode ¶
type StorageMode string
StorageMode selects where raw messages are kept.
const ( // StorageSQLite keeps compressed raw messages inside the SQLite database. StorageSQLite StorageMode = "sqlite" // StorageS3 keeps raw messages in an S3 bucket populated by mxRaven's // S3_STORE action while metadata and search indexes stay in SQLite. StorageS3 StorageMode = "s3" )
type TLSConfig ¶
type TLSConfig struct {
CertFile string `yaml:"cert_file"`
KeyFile string `yaml:"key_file"`
ACME ACMEConfig `yaml:"acme"`
}
TLSConfig enables TLS for IMAP and submission.