SExp


Object Hierarchy:

Object hierarchy for SExp

Description:

[ CCode ( type_id = "camel_sexp_get_type ()" ) ]
[ Version ( since = "3.4" ) ]
public class SExp : Object

S-expression matching functions for message filtering.

SExp implements the s-expression matching functions used by FilterDriver to evaluate filter rules against messages.

Match expressions operate on a single message and return a boolean. Available matching functions include:

  • `(body-contains string …)` — matches if the message body contains any of the given strings (searches text/… parts with tag-stripping for HTML).
  • `(header-contains header string …)` / `(header-matches …)` / `(header-starts-with …)` / `(header-ends-with …)` — header matching.
  • `(header-exists header)` — tests whether a header is present.
  • `(match-all expression)` — evaluates a boolean against all messages.
  • `(user-flag flag)` / `(user-tag tag value)` — user metadata matching.
  • `(system-flag flag)` — system flag matching (seen, deleted, flagged, etc.).
  • `(pipe-message cmd)` — runs the message through an external program whose exit code determines the match result.

The following built-in s-exp's are supported:

list = (and list*) perform an intersection of a number of lists, and return that.

bool = (and bool*) perform a boolean AND of boolean values.

list = (or list*) perform a union of a number of lists, returning the new list.

bool = (or bool*) perform a boolean OR of boolean values.

gint = (+ int*) Add integers.

string = (+ string*) Concat strings.

time_t = (+ time_t*) Add time_t values.

gint = (- gint int*) Subtract integers from the first.

time_t = (- time_t*) Subtract time_t values from the first.

gint = (cast-int string|int|bool) Cast to an integer value.

string = (cast-string string|int|bool) Cast to a string value.

Comparison operators:

bool = (< gint gint) bool = (> gint gint) bool = (= gint gint)

bool = (< string string) bool = (> string string) bool = (= string string)

bool = (< time_t time_t) bool = (> time_t time_t) bool = (= time_t time_t) Perform a comparison of 2 integers, 2 string values, or 2 time values.

Function flow:

type = (if bool function) type = (if bool function function) Choose a flow path based on a boolean value

type = (begin func func func) Execute a sequence. The last function return is the return type.


Namespace: Camel
Package: camel-1.2

Content:

Static methods:

Creation methods:

Methods:

Inherited Members: