Expressions may call built-in functions that implicitly refer to the message being filtered. Functions provide information about the messages, the context and meta-data, but they're not allowed to modify anything. On the other hand, filter actions may modify some message properties, such as the priority or certain header fields. In this case, functions that are called subsequently work on the modified data. Another way of expressing this is that the effects of filters will cascade onto the filters.
Table XI.2. Built-in filter functions
Function name | Return type | Arguments | Description |
---|---|---|---|
age | number |
A time unit as a string, which must be one of "minutes" , "hours" or "days" .
| Return the time elapsed since the date and time indicated in the Date field of the message, as a number of minutes, hours or days depending on the argument. If the date field cannot be parsed, the result is null. |
body | string | None | Return the entire body of the message. |
cc | string | None | Return a comma-separated list of addresses extracted from the Cc (carbon copy) field. If the Cc field is "John Doe" <john.doe@example.org> , the cc function will return john.doe@example.org (whereas header("Cc") would return the entire field). |
condition | boolean | Condition name | Evaluate the named condition and return its result. The name refers to another filter entry. |
date | boolean | Date field | Return the date and time of the message in the local time zone. The possible arguments are the same than for the now() function. |
date_utc | boolean | Date field | Identical to the date() function, except that the date and time is expressed in UTC time instead of the local time zone. |
from | string | None | Return the sender's address extracted from the From field. In the unlikely event that there are several addresses in this field, return a comma-separated list of these addresses. |
header | string | Field name | Return the decoded value of the header field, or an empty string if the field is not found. The line is unfolded and non US-ASCII characters encoded with the RFC-2047 rules have been decoded and converted to unicode. Use rawheader() to access the non-decoded version. |
headers | string | None | Return the decoded value of the entire message header as one big string with consecutive fields separated by a newline character. The lines are unfolded and non US-ASCII characters encoded with the RFC-2047 rules have been decoded and converted to unicode. This function should be used only in the rare cases where it's not adequate to target a specific field with the header() function. |
identity | string | none | Return the email address from our identities that is associated with the message. For an outgoing message, that would normally be the address of the From field. For an incoming message, it is the mail address that is associated with the spool directory from wich the mailfile has been picked up. These associations are declared in manitou-mdx configuration file. |
now | string | Date field | Return the current date and time in the local timezone. The possible arguments and corresponding return values are:
|
now_utc | string | Date field | This is identical to now(),except that it returns the date in UTC time instead of the local timezone. |
rawheader | string | Field name | Return the non-decoded value of the header field, possibly with quoted-printable and base64 contents as defined in RFC-2047 , or empty if the field is not found. The line is unfolded. Generally the header function should be used instead. |
rawheaders | string | None | Return the non-decoded value of the entire message header as one big string with consecutive fields separated by a newline character, possibly with quoted-printable and base64 contents according to RFC2047. Generally the headers function should be used instead. |
to | string | None | Return a comma-separated list of addresses extracted from the To (recipient) field. If the To field is "John Doe" <john.doe@example.org> , the to function will return john.doe@example.org (whereas header("To") would return the entire field). |