Server Behavior
Server hostname used in the greeting banner. Defaults to
os.hostname().Additional text to display in the server greeting.
Custom HELO/EHLO response format. Use
%s for placeholders (server name, client hostname).
Defaults to "%s Nice to meet you, %s".Maximum message size in bytes. If set, the SIZE extension is advertised.
If
true, advertises SIZE without the maximum size value.If
true, operates as an LMTP server instead of SMTP.Enable logging. Set to
true for console logging or provide a custom logger object.Component identifier used in logs.
TLS/Security
If
true, server accepts connections on TLS (SMTPS). Use with key and cert.Used internally for delayed TLS upgrade. Set to
true with secure: true to start TLS after connection.Internal flag indicating TLS is already established on the socket.
Private key for TLS (PEM format).
Certificate for TLS (PEM format).
Certificate authority certificates for TLS.
Cipher suite specification for TLS.
Request client certificate during TLS handshake.
Reject connections with invalid client certificates.
SNI (Server Name Indication) options for multiple certificates. Map domain names to TLS options.
Custom SNI callback function
(servername, cb) => { cb(null, secureContext) }.If
true, does not advertise STARTTLS capability.If
true, allows authentication over non-TLS connections.Authentication
Allowed authentication methods. Available:
'PLAIN', 'LOGIN', 'CRAM-MD5', 'XOAUTH2'.If
true, authentication is optional (allows unauthenticated mail).Custom error message when authentication is required.
Maximum number of commands allowed before authentication. Set to
false to disable limit.SMTP Extensions
List of SMTP commands to disable. Example:
['AUTH', 'STARTTLS'].If
true, does not advertise PIPELINING extension.If
true, does not advertise 8BITMIME extension.If
true, does not advertise SMTPUTF8 extension.If
true, does not include enhanced status codes in responses.If
true, does not advertise DSN (Delivery Status Notification) extension.If
true, does not advertise REQUIRETLS extension (RFC 8689).Connection Management
Socket inactivity timeout in milliseconds.
Time to wait for pending connections to close before forcing shutdown (milliseconds).
Maximum number of concurrent connections. New connections are rejected with 421 if exceeded.
If
true, skips DNS reverse lookup for client IP addresses.Custom DNS resolver with a
reverse(ip, callback) method.Proxy Support
Enable PROXY protocol support. Set to
true for all connections or provide array of allowed IP addresses.IP addresses to silently ignore (no logging or connection events).
Enable XCLIENT extension for trusted clients to override connection properties.
Enable XFORWARD extension for forwarding connection metadata.
Handler Methods
These can be set as options or defined as methods on the server instance. See Handler Methods for details.Called when a client connects. Signature:
(session, callback)Called after TLS is established. Signature:
(socket, session, callback)Called for authentication. Signature:
(auth, session, callback)Called for MAIL FROM command. Signature:
(address, session, callback)Called for RCPT TO command. Signature:
(address, session, callback)Called for DATA command. Signature:
(stream, session, callback)Called when connection closes. Signature:
(session)