Sieve filters: implementation internals

NOTE: This discussion is technical; while it may be of interest during debugging or in discussions with Oracle technical support, it is otherwise unlikely to be relevant or of interest for casual perusal.

Sieve parsing and evaluation is implemented using a generic parse/evaluation subsystem. In addition to Sieve, this system has also been used to implement other languages, most notably the language used by the PMDF-DIRSYNC product. Specific language details, in particular what "functions" can be called and what arguments they require, are specified through callbacks.

Parsed expressions are stored in two separate linked lists of arrays: One for instructions and the other for string data. The use of a series of array segments makes it possible to write parsed expressions out to disk and read them back in later. This feature is used to store the system Sieve in the compiled configuration  so it doesn&#x27;t need to be reparsed.

This subsystem only understands basic script syntax; it knows nothing about specific Sieve semantics. Information about Sieve semantics is provided through callbacks passed to the parser and evaluator. The Sieve-specific callbacks are the routines  and.

See also:
 * systemfilter MTA Option
 * cnbuild utility
 * mm_debug MTA Option
 * filter_debug MTA Option
 * Sieve filters