Common Macros
From ESM Wiki
(Difference between revisions)
Line 60: | Line 60: | ||
[[#$header_body_by_name|$header_body_by_name]]<br/> | [[#$header_body_by_name|$header_body_by_name]]<br/> | ||
[[#$headers|$headers]]<br/> | [[#$headers|$headers]]<br/> | ||
− | [[#$headers. | + | [[#$headers.address|$headers.address]]<br/> |
</td> | </td> | ||
<td valign="top" style="padding-right: 10px;"> | <td valign="top" style="padding-right: 10px;"> | ||
+ | [[#$headers.address.domain|$headers.address.domain]]<br/> | ||
+ | [[#$headers.address.domain.part|$headers.address.domain.part]]<br/> | ||
+ | [[#$headers.address.local|$headers.address.local]]<br/> | ||
+ | [[#$headers.address.name|$headers.address.name]]<br/> | ||
+ | [[#$headers.address.type|$headers.address.type]]<br/> | ||
+ | [[#$headers.date|$headers.date]]<br/> | ||
[[#$headers.date.timestamp|$headers.date.timestamp]]<br/> | [[#$headers.date.timestamp|$headers.date.timestamp]]<br/> | ||
[[#$headers.message_id|$headers.message_id]]<br/> | [[#$headers.message_id|$headers.message_id]]<br/> | ||
Line 85: | Line 91: | ||
[[#$headers.return_path.local|$headers.return_path.local]]<br/> | [[#$headers.return_path.local|$headers.return_path.local]]<br/> | ||
[[#$headers.return_path.domain|$headers.return_path.domain]]<br/> | [[#$headers.return_path.domain|$headers.return_path.domain]]<br/> | ||
+ | </td> | ||
+ | <td valign="top" style="padding-right: 10px;"> | ||
[[#$headers.return_path.name|$headers.return_path.name]]<br/> | [[#$headers.return_path.name|$headers.return_path.name]]<br/> | ||
[[#$headers.return_path.domain.part|$headers.return_path.domain.part]]<br/> | [[#$headers.return_path.domain.part|$headers.return_path.domain.part]]<br/> | ||
Line 91: | Line 99: | ||
[[#$headers.fake_sender.domain|$headers.fake_sender.domain]]<br/> | [[#$headers.fake_sender.domain|$headers.fake_sender.domain]]<br/> | ||
[[#$headers.fake_sender.name|$headers.fake_sender.name]]<br/> | [[#$headers.fake_sender.name|$headers.fake_sender.name]]<br/> | ||
− | |||
− | |||
[[#$headers.to|$headers.to]]<br/> | [[#$headers.to|$headers.to]]<br/> | ||
[[#$headers.to.local|$headers.to.local]]<br/> | [[#$headers.to.local|$headers.to.local]]<br/> | ||
Line 115: | Line 121: | ||
[[#$ip.hex|$ip.hex]]<br/> | [[#$ip.hex|$ip.hex]]<br/> | ||
[[#$if_not_empty|$if_not_empty]]<br/> | [[#$if_not_empty|$if_not_empty]]<br/> | ||
+ | </td> | ||
+ | <td valign="top" style="padding-right: 10px;"> | ||
[[#$gethostname|$gethostname]]<br/> | [[#$gethostname|$gethostname]]<br/> | ||
[[#$group|$group]]<br/> | [[#$group|$group]]<br/> | ||
Line 121: | Line 129: | ||
[[#$md5|$md5]]<br/> | [[#$md5|$md5]]<br/> | ||
[[#$not_empty|$not_empty]]<br/> | [[#$not_empty|$not_empty]]<br/> | ||
− | |||
− | |||
[[#$pid|$pid]]<br/> | [[#$pid|$pid]]<br/> | ||
[[#$recipient|$recipient]]<br/> | [[#$recipient|$recipient]]<br/> | ||
Line 144: | Line 150: | ||
[[#$text_find_replace_all|$text_find_replace_all]]<br/> | [[#$text_find_replace_all|$text_find_replace_all]]<br/> | ||
[[#$text_map|$text_map]]<br/> | [[#$text_map|$text_map]]<br/> | ||
+ | </td> | ||
+ | <td valign="top" style="padding-right: 10px;"> | ||
[[#$text_pad_left|$text_pad_left]]<br/> | [[#$text_pad_left|$text_pad_left]]<br/> | ||
[[#$text_size|$text_size]]<br/> | [[#$text_size|$text_size]]<br/> | ||
Line 150: | Line 158: | ||
[[#$time|$time]]<br/> | [[#$time|$time]]<br/> | ||
[[#$time6|$time6]]<br/> | [[#$time6|$time6]]<br/> | ||
− | |||
− | |||
[[#$timezone, $timezone.sign, $timezone.hh, $timezone.mm, $timezone.ss|$timezone, $timezone.sign, <br/>$timezone.hh, $timezone.mm, <br/>$timezone.ss]]<br/> | [[#$timezone, $timezone.sign, $timezone.hh, $timezone.mm, $timezone.ss|$timezone, $timezone.sign, <br/>$timezone.hh, $timezone.mm, <br/>$timezone.ss]]<br/> | ||
[[#$uri_escape|$uri_escape]]<br/> | [[#$uri_escape|$uri_escape]]<br/> | ||
Line 996: | Line 1,002: | ||
<td style="padding-right: 10px; vertical-align: top;">''Description:''</td> | <td style="padding-right: 10px; vertical-align: top;">''Description:''</td> | ||
<td style="vertical-align: top;">Email headers as single string.</td> | <td style="vertical-align: top;">Email headers as single string.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Stage:''</td> | ||
+ | <td style="vertical-align: top;">smtp-end-of-data</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | ==== $headers.address ==== | ||
+ | |||
+ | <table cellspaceing="0" cellpadding="0"> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Description:''</td> | ||
+ | <td style="vertical-align: top;">Aggregated macro for [[#$headers.sender|$headers.sender]], [[#$headers.from|$headers.from]], [[#$headers.reply_to|$headers.reply_to]], [[#$headers.to|$headers.to]], [[#$headers.cc|$headers.cc]] and [[#$headers.bcc|$headers.bcc]]</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Dimension:''</td> | ||
+ | <td style="vertical-align: top;">$headers.address</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Stage:''</td> | ||
+ | <td style="vertical-align: top;">smtp-end-of-data</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | ==== $headers.address.domain ==== | ||
+ | |||
+ | <table cellspaceing="0" cellpadding="0"> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Description:''</td> | ||
+ | <td style="vertical-align: top;">Domain part of [[#$headers.address|$headers.address]].</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Dimension:''</td> | ||
+ | <td style="vertical-align: top;">$headers.address</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Stage:''</td> | ||
+ | <td style="vertical-align: top;">smtp-end-of-data</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | ==== $headers.address.domain.part ==== | ||
+ | |||
+ | <table cellspaceing="0" cellpadding="0"> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Description:''</td> | ||
+ | <td style="vertical-align: top;">Domain part components of [[#$headers.address|$headers.address]]. There may be multiple addresses and parts so this macro has two dimensions.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Dimension:''</td> | ||
+ | <td style="vertical-align: top;">$headers.address, $headers.address.component</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Stage:''</td> | ||
+ | <td style="vertical-align: top;">smtp-end-of-data</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | ==== $headers.address.local ==== | ||
+ | |||
+ | <table cellspaceing="0" cellpadding="0"> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Description:''</td> | ||
+ | <td style="vertical-align: top;">Local part of [[#$headers.address|$headers.address]].</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Dimension:''</td> | ||
+ | <td style="vertical-align: top;">$headers.address</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Stage:''</td> | ||
+ | <td style="vertical-align: top;">smtp-end-of-data</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | ==== $headers.address.name ==== | ||
+ | |||
+ | <table cellspaceing="0" cellpadding="0"> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Description:''</td> | ||
+ | <td style="vertical-align: top;">Mailbox name related to [[#$headers.address|$headers.address]] converted to utf-8 encoding.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Dimension:''</td> | ||
+ | <td style="vertical-align: top;">$headers.address</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Stage:''</td> | ||
+ | <td style="vertical-align: top;">smtp-end-of-data</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | ==== $headers.address.type ==== | ||
+ | |||
+ | <table cellspaceing="0" cellpadding="0"> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Description:''</td> | ||
+ | <td style="vertical-align: top;">Address type of [[#$headers.address|$headers.address]]. It is either "Sender", "From", "Reply-To", "To", "Cc" or "Bcc".</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="padding-right: 10px; vertical-align: top;">''Dimension:''</td> | ||
+ | <td style="vertical-align: top;">$headers.address</td> | ||
</tr> | </tr> | ||
<tr> | <tr> |
Latest revision as of 07:45, 31 March 2011
The following macros can be used in templates and conditions of all engines:
[edit] $attachment
Description: | Email attachment data. Attachment is every body part that is not body in body-attachments-view typical for MUA's. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.base64
Description: | Email attachment data encoded as base64. Using this macro may be more effective then using ${encode_base64 $attachment} in most cases because attachment data in email is likely to be already encoded as base64. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.headers
Description: | Email attachment headers as single string. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.text
Description: | Text extracted from email attachment and converted to utf-8 encoding. This macro is intended to extract pure text from different types of documents for this text to be used in content analyzing tools. Though currently this macro is fully equivalent to $attachment it will be enhanced to support as much types of documents as possible. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.malformed
Description: | Flag that indicates whether attachment is malformed from MIME point of view. It has two values: "yes" and "no". When attachment is malformed its data will be empty. One should use this flag to exclude malformed attachments from processing to avoid lost of data in scenarios like attachment stripping. For example:
<engines> <file> <save> <precondition>$attachment.malformed $EQ no</precondition> ... </save> </file> </engines> |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.multipart
Description: | Flag that indicates whether attachment is a legacy Apple file that consists from data and resource forks. It has two values: "yes" and "no". When attachment is multipart its $attachment.resource_fork may be not empty. One should use this flag to exclude multipart attachments from processing to avoid lost of data in scenarios like attachment stripping. For example (in combination with malformed flag):
<engines> <file> <save> <precondition>$attachment.malformed $EQ no $AND $attachment.multipart $EQ no</precondition> ... </save> </file> </engines> However it is expected that such file format is depricated thus will rarely appear in emails. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.resource_fork
Description: | Resource fork of legacy Apple file that consists from data and resource forks. It is expected that such file format is depricated thus will rarely appear in emails. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.resource_fork.base64
Description: | Base64 encoded resource fork of legacy Apple file that consists from data and resource forks. Using this macro may be more effective then using ${encode_base64 $attachment.resource_fork} in most cases because attachment data in email is likely to be already encoded as base64. It is expected that such file format is depricated thus will rarely appear in emails. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.file_name
Description: | File name of an attachment as extracted from headers and converted to utf-8. Will be empty if no file name is specified in headers. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $attachment.mime_type
Description: | MIME type of an attachment as extracted from headers. Will be empty if no MIME type is specified in headers. |
Dimension: | $attachment |
Stage: | smtp-end-of-data |
[edit] $body
Description: | Email body in body-attachment-view typical for MUA's. Body is the first text body part in email or text body part in first alternative. |
Stage: | smtp-end-of-data |
[edit] $body.html
Description: | Html alternative of email body in body-attachment-view typical for MUA's. Html body is the first html body part in email or html body part in first alternative. |
Stage: | smtp-end-of-data |
[edit] $body_part
Description: | Body part of a email in body-part-view. Unlike a body-attachments-view body-part-view doesn't distinguish between body and attachments. It treats all body parts in the same manner. This is more closely corresponds to MIME standard because it doesn't distinguish body and attachments - all are body parts. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.base64
Description: | Base64-encoded body part of a email. Using this macro may be more effective then using ${encode_base64 $body_part} in most cases because body part data in email is likely to be already encoded as base64. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.is_body
Description: | Flag that indicates whether body part is body in body-attachments-view. It has two values: "yes" and "no". Body is the first text or html body part in email or text or html body part in first alternative. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.is_attachment
Description: | Flag that indicates whether body part is attachment in body-attachments-view. It has two values: "yes" and "no". Everything that is not body is attachment. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.size
Description: | Size of body part in bytes. This is deprecated because of available $size macro. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.headers
Description: | Body part headers as single string. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.text
Description: | Text extracted from email body part and converted to utf-8 encoding. This macro is intended to extract pure text from different types of documents for this text to be used in content analyzing tools. Though currently this macro is fully equivalent to $body_part it will be enhanced to support as much types of documents as possible. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.malformed
Description: | Flag that indicates whether body part is malformed from MIME point of view. It has two values: "yes" and "no". When body part is malformed its data will be empty. One should use this flag to exclude malformed body parts from processing to avoid lost of data in scenarios like body stripping. For example:
<engines> <file> <save> <precondition>$body_part.malformed $EQ no</precondition> ... </save> </file> </engines> |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.multipart
Description: | Flag that indicates whether body part is a legacy Apple file that consists from data and resource forks. It has two values: "yes" and "no". When body part is multipart its $body_part.resource_fork may be not empty. One should use this flag to exclude multipart body parts from processing to avoid lost of data in scenarios like body stripping. For example (in combination with malformed flag):
<engines> <file> <save> <precondition>$body_part.malformed $EQ no $AND $body_part.multipart $EQ no</precondition> ... </save> </file> </engines> However it is expected that such file format is depricated thus will rarely appear in emails. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.file_name
Description: | File name of a body part as extracted from headers and converted to utf-8. Will be empty if no file name is specified in headers. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.mime_type
Description: | MIME type of a body part as extracted from headers and converted to utf-8. Will be empty if no file name is specified in headers. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.digest
Description: | SHA1 digest calculated from body part data. This is deprecated because of available $sha1 macro. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.resource_fork
Description: | Resource fork of legacy Apple file that consists from data and resource forks. It is expected that such file format is depricated thus will rarely appear in emails. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.resource_fork.size
Description: | Size of resource fork of body part. This is deprecated because of available $size macro. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $body_part.resource_fork.digest
Description: | SHA1 digest calculated from resource fork data of body part. This is deprecated because of available $sha1 macro. |
Dimension: | $body_part |
Stage: | smtp-end-of-data |
[edit] $current_time
Description: | Current unix time. Unlike $time macro this one is evaluated to current time at each occurrence. |
[edit] $data
Description: | Whole email data. Uses LF's for linebreaks. |
Stage: | smtp-end-of-data |
[edit] $data.size
Description: | Size of email data in bytes. This is deprecated because of available $size macro. |
Stage: | smtp-end-of-data |
[edit] $data.digest
Description: | SHA1 digest calculated from email data. This is deprecated because of available $sha1 macro. |
Stage: | smtp-end-of-data |
[edit] $decode_base64
Description: | Decodes data from base64 encoding. |
Arguments: | 1) Data to decode. |
[edit] $decrypt_eb64
Description: | Decryptes encrypted base64 data using keys from passwords file. |
Arguments: | 1) Encrypted base64 data to decrypt. |
[edit] $embedded.ch_wbl.result
Description: | Client Host WBL processing result. Possible values are: 'none', 'whitelist', 'blacklist' and 'tempfailure'. May have empty value in case of corresponding processing has not been run. Currently available for policy server requests. |
[edit] $embedded.spam_traps.result
Description: | Spam traps processing result. Possible values are: 'yes' and 'no'. May have empty value in case of corresponding processing has not been run. Currently available for policy server requests. |
[edit] $embedded.wbl.result
Description: | User-level WBL processing result. Possible values are: 'none', 'group_pass', 'group_reject', 'group_discard', 'acl_sender', 'acl_recipient', 'spam_whitelist' and 'blacklist'. May have empty value in case of corresponding processing has not been run. Currently available for policy server requests. |
[edit] $embedded.spf.result
Description: | SPF processing result. Possible values are: 'invalid', 'neutral', 'pass', 'fail', 'softfail', 'none', 'temperror' and 'permerror'. May have empty value in case of corresponding processing has not been run. Currently available for policy server requests. |
[edit] $embedded.rbl.result
Description: | RBL processing result. Possible values are: 'yes', 'no' and 'error'. May have empty value in case of corresponding processing has not been run. Currently available for policy server requests. |
[edit] $embedded.rbl.site
Description: | RBL site that indicated matched record. Macro has not empty value in case of 'yes' value of $embedded.rbl.result. |
[edit] $embedded.rbl.reason
Description: | Reason for record been in the list for RBL site. Macro may have not empty value in case of 'yes' value of $embedded.rbl.result. |
[edit] $embedded.greylist.result
Description: | Greylist processing result. Possible values are: 'first_seen', 'blocked' and 'auth'. May have empty value in case of corresponding processing has not been run. Currently available for policy server requests. |
[edit] $empty
Description: | Empty string. |
[edit] $encode_base64
Description: | Encodes data to base64 encoding. |
Arguments: | 1) Data to encode. 2) Maximum line length in encoded data. Optional, default is unlimited (do not break on lines). 3) Flag whether to suppress final newline. Can be "yes" or "no". Optional, default to "yes". 4) Flag whether to use CRLF's instead of LF's for newlines. Can be "yes" or "no". Optional, default to "no". |
[edit] $exception
Description: | Text of exception been caught. The text is an evaluated <throw> option as described in result with validation. This macro is available in exception processing sequence. |
[edit] $globals_set
Description: | Sets value(s) of global variable(s) with specified name(s). Returns set value or concatenation of all values if multiple variables are set. |
Arguments: | 2 or more even number of arguments: Odd) variable name. Even) variable value. |
[edit] $globals_append
Description: | Appends to value(s) of global variable(s) with specified name(s). Returns appended value or concatenation of all values if multiple variables are appended. |
Arguments: | 2 or more even number of arguments: Odd) variable name. Even) value to append. |
[edit] $globals_get
Description: | Get a value of global variable. If variable is not set it is NULL. |
Arguments: | 1) Variable name. |
[edit] $globals_defined
Description: | Evaluates to "yes" if global variable is defined and "no" othewise |
Arguments: | 1) Variable name. |
[edit] $json_escape
Description: | Escapes string to be a valid JSON string. |
Arguments: | One or more arguments are concatenated and then escaped. |
[edit] $header
Description: | Email header. |
Dimension: | $header |
Stage: | smtp-end-of-data |
[edit] $header.name
Description: | Email header name. |
Dimension: | $header |
Stage: | smtp-end-of-data |
[edit] $header.body
Description: | Email header body. |
Dimension: | $header |
Stage: | smtp-end-of-data |
[edit] $header_is_present_by_name
Description: | Evaluates to "yes" if email header with specified name is present. Otherwise evaluate to "no". |
Arguments: | 1) Header name. |
Stage: | smtp-end-of-data |
[edit] $header_body_by_name
Description: | Evaluates to email header body by header name. If multiple headers with same name are present then macro evaluates to body of first header. If no such header present macro evaluates to empty value. |
Arguments: | 1) Header name. |
Stage: | smtp-end-of-data |
[edit] $headers
Description: | Email headers as single string. |
Stage: | smtp-end-of-data |
[edit] $headers.address
Description: | Aggregated macro for $headers.sender, $headers.from, $headers.reply_to, $headers.to, $headers.cc and $headers.bcc |
Dimension: | $headers.address |
Stage: | smtp-end-of-data |
[edit] $headers.address.domain
Description: | Domain part of $headers.address. |
Dimension: | $headers.address |
Stage: | smtp-end-of-data |
[edit] $headers.address.domain.part
Description: | Domain part components of $headers.address. There may be multiple addresses and parts so this macro has two dimensions. |
Dimension: | $headers.address, $headers.address.component |
Stage: | smtp-end-of-data |
[edit] $headers.address.local
Description: | Local part of $headers.address. |
Dimension: | $headers.address |
Stage: | smtp-end-of-data |
[edit] $headers.address.name
Description: | Mailbox name related to $headers.address converted to utf-8 encoding. |
Dimension: | $headers.address |
Stage: | smtp-end-of-data |
[edit] $headers.address.type
Description: | Address type of $headers.address. It is either "Sender", "From", "Reply-To", "To", "Cc" or "Bcc". |
Dimension: | $headers.address |
Stage: | smtp-end-of-data |
[edit] $headers.date
Description: | Date extracted from Date email header. Will be empty if no such header. |
Stage: | smtp-end-of-data |
[edit] $headers.date.timestamp
Description: | Date as timestamp (seconds since epoch) extracted from Date email header. Will be empty if no such header. |
Stage: | smtp-end-of-data |
[edit] $headers.message_id
Description: | ID extracted from Message-ID header value. |
Stage: | smtp-end-of-data |
[edit] $headers.in_reply_to
Description: | ID extracted from In-Reply-To header value. There may be multiple ID's so this macro has dimension. |
Dimension: | $headers.in_reply_to |
Stage: | smtp-end-of-data |
[edit] $headers.references
Description: | ID extracted from References header value. There may be multiple ID's so this macro has dimension. |
Dimension: | $headers.references |
Stage: | smtp-end-of-data |
[edit] $headers.from
Description: | Address extracted from From header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.from |
Stage: | smtp-end-of-data |
[edit] $headers.from.local
Description: | Local part of address extracted from From header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.from |
Stage: | smtp-end-of-data |
[edit] $headers.from.domain
Description: | Domain part of address extracted from From header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.from |
Stage: | smtp-end-of-data |
[edit] $headers.from.domain.part
Description: | Domain part components of address extracted from From header value. There may be multiple addresses and parts so this macro has two dimensions. |
Dimension: | $headers.from, $headers.from.component |
Stage: | smtp-end-of-data |
[edit] $headers.from.name
Description: | Mailbox name of address extracted from From header value and converted to utf-8 encoding. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.from |
Stage: | smtp-end-of-data |
[edit] $headers.sender
Description: | Address extracted from Sender header value. |
Stage: | smtp-end-of-data |
[edit] $headers.sender.local
Description: | Local part of address extracted from Sender header value. |
Stage: | smtp-end-of-data |
[edit] $headers.sender.domain
Description: | Domain part of address extracted from Sender header value. |
Stage: | smtp-end-of-data |
[edit] $headers.sender.domain.part
Description: | Domain part component of address extracted from Sender header value. |
Dimension: | $headers.sender.component |
Stage: | smtp-end-of-data |
[edit] $headers.sender.name
Description: | Mailbox name of address extracted from Sender header value and converted to utf-8 encoding. |
Stage: | smtp-end-of-data |
[edit] $headers.reply_to
Description: | Address extracted from Reply-To header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.reply_to |
Stage: | smtp-end-of-data |
[edit] $headers.reply_to.local
Description: | Local part of address extracted from Reply-To header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.reply_to |
Stage: | smtp-end-of-data |
[edit] $headers.reply_to.domain
Description: | Domain part of address extracted from Reply-To header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.reply_to |
Stage: | smtp-end-of-data |
[edit] $headers.reply_to.domain.part
Description: | Domain part components of address extracted from Reply-To header value. There may be multiple addresses and parts so this macro has two dimensions. |
Dimension: | $headers.reply_to, $headers.reply_to.component |
Stage: | smtp-end-of-data |
[edit] $headers.reply_to.name
Description: | Mailbox name of address extracted from Reply-To header value and converted to utf-8. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.reply_to |
Stage: | smtp-end-of-data |
[edit] $headers.return_path
Description: | Address extracted from Return-Path header value. |
Dimension: | $headers.return_path |
Stage: | smtp-end-of-data |
[edit] $headers.return_path.local
Description: | Local part of address extracted from Return-Path header value. |
Dimension: | $headers.return_path |
Stage: | smtp-end-of-data |
[edit] $headers.return_path.domain
Description: | Domain part of address extracted from Return-Path header value. |
Dimension: | $headers.return_path |
Stage: | smtp-end-of-data |
[edit] $headers.return_path.domain.part
Description: | Domain part components of address extracted from Return-Path header value. |
Dimension: | $headers.return_path, $headers.return_path.component |
Stage: | smtp-end-of-data |
[edit] $headers.return_path.name
Description: | Mailbox name of address extracted from Return-Path header value and converted to utf-8. |
Dimension: | $headers.return_path |
Stage: | smtp-end-of-data |
[edit] $headers.fake_sender
Description: | Special macro for backward compatibility with MPP archive database scheme. This macro is calculated as following: if there is From header and it contains single address then this address is taken; else if there is Sender header then address extracted from it is taken; otherwise if there is Return-Path header and it contains single address then this address is taken; otherwise empty value is taken. |
Stage: | smtp-end-of-data |
[edit] $headers.fake_sender.local
Description: | Local part of corresponding address. |
Stage: | smtp-end-of-data |
[edit] $headers.fake_sender.domain
Description: | Domain part of corresponding address. |
Stage: | smtp-end-of-data |
[edit] $headers.fake_sender.name
Description: | Mailbox name of corresponding address. Name is converted to utf-8 encoding. |
Stage: | smtp-end-of-data |
[edit] $headers.to
Description: | Address extracted from To header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.to |
Stage: | smtp-end-of-data |
[edit] $headers.to.local
Description: | Local part of address extracted from To header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.to |
Stage: | smtp-end-of-data |
[edit] $headers.to.domain
Description: | Domain part of address extracted from To header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.to |
Stage: | smtp-end-of-data |
[edit] $headers.to.domain.part
Description: | Domain part components of address extracted from To header value. There may be multiple addresses and parts so this macro has two dimensions. |
Dimension: | $headers.to, $headers.to.component |
Stage: | smtp-end-of-data |
[edit] $headers.to.name
Description: | Mailbox name of address extracted from To header value and converted to utf-8 encoding. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.to |
Stage: | smtp-end-of-data |
[edit] $headers.cc
Description: | Address extracted from Cc header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.cc |
Stage: | smtp-end-of-data |
[edit] $headers.cc.local
Description: | Local part of address extracted from Cc header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.cc |
Stage: | smtp-end-of-data |
[edit] $headers.cc.domain
Description: | Domain part of address extracted from Cc header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.cc |
Stage: | smtp-end-of-data |
[edit] $headers.cc.domain.part
Description: | Domain part components of address extracted from Cc header value. There may be multiple addresses and parts so this macro has two dimensions. |
Dimension: | $headers.cc, $headers.cc.component |
Stage: | smtp-end-of-data |
[edit] $headers.cc.name
Description: | Mailbox name of address extracted from Cc header value and converted to utf-8. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.cc |
Stage: | smtp-end-of-data |
[edit] $headers.bcc
Description: | Address extracted from Bcc header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.bcc |
Stage: | smtp-end-of-data |
[edit] $headers.bcc.local
Description: | Local part of address extracted from Bcc header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.bcc |
Stage: | smtp-end-of-data |
[edit] $headers.bcc.domain
Description: | Domain part of address extracted from Bcc header value. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.bcc |
Stage: | smtp-end-of-data |
[edit] $headers.bcc.domain.part
Description: | Domain part components of address extracted from Bcc header value. There may be multiple addresses and components so this macro has two dimensions. |
Dimension: | $headers.bcc, $headers.bcc.component |
Stage: | smtp-end-of-data |
[edit] $headers.bcc.name
Description: | Mailbox name of address extracted from Bcc header value and converted to utf-8. There may be multiple addresses so this macro has dimension. |
Dimension: | $headers.bcc |
Stage: | smtp-end-of-data |
[edit] $headers.subject
Description: | Text extracted from Subject header value and converted to utf-8. |
Stage: | smtp-end-of-data |
[edit] $hmac
Description: | Calculates HMAC digest from provided data and key. |
Arguments: | 1) Data to calculate from. 2) Key to use. 3) Hash function to use. Optional, default to "sha1". Allowed values: "md2", "md4", "md5", "sha", "sha1", "dss", "dss1", "ecdsa", "sha224", "sha256", "sha384", "sha512", "ripemd160". |
[edit] $host
Description: | Host name of a client sending a request as extracted from message headers or from other sources. |
[edit] $ip
Description: | IP address in doted-decimal notation of a client sending a request as extracted from message headers or from other sources. |
[edit] $ip.dec
Description: | IP address as decimal of a client sending a request as extracted from message headers or from other sources. |
[edit] $ip.hex
Description: | IP address as hexadecimal of a client sending a request as extracted from message headers or from other sources. |
[edit] $if_not_empty
Description: | Checks if second argument is not empty, adds prefix and suffix and returns obtained value. Otherwise returns emtpy value. |
Arguments: | 1) Prefix. 2) Checked value. 3) Suffix. |
[edit] $gethostname
Description: | Result of gethostname() call. Name of the host where application is running. |
[edit] $group
Description: | ID of MPP policy group that request is processed with. |
[edit] $math_sum
Description: | Calculates a sum of its arguments. Arguments must evaluate to integers or floats otherwise exception will be thrown. |
Arguments: | One or more expressions that must evaluate to integers or floats. |
[edit] $message_id
Description: | Short equivalent to $headers.message_id. |
[edit] $md5
Description: | Calculates MD5 digest from data. |
Arguments: | 1) Data to calculate from. |
[edit] $not_empty
Description: | Returns first not null and not empty value from its arguments evaluating from left to right. Otherwise returns null (if all are null) or empty value. Has important property that it will be null only if ALL arguments are null. This property may be used for merging execution branches. |
Arguments: | One or more. |
[edit] $pid
Description: | Process ID of application. |
[edit] $recipient
Description: | SMTP recipient address. |
Dimension: | $recipient |
[edit] $recipient.local
Description: | Local part of SMTP recipient address. |
Dimension: | $recipient |
[edit] $recipient.domain
Description: | Domain part of SMTP recipient address. |
Dimension: | $recipient |
[edit] $recipient.domain.part
Description: | Domain part components of SMTP recipient address. |
Dimension: | $recipient, $recipient.component |
[edit] $recipient.component
Description: | Components of SMTP recipient address. Components are address itself and domains starting from more specific ending with less specific. |
Dimension: | $recipient, $recipient.component |
[edit] $result
Description: | Special macro that represent current result value in result with validation. |
[edit] $sender
Description: | SMTP sender address. |
[edit] $sender.local
Description: | Local part of SMTP sender address. |
[edit] $sender.domain
Description: | Domain part of SMTP sender address. |
[edit] $sender.domain.part
Description: | Domain part components of SMTP sender address. |
Dimension: | $sender.component |
[edit] $sender.component
Description: | Components of SMTP sender address. Components are address itself and domains starting from more specific ending with less specific. |
Dimension: | $sender.component |
[edit] $sha1
Description: | Calculates SHA1 digest from data. |
Arguments: | 1) Data to calculate from. |
[edit] $size
Description: | Calculates size of data in bytes. |
Arguments: | 1) Data to calculate from. |
[edit] $size_hex
Description: | Calculates size of data in bytes as hexadecimal value. |
Arguments: | 1) Data to calculate from. |
[edit] $sp, $br, $cr, $lf, $crlf, $htab
Description: | Special characters and sequences: SP, LF, CR, LF, CRLF, HTAB. |
[edit] $subject
Description: | Short variant of $headers.subject. |
[edit] $tag.name
Description: | Name of a tag currently associated with a message by previous pipeline(s). For details about tagging see result with tagging. |
Dimension: | $tag |
[edit] $tag.value
Description: | Value of a tag currently associated with a message by previous pipeline(s). For details about tagging see result with tagging. |
Dimension: | $tag |
[edit] $text_find_replace_all
Description: | In given data replaces all specified sequences with corresponding replacers. Can be used as general purpose escaping function. |
Arguments: | 1) Data to replace in. Each even argument is a sequence to replace. Each odd argument is a corresponding replacer. |
[edit] $text_map
Description: | Searches for a first match key in a specially formated textual map and returns corresponding value. Textual map evaluates to a string that must conform to the following format:
'0038000000jGpR0AAK', '0039000000PGKR0AAK', '0048000000gGpR0AOK' '00230000006GpU0AAK', '0034000000HGKf0AAK', '0058000000gRpRDAsK' |
Arguments: | 1) Key to search by. 2) Map to search in. |
[edit] $text_pad_left
Description: | Pads text to a specified size with a specified symbol. Pads to the left. |
Arguments: | 1) UTF-8 text to pad. 2) Desired number of characters in result. 3) Pad character. |
[edit] $text_size
Description: | Calculates number of characters in UTF-8 text. |
Arguments: | 1) UTF-8 text. |
[edit] $text_truncate
Description: | Truncate UTF-8 text to contain no more then specified number of characters. Truncation occur at the end of text. Optionally puts specified truncation sequence (such as "...") at the end of text. If truncation sequence is specified text is truncated to lower number of characters so that total number remains no more then specified number. |
Arguments: | 1) Text to truncate. 2) Number of characters to truncate text to. 3) Truncation sequence. Optional, default to empty. |
[edit] $thread
Description: | Current thread ID. Can be useful for unique ID's generation. |
[edit] $time
Description: | Current timestamp. Evaluated only once at first usage in a pipeline for each request and then remains the same even if actual time is changing while request is being processed. |
[edit] $time6
Description: | Current timestamp as compact 6-characters value. Evaluated at each usage. Can be useful for unique ID's generation. |
[edit] $timezone, $timezone.sign, $timezone.hh, $timezone.mm, $timezone.ss
Description: | Current timezone and its different parts. Timezone is presented in the following format +/-HH:MM (for example +02:00). Other macros are timezone parts: sign, hours, minutes, seconds. |
[edit] $uri_escape
Description: | Escapes string for URI. |
Arguments: | 1) String to escape. |
[edit] $wait
Description: | Causes dealy in processing on specified number of millisecond. Useful for testing/debuging synchronization issues. Macro always returns empty value. |
Arguments: | 1) Number of millisecond to wait. |
[edit] $wrap
Description: | Special tool to "wrap" expression by last dimension. Used to create lists from dimensional (multi-value) expressions. It works as follow:
For example lets assume that an email has three recipients: rcpt_1@domain.com, rcpt_2@example.net and rcpt_3@my.host.edu. Expression: ${wrap $#{ OR } $recipient} will be evaluated to: rcpt_1@domain.com OR rcpt_2@example.net OR rcpt_3@my.host.edu and will not have $recipient dimension. |
Arguments: | 1) Wrap template. Syntax is the following:
wrap_template = "{" 0*1wrap_prefix wrap_main 0*1wrap_suffix "}" ; generic version | 0*1wrap_prefix wrap_main_without_space 0*1wrap_suffix ; simplified version if main part has no spaces inside wrap_prefix = "{" *(template | wrap_placeholder) "}" ; prefix is added at each iteration except first wrap_suffix = "{" *(template | wrap_placeholder) "}" ; suffix is added at each iteration except last wrap_main = *(template | wrap_placeholder) ; main part is always added wrap_main_without_space = *(template_without_space | wrap_placeholder) ; main part is always added wrap_placeholder = "$#" | "${#}" ; this will be replaced with expression value at each iteration ; note that it can't be used in arguments of a macro template = ... ; usual template expression template_without_space = ... ; usual template expression without spaces inside For example expression: SELECT FROM `access_list` WHERE ${wrap `address`=$#{ OR } '${escape $recipient.component}'} in the context of MySQL Engine will be evaluated for each recipient as follow: SELECT FROM `access_list` WHERE `address`='test1@example.domain.com' OR `address`='example.domain.com' OR `address`='domain.com' OR `address`='com' provided that recipient is test1@example.domain.com. Result value will have only $recipient dimension - $recipient.component dimension will be wrapped out. 2) Expression to wrap. |
[edit] $xml_cdata
Description: | Makes XML CDATA from a string: replaces all "]]>" with "]]]]><![CDATA[>", prefixes with "<![CDATA[" and suffixes with "]]>". |
Arguments: | 1) String to make from. |
[edit] $xml_escape
Description: | Escapes string for XML. |
Arguments: | 1) String to escape. |
[edit] $xml_date
Description: | Date in XML Scheme compliant format. Calculate from value of $time macro if no arguments are given or from timestamp value given as first argument. |
Arguments: | 1) Timestamp to calculate date from. Optional, default to value of $time macro. |
[edit] $xml_time
Description: | Time in XML Scheme compliant format. Calculate from value of $time macro if no arguments are given or from timestamp value given as first argument. |
Arguments: | 1) Timestamp to calculate time from. Optional, default to value of $time macro. |
[edit] $xml_dateTime
Description: | Date and time in XML Scheme compliant format. Calculate from value of $time macro if no arguments are given or from timestamp value given as first argument. Will have +00:00 explicit timezone specification at the end. |
Arguments: | 1) Timestamp to calculate date and time from. Optional, default to value of $time macro. |
[edit] $year, $month, $day, $hour, $minute, $second
Description: | Current year, month, etc. in current timezone. Calculated from value of $time macro thus evaluated once at first usage of any of them. |