Expand description
§rusmes-config
Configuration management for the RusMES mail server.
§Overview
rusmes-config provides the ServerConfig struct and supporting types that model
the complete runtime configuration of a RusMES installation. Configuration is
normally loaded from a TOML or YAML file on disk, with optional overrides from
environment variables (prefix RUSMES_).
§File format auto-detection
ServerConfig::from_file inspects the file extension:
| Extension | Format |
|---|---|
.toml | TOML |
.yaml / .yml | YAML |
Both formats expose identical semantics; see the crate tests for concrete examples.
§Environment variable overrides
Every significant configuration key has a corresponding RUSMES_* environment
variable that takes precedence over the file value. A full list is documented on
ServerConfig::apply_env_overrides. This enables twelve-factor-style deployments
where the base config is baked into a container image and secrets are injected at
runtime.
§Sections
| Struct | Field | Description |
|---|---|---|
SmtpServerConfig | smtp | Listening addresses, TLS ports, rate limits |
ImapServerConfig | imap | IMAP4rev1 listener |
JmapServerConfig | jmap | JMAP HTTP listener |
Pop3ServerConfig | pop3 | POP3 listener |
StorageConfig | storage | Filesystem, Postgres, or AmateRS backend |
AuthConfig | auth | File, LDAP, SQL, or OAuth2 auth backend config |
QueueConfig | queue | Retry queue with exponential back-off |
SecurityConfig | security | Relay networks, blocked IPs |
DomainsConfig | domains | Local domains and address aliases |
MetricsConfig | metrics | Prometheus scrape endpoint |
TracingConfig | tracing | OpenTelemetry OTLP exporter |
ConnectionLimitsConfig | connection_limits | Per-IP and global connection caps |
LoggingConfig | logging | Log level / format / output routing |
The logging module provides logging::init_logging for initialising the global
tracing subscriber from a logging::LogConfig, including file rotation and optional
gzip compression of rotated files.
§Validation
ServerConfig::validate is called automatically during ServerConfig::from_file.
It checks domain syntax, email addresses, port numbers, storage path accessibility,
and processor uniqueness.
§Example
use rusmes_config::ServerConfig;
let cfg = ServerConfig::from_file("/etc/rusmes/rusmes.toml")?;
println!("Serving domain {}", cfg.domain);Re-exports§
pub use performance::PerformanceConfig;pub use tls::ClientAuthMode;pub use tls::ProtocolKind;pub use tls::TlsConfig;pub use tls::TlsEndpointConfig;
Modules§
- logging
- Structured logging with file rotation for RusMES
- performance
- Performance tuning configuration for RusMES.
- tls
- Per-protocol TLS certificate configuration for RusMES.
Structs§
- Connection
Limits Config - Connection limits configuration.
- Domains
Config - Local domain and address alias configuration.
- File
Auth Config - File-based authentication configuration.
- Imap
Server Config - IMAP4rev1 server listener configuration.
- Jmap
Push Config - JMAP WebPush delivery configuration (RFC 8030 + RFC 8444 VAPID).
- Jmap
Server Config - JMAP over HTTP server listener configuration.
- Ldap
Auth Config - LDAP authentication configuration.
- LogFile
Config - Log file rotation configuration.
- Logging
Config - Structured logging configuration.
- Mailet
Config - A single matcher + mailet rule within a processor chain.
- Metrics
Basic Auth Config - Optional HTTP Basic authentication for the metrics scrape endpoint.
- Metrics
Config - Prometheus metrics scrape endpoint configuration.
- OAuth2
Auth Config - OAuth2 authentication configuration.
- Pop3
Server Config - POP3 server listener configuration.
- Processor
Config - A named processor chain containing an ordered list of mailets.
- Queue
Config - Outbound mail queue and retry configuration.
- Rate
Limit Config - Per-IP SMTP rate limiting parameters.
- Relay
Config - Outbound SMTP relay (“smart-host”) configuration.
- Security
Config - Inbound relay and IP-filtering security configuration.
- Server
Config - Main server configuration.
- Smtp
Outbound Config - Configuration for outbound SMTP connection pooling.
- Smtp
Server Config - SMTP server listener configuration.
- SqlAuth
Config - SQL authentication configuration.
- Tracing
Config - OpenTelemetry OTLP distributed tracing configuration.
Enums§
- Auth
Config - Authentication backend configuration.
- Otlp
Protocol - OTLP protocol type.
- Storage
Config - Storage backend configuration.