Overview
The SMTP Server library provides extensive configuration options to customize server behavior, security settings, protocol features, and message handling. All options are passed to theSMTPServer constructor.
Basic Configuration
Core Server Options
Server hostname used in greeting messages and SMTP responses.
Custom banner text displayed in the initial greeting after hostname.
Maximum message size in bytes. Server advertises this via SIZE extension.
If true, advertises SIZE extension without specifying the limit.
Enable logging. Set to
true for console logging or provide a custom logger object.Component name for log messages.
TLS/Security Options
If true, server requires TLS from the start (implicit TLS on port 465).
Used with
secure: true to require immediate TLS upgrade after connection.Private key for TLS. Required for secure connections.
Server certificate for TLS. Required for secure connections.
Certificate authority certificates.
SNI (Server Name Indication) options for serving different certificates per domain.
Custom SNI handler function. Default implementation uses
sniOptions.Protocol Features
Enable LMTP (Local Mail Transfer Protocol) instead of SMTP.
LMTP mode changes protocol behavior and disables HELO/EHLO in favor of LHLO.
If true, does not advertise STARTTLS extension (disables opportunistic TLS).
If true, does not advertise PIPELINING extension.
If true, does not advertise 8BITMIME extension.
If true, does not advertise SMTPUTF8 extension (UTF-8 email addresses).
If true, does not advertise or include enhanced status codes (RFC 3463).
Enhanced status codes are disabled by default. Set to
false to enable them.If true, does not advertise DSN (Delivery Status Notification) extension.
If true, does not advertise REQUIRETLS extension (RFC 8689).
Array of SMTP commands to disable.
Connection Limits
Maximum number of concurrent connections. Server returns 421 when limit exceeded.
Socket timeout in milliseconds (default: 60 seconds).
Time to wait for pending connections to close when server.close() is called.
Security Options
If false, requires TLS before allowing authentication.
If true, allows mail transactions without authentication.
Custom error message when authentication is required.
Maximum commands allowed before authentication. Connection closed when exceeded.
Set to
false to disable this limit.Proxy Support
Enable PROXY protocol support. Can be
true, false, or array of allowed IP addresses.Enable XCLIENT extension for connection property override (Postfix).
Useful when running behind a proxy to preserve original client information.
Enable XFORWARD extension for forwarding client data (Postfix).
Array of IP addresses for connections to ignore/skip logging.
DNS Configuration
If true, skips reverse DNS lookup for client IP addresses.
Custom DNS resolver object with a
reverse method.Greeting Customization
Custom HELO/EHLO response format. Use
%s placeholders for server name and client hostname.