Enkive Message Filtering
From Enkive Wiki
Setup Filters for filtering messages that get into Enkive
Starting with the 0.8 release there are enhanced options for filtering messages. Messages can be filtered by headers and compare integers, floats, date, strings, and addresses. The options for filtering by the various types are as follows:
- Integer
- MATCHES
- DOES_NOT_MATCH
- IS_GREATER_THAN
- IS_LESS_THAN
- Float
- MATCHES
- DOES_NOT_MATCH
- IS_GREATER_THAN
- IS_LESS_THAN
- Date
- MATCHES
- DOES_NOT_MATCH
- IS_GREATER_THAN
- IS_LESS_THAN
- String
- MATCHES
- DOES_NOT_MATCH
- CONTAINS - This option takes a regex
- DOES_NOT_CONTAIN - This option takes a regex
- Address
- MATCHES
- DOES_NOT_MATCH
- CONTAINS
- DOES_NOT_CONTAIN
An example setup may be as follows
<filters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="enkive-filters.xsd"> <defaultAction>Allow</defaultAction> <filter enabled="true"> <action>deny</action> <header>From</header> <value type="address" comparison="matches">spam@spam.com</value> </filter> <filter enabled="true"> <action>deny</action> <header>X-Spam-Flag</header> <value type="string" comparison="matches">YES</value> </filter> </filters>
If the above were placed in enkive-filters.xml it would allow all messages by default, but deny message that are from "spam@spam.com" as well as messages that have been marked by a spam filter with the header "X-Spam-Flag: YES".