Properties
Connection Information
Unique session identifier (32-character random string)
Client IP address (IPv4 or IPv6, without
::ffff: prefix)Client port number
Server IP address
Server port number
Client hostname from reverse DNS lookup or
[IP] if unavailableHostname provided by client in HELO/EHLO command
The opening command used:
'HELO', 'EHLO', or 'LHLO'Security
Whether connection is using TLS
TLS cipher information (if connection is secure)
SNI (Server Name Indication) hostname requested by client
Authentication
User data set by successful authentication in
onAuth handler. Can be username, user ID, or any object.Transaction
Transaction counter for this connection (incremented after each DATA command)
Connection type identifier
SMTP- Basic SMTP (HELO)ESMTP- Extended SMTP (EHLO)LMTP- Local Mail Transfer Protocol (LHLO)ESMTPS- ESMTP over TLSESMTPSA- ESMTP over TLS with authentication
Envelope
Current mail transaction envelope
Proxy Information
Data from XCLIENT command (if
useXClient is enabled)Data from XFORWARD command (if
useXForward is enabled)Error Information
Last error message sent to client (if any)
Usage Examples
Accessing Session in Handlers
Storing Custom Data
You can add custom properties to the session object:Checking Connection Security
Working with Envelope Data
Session Lifecycle
- Connection: Session is created with connection info (
id,remoteAddress, etc.) - Greeting:
clientHostnameis resolved - TLS (optional):
secure,tlsOptions,servernameare set - HELO/EHLO:
openingCommand,hostNameAppearsAsare set - AUTH (optional):
useris set on successful authentication - MAIL FROM:
envelope.mailFromis set - RCPT TO: Recipients are added to
envelope.rcptTo - DATA: Message is processed
- RSET/QUIT: Envelope is reset (RSET) or connection closes (QUIT)
See Also
- Handler Methods - Methods that receive the session object
- Configuration Options - Options affecting session behavior
- Events - Events that include session data