Template Variables
Certain predefined variables are available for use in banners and headers. You can choose from the predefined variables listed below, or create variables using the Set a template variable action.
The following variables can be used at any time:
- %%PMX_VERSION%%: The version of PureMessage.
- %%SUBJECT%%: The subject of the message. If there are multiple Subject headers, only the last occurrence is used.
- %%MESSAGE_SIZE%%: The size of the message, in bytes.
- %%HEADER_SIZE%%: The size of the message header, in bytes.
- %%BODY_SIZE%%: The body size in bytes.
- %%QUEUE_ID%%: The mail transfer agent's queue ID.
- %%SENDER_IP%%: The sender's IP address.
- %%DATETIME%%: A string containing the local date and time (for example, Thu Apr 24 12:49:28 2003).
- %%DATETIME_GMT%%: A string containing the GMT date and time (for example, Thu Apr 24 12:49:28 2003).
- %%ENVELOPE_TO%%: A comma-separated list of the envelope recipients.
- %%ENVELOPE_FROM%%: The envelope sender.
- %%HEADER_FROM%%: The From field of the message header.
- %%HEADER_TO%%: The To field of the message header. All occurrences of the To field are returned in a comma-separated list.
- %%HEADER_CC%%: The Cc field of the message header. All occurrences of the Cc field are returned in a comma-separated list.
- %%HEADER_DATE%%: The Date field of the message header.
The following variables can only be used after a spam probability test has been performed. The GAUGE variables use non-numeric characters for spam probability percentages. This is because many client mail programs cannot perform numeric comparisons.
- %%GAUGE%%: Subject-style gauge. At least one '#' is always appended,
indicating that the message contains 0-50% spam. An extra '#' is added for every
10% above the argument that is given to
pmx_spam_prob
. - %%XGAUGE%%: Absolute gauge, one 'X' character for every 10% probability.
- %%SGAUGE%%: Absolute gauge, one '*' character for every 10% probability.
- %%IGAUGE%%: Absolute gauge, one 'I' character for every 1% after the XGAUGE level.
- %%PROB%%: Spam probability (NN%).
- %%HITS%%: A listing of all the rules that were found by the spam engine.
Custom rules names are appended with a plus symbol; modified default rule names
are appended with an exclamation mark. For example:
MY_CUSTOM_RULE+ 4, OVERRIDDEN_RULE! 2, DEFAULT_RULE 1.1
- %%SPAM_REPORT%%: A verbose listing of the rule names, rule descriptions
and rule scores for each rule triggered by the message. Custom rules names are
appended with a plus symbol; modified default rule names are appended with an
exclamation mark. For example:
MY_CUSTOM_RULE+ 4.000 Site rule OVERRIDDEN_RULE! 2.000 Default rule description DEFAULT_RULE 1.100 Default rule description
The following variables are available after either the Message is from blocked IP or Message contains a virus test has run.
- %%BLOCKLIST_REASON%%: The reason, specified in the SophosLabs blocklist data, for blocking a message based on IP. It is the same as the "reply" string seen in the SMTP session. Available after the Message is from blocked IP test has been run on a message.
- %%VIRUS_IDS%%: IDs of viruses detected in the message (for example, 'W32/Klez.h@MM'). Available after the Message contains a virus test has been run on a message.
The following variables are available inside rules containing specific tests or actions:
- %%ATTACHMENT_NAME%%: The name of the attachment. Available inside rules using the Rename attachment and Replace body actions.
- %%ATTACHMENT_NAMES%%: A list of all attachments. Available inside rules using the Attachment name, Attachment size or Attachment type tests or the Rename attachment action.
- %%ATTACHMENT_SIZE%%: The size of the attachment. Expanded by the Replace message part action.
- %%ATTACHMENT_TYPE%%The content-type of the attachment (as given by the Content-Type header). Expanded by the Replace message part action.