Variables
Context or environment variables may be used in certain settings of the configuration file that accept expressions. The available context variables for evaluation vary depending on the setting and can include:
remote_ip
: The IP address of the client for inbound sessions and the remote server's IP address for outbound sessions.remote_port
: The remote clients's port number for an inbound session.local_ip
: The local server's IP address used in an outbound connection (available only when a source IP is specified).local_port
: The local server's port number for an inbound connection.listener
: The listener ID where the connection was initiated for inbound sessions.is_tls
: A boolean value indicating whether the session is encrypted using TLS.asn
: The Autonomous System Number of the remote IP address.country
: The country code of the remote IP address.protocol
: The protocol used for the session (smtp
,imap
,http
, etc.).sender
: The return path address specified in the MAIL FROM command for inbound sessions and the sender's address for outbound sessions.sender_domain
: The return path domain name specified in the MAIL FROM command for inbound sessions and the sender's domain name for outbound sessions.rcpt
: The recipient's address.rcpt_domain
: The recipient's domain name.recipients
: An array of recipient addresses.priority
: The priority provided using the MT-PRIORITY extension.authenticated_as
: The account name used to authenticate the session for inbound sessions, or an empty value if the session is unauthenticated.
Queue Variables
The following additional variables are available for use in queue expressions:
mx
: The remote mail exchanger's hostname for outbound sessions.retry_num
: The number of times the message has been retried.notify_num
: The number of times the sender of the message has been notified.last_error
: The last error message type encountered during delivery attempts.last_status
: The last status code returned by the remote server during delivery attempts.
HTTP Variables
The following additional variables are available for use in HTTP expressions:
url
: The URL of the HTTP request.url_path
: The path component of the URL.headers
: An array of HTTP headers in the formatHeader-Name: Header-Value
.method
: The HTTP method used in the request (GET
,POST
, etc.).
Spam filter Variables
The following variables are available exclusively for use in spam filter expressions:
Global Variables
remote_ip
: The IP address of the remote clientremote_ip.ptr
: The PTR (reverse DNS) record of the remote IPehlo_domain
: The domain provided in the EHLO/HELO SMTP commandauth_as
: The authentication identifier used during SMTP authenticationasn
: The Autonomous System Number of the remote IPcountry
: The country code where the remote IP is locatedis_tls
: Whether the connection uses TLS encryptionenv_from
: The envelope sender (MAIL FROM) addressenv_from.local
: The local part of the envelope sender addressenv_from.domain
: The domain part of the envelope sender addressenv_to
: The envelope recipient (RCPT TO) addressfrom
: The From header addressfrom.name
: The display name in the From headerfrom.local
: The local part of the From header addressfrom.domain
: The domain part of the From header addressreply_to
: The Reply-To header addressreply_to.name
: The display name in the Reply-To headerreply_to.local
: The local part of the Reply-To addressreply_to.domain
: The domain part of the Reply-To addressto
: The To header addressto.name
: The display name in the To headerto.local
: The local part of the To addressto.domain
: The domain part of the To addresscc
: The CC header addresscc.name
: The display name in the CC headercc.local
: The local part of the CC addresscc.domain
: The domain part of the CC addressbcc
: The BCC header addressbcc.name
: The display name in the BCC headerbcc.local
: The local part of the BCC addressbcc.domain
: The domain part of the BCC addressbody
: The full message body text (alias for body.text)body.text
: The plain text version of the message bodybody.html
: The HTML version of the message bodybody.words
: The words extracted from the message bodybody.raw
: The raw message body before parsingsubject
: The full Subject header contentsubject.thread
: The Subject header with threading information removedsubject.words
: The words extracted from the subjectlocation
: Indicates where the evaluated element was found in the email. Possible values are:env_from
: Found in the envelope FROMenv_to
: Found in the envelope TOdkim_pass
: Found in a passing DKIM signaturereceived
: Found in a Received headerfrom
: Found in the From headerreply_to
: Found in the Reply-To headersubject
: Found in the Subject headerto
: Found in the To headercc
: Found in the CC headerbcc
: Found in the BCC headermessage_id
: Found in the Message-ID headerdnt
: Found in a Disposition-Notification-To headerehlo
: Found in the EHLO/HELO commandbody_text
: Found in the plain text bodybody_html
: Found in the HTML bodyattachment
: Found in an attachmenttcp
: Found in the TCP connection data
URL Variables
url
: The complete URLvalue
: Alias for the complete URLpath_query
: The path and query string portions of the URLpath
: The path portion of the URLquery
: The query string portion of the URLscheme
: The URL scheme (protocol)authority
: The authority portion of the URLhost
: The hostname portion of the URLsld
: The second-level domain of the URL hostport
: The port number specified in the URL
Email Address Variables
email
: The complete email addressvalue
: Alias for the complete email addressname
: The display name associated with the email addresslocal
: The local part of the email addressdomain
: The domain part of the email addresssld
: The second-level domain of the email address domain
IP Address Variables
ip
: The IP address being evaluatedvalue
: Alias for the IP addressinput
: Alias for the IP addressreverse_ip
: The reverse DNS lookup result for the IPip_reverse
: Alias for reverse DNS lookup resultoctets
: The octets of the IP addressis_v4
: Whether the IP is version 4is_v6
: Whether the IP is version 6
Header Variables
name
: The name of the headername_lower
: The lowercase version of the header namevalue
: The value of the headervalue_lower
: The lowercase version of the header valueemail
: The email address found in the header valueemail_lower
: The lowercase version of the email addressattributes
: Additional header properties/attributesraw
: The raw header content before parsingraw_lower
: The lowercase version of the raw header content