User Tools

Site Tools


mailapi:userruleconditions

UserRuleConditions Replacement

Use:

~userruleconditions~
<format string>
~end~

Required parameter: RuleId

This returns the message rule conditions for the specified rule

The format string can have the replacements

  • id - numeric ID of the condition
  • field - field/data to test
  • data - data to compare it to
  • match - the type of comparison
  • matchi - whether the comparison is case sensitive (0) or not (1)
  • matchn - whether the comparison is negated (1) or not (0)

Fields

If the field name is not listed below, then the appropriate message header is used. You can specify multiple fields, separated by commas, to have the comparison work if any match, eg 'to,cc' will check both the To and Cc header fields, and match if either match the comparison data

  • SIZE - the size of the message
  • INCOMING - 1 if the message is incoming, 0 otherwise
  • LOCAL - 1 if the message is locally sent, 0 otherwise
  • SYSTEM - 1 if the message is a system message, 0 otherwise
  • SPAMSCORE - the spam score of the message
  • QUARANTINE - 1 if the message is to be quarantined, 0 otherwise
  • KEYWORDS - a list of the keywords added to the message so far
  • MARKREAD - 1 if the message is to be marked read, 0 otherwise
  • FLAG - 1 if the message is to be flagged/starred, 0 otherwise
  • RULEMATCH - a list of the rule names which have been matched so far
  • DATENOW - the date now, in the form yyyy-mm-dd
  • TIMENOW - the time now, in the form hh:mm
  • MSGDATE - the date of the message, in the form yyyy-mm-dd
  • BODY - the body of the message (note that this is the raw message, not decoded)

Comparison Types

If the field type is SIZE or SPAMSCORE, then these comparisons are done numerically if possible, otherwise comparisons are all text based. Ordering is based on raw character code (in UTF8 encoding), so non-ascii characters may not work well with GT/LT etc comparisons

  • EQ - equals
  • NE - not equals
  • LT - less than
  • GT - greater than
  • LE - less than or equal
  • GE - greater than or equal
  • BT - between two values, data values are separated by a tab character
  • SS - substring match
  • WC - wildcards (* and ?)
  • RE - regular expression (PCRE)
mailapi/userruleconditions.txt · Last modified: 2018/11/14 10:45 (external edit)