Template Variables

Certain predefined policy variables are available for use in banners and headers. Others can be used only with certain types of rules. In addition, there are variables that are designed specifically for use in the SPX Template wizard.

Global Policy Variables

The following variables can be used in banners and headers associated with any policy rule. To add banner or header text, use the Additional Message Actions dialog box, which is opened from the Additional Actions page of the wizard.

  • %%ESA_VERSION%%: The version of the Sophos Email Appliance.
  • %%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.
  • %%QUEUE_ID%%: The mail transfer agent’s queue ID.
  • %%SENDER_IP%%: The IP of the connecting MTA.
  • %%DATETIME_GMT%%: A string containing the GMT date and time (for example, Sat Apr 24 12:49:28 2010).
  • %%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.
  • %%HOSTNAME%%: The system’s hostname as returned by the system hostname command. Useful in multi-system deployments for identifying which appliance processed a given message.

Other Policy Variables

The following variables can only be used after a spam probability test has been performed:

  • %%HITS%%: A listing of all the rules that were found by the spam engine.
  • %%SPAM_REPORT%%: A verbose listing of the antispam rules triggered by the message.
Note If there are multiple matches in multiple files, only the last text match and the last scanned file that matched will be stored in these variables.

The following variables are available in keyword list rules and offensive language rules:

  • %%MATCHED_TEXT%%: Provides the text that triggered the rule.
  • %%MATCHED_FILE%%: Provides the file that triggered the rule.

The following variable is available after a message has been tested for a virus.

  • %%VIRUS_IDS%%: IDs of viruses detected in the message (for example, 'W32/Klez.h@MM').

The following variable provides a comma-and-space delimited list of all attachments:

  • %%ATTACHMENT_NAMES%%: Is available in the following rules that test for attachments:
    • "Message contains a virus" rule in Config > Policy > Anti-Virus.
    • "Encrypted attachment" rules in Config > Policy > Anti-Virus.
    • "Suspect attachment" rules in Config > Policy > Anti-Virus.
    • "Attachment name list" in Config > Policy > Content.
    • Any rule that specifies a message attribute for attachment size.

The following variable provides a list of all matches that caused a Content Control Rule (CCL) to trigger:

  • %%CCL_MATCHES%%: Is available in data control rules that use CCLs. These can be configured in Config > Policy > Data Control.

Secure PDF Exchange (SPX) Variables

These variables are available for use on specific pages of the SPX Template wizard. As described the below, the available variables differ, depending on which text you are editing. The %%CHANGE_PASSWORD_URL%% and %%FORGOTTEN_PASSWORD_URL%% are automatically inserted in the instructional text if the associated end user password options are selecting when creating a new template.

SPX Instructional Text

Use any of the following variables on the Recipient Instructions page of the SPX Template wizard. The %%CHANGE_PASSWORD_URL%% and %%FORGOTTEN_PASSWORD_URL%% are automatically inserted in the instructional text, if the associated end user password options are selected when creating a new template.

  • %%SUBJECT%%: The subject of the message. If there are multiple Subject headers, only the last occurrence is used.
  • %%DATETIME_GMT%%: A string containing the GMT date and time (for example, Sat Apr 24 12:49:28 2010).
  • %%ENVELOPE_TO%%: A comma-separated list of the envelope recipients.
  • %%ENVELOPE_FROM%%: The envelope sender.
  • %%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_FROM%%: The From field of the message header.
  • %%HEADER_FROM_SANITIZED%%: The From field of the message header, in a readable format similar to User Name <name@example.com>
  • %%ORGANIZATION_NAME%%: The name of your company or institution as specifed in the Organization name text box on the Template Name page of the SPX Template wizard.
  • %%ATTACHMENT_COUNT%%: The number of attachments included with the message.
  • %%ATTACHMENT_NAMES%%: A comma-and-space delimited list of all attachments.
  • %%CHANGE_PASSWORD_URL%%: The URL to the web portal where an SPX recipient can change their password.
  • %%FORGOTTEN_PASSWORD_URL%%: The URL to the web portal where an SPX recipient can recover their forgotten password.

SPX Registration Message

Use any of the following variables on the Password Settings page of the SPX Template wizard if you have opted to let recipients choose their own passwords. When you select this password method, the wizard inserts the %%REGISTRATION_URL%%, %%ORGANIZATION_NAME%%, and %%HEADER_FROM_SANITIZED%% variables in the registration message text.

  • %%DATETIME_GMT%%: A string containing the GMT date and time (for example, Sat Apr 24 12:49:28 2010).
  • %%ENVELOPE_TO%%: A comma-separated list of the envelope recipients.
  • %%ENVELOPE_FROM%%: The envelope sender.
  • %%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_FROM%%: The From field of the message header.
  • %%HEADER_FROM_SANITIZED%%: The From field of the message header, in a readable format similar to User Name <name@example.com>.
  • %%ORGANIZATION_NAME%%: The name of your company or institution as specifed in the Organization name text box on the Template Name page of the SPX Template wizard.
  • %%REGISTRATION_URL%%: The URL to the web portal where an SPX recipient can choose a password.

SPX Generated Password Message

Use any of the following variables on the SPX password email dialog if you have opted to generate passwords or use sender-specified passwords, and to have the sender communicate passwords to recipients. When you select this password method, the wizard inserts the %%GENERATED_PASSWORD%% variable for generated passwords, or the %%SPECIFIED_PASSWORD%% variable for sender-specified passwords in the instructional text. The %%ENVELOPE_TO%% variable will also be inserted in the instructional text.

  • %%SUBJECT%%: The subject of the message. If there are multiple Subject headers, only the last occurrence is used.
  • %%DATETIME_GMT%%: A string containing the GMT date and time (for example, Sat Apr 24 12:49:28 2010).
  • %%GENERATED_PASSWORD%%: [Only when using generated passwords] The automatically generated password that must be securely communicated to the message recipient.
  • %%SPECIFIED_PASSWORD%%: [Only when using sender-specified passwords] The sender-specified password that must be securely communicated to the message recipient.
  • %%ENVELOPE_TO%%: A comma-separated list of the envelope recipients.
  • %%ENVELOPE_FROM%%: The envelope sender.
  • %%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_FROM%%: The From field of the message header.
  • %%HEADER_FROM_SANITIZED%%: The From field of the message header, in a readable format similar to User Name <name@example.com>.
  • %%ORGANIZATION_NAME%%: The name of your company or institution as specifed in the Organization name text box on the Template Name page of the SPX Template wizard.
  • %%ATTACHMENT_COUNT%%: The number of attachments included with the message.
  • %%ATTACHMENT_NAMES%%: A comma-and-space delimited list of all attachments.