pub struct SmtpServerConfig {
pub host: String,
pub port: u16,
pub tls_port: Option<u16>,
pub max_message_size: String,
pub require_auth: bool,
pub enable_starttls: bool,
pub rate_limit: Option<RateLimitConfig>,
pub outbound: SmtpOutboundConfig,
}Expand description
SMTP server listener configuration.
Fields§
§host: StringRequired. IP address or hostname on which the SMTP listener binds
(e.g. "0.0.0.0" for all interfaces).
port: u16Required. SMTP port number (typically 25 for server-to-server or
587 for mail submission). Must be in the range 1–65535.
tls_port: Option<u16>Default: None. SMTPS (implicit TLS) port number, typically 465.
Requires a [tls] section to be configured.
max_message_size: StringRequired. Maximum accepted message size, expressed as a human-readable
string (e.g. "50MB", "1GB"). Parsed by SmtpServerConfig::max_message_size_bytes.
require_auth: boolDefault: false. When true, the server requires SMTP AUTH before
accepting mail for delivery. Recommended for submission ports.
enable_starttls: boolDefault: false. When true, advertises the STARTTLS extension and
upgrades connections on demand. Requires a [tls] section.
rate_limit: Option<RateLimitConfig>Default: None. Per-IP and per-hour rate limiting for SMTP connections.
When absent no rate limiting is applied.
outbound: SmtpOutboundConfigDefault: SmtpOutboundConfig::default(). Outbound connection pool
parameters. Omitting the [smtp.outbound] subsection uses built-in
defaults (30 s idle, 8 per-remote, 256 global cap).
Implementations§
Source§impl SmtpServerConfig
impl SmtpServerConfig
Sourcepub fn max_message_size_bytes(&self) -> Result<usize>
pub fn max_message_size_bytes(&self) -> Result<usize>
Parse max message size to bytes.
Trait Implementations§
Source§impl Clone for SmtpServerConfig
impl Clone for SmtpServerConfig
Source§fn clone(&self) -> SmtpServerConfig
fn clone(&self) -> SmtpServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more