Connection Context Variables
Connection context variables are set upon the creation of a successful connection and contain information regarding the remote client. Connection context variables are predefined, either in a global context or within a module. The global variables are discussed in the next section and the module-specific variables follow.
The following connection context variables are predefined globally by Momentum:
The authentication status. When an SMTP client performs an SMTP AUTH action, the auth_status context key will be set to one of "pass", "fail", or "error". For more information about authentication see “Authentication, Authorization and Accounting”.
The authenticated username. When an SMTP client performs an SMTP AUTH action, the auth_user context key will be set to the username used during authorization. For more information about authentication see “Authentication, Authorization and Accounting”.
Whether relaying is allowed. When an SMTP client is allowed to relay through Momentum because of an entry in
relay_hostsor a relaying declaration in an ESMTP_Listener IP access control list, the
can_relayconnection context variable is set to "true." See also relay_hosts and “Authentication, Authorization and Accounting”.
The number of messages on the connection.
The number of recipients on the connection. This variable counts the total number of RCPT TOs on this open connection while
message_rcpt_countcounts the number of RCPT TOs since the last MAIL FROM.
This context variable is accessible after execution of a Sieve function. If a scripting data source query cannot be completed due to an error, this variable will be set to the error message. See ds_fetch and following.
The domain from the EHLO phase.
This variable is accessible as of the EHLO phase.
The complete EHLO string.
The number of recipients for the current message. Since a given message "object" can only have one recipient, multiple recipients are a property of the current session and are tracked at the connection level not the message level. This variable counts the number of RCPT TOs since the last MAIL FROM while
connection_rcpt_countcounts the total number of RCPT TOs on this open connection.
Whether TLS is in use.
Identifies the cipher in use for a TLS enabled session
This variable is accessible from the outbound_tls_ciphers hook.
The number of bits the algorithm is based on, for example 128
The number of bits used, for example 40
Holds the subject of the peer certificate for a TLS enabled session.
The common name of the subject of the peer certificate.
Holds the issuer of the peer certificate for a TLS enabled session.
The common name of the issuer of the peer certificate.
Will be set to the string
yesif the peer certificate was verified against the configured Certificate Authorities.
The following sections show modules that support predefined module-specific connection context variables.
The variables are as follows:
conntrol_unrecognized_commands– The number of unrecognized commands.
conntrol_bad_commands– The number of valid SMTP commands with syntax errors
early_talker– Whether the peer started issuing commands before Momentum sent the initial SMTP banner.
For more information see “Conntrol Runtime Usage”
The variables are as follows:
mail_loop_header_count– The number of received headers detected.
mail_loop_ip– Set to 'match', if a self-connect was detected
For more information see “mail_loop Runtime Usage”