Advanced Filtering 101

To help people understand and use filters properly I've put together a list of interesting examples of what you can do with filters.

This is by no means complete but it's a start. If you have some hairy exploit that you want to share with the world I'd be more than happy to add it to this list.

Firstly to use filters to their full capability you will need to spend at least some time getting to the DOM. The DOM gives you access to all the fields on the various objects relevant to the filtering taking place.

Filter against messages' charset
Mail.InternetHeader[Subject]
Contains
?GB2312?


OR

Mail.InternetHeader[Content-Type]
Contains
GB2312


This would check for and email written in the chinese charset "GB2312". I can't read Chinese so I just delete them straight away.
Is the sender in my address book? Mail.From.Contact.Folder
Starts With
/Contacts


This checks whether the sender has a contact record somewhere in the /Contacts folder tree. You could furthur narrow this to a mailing group by setting the value to '/Contacts/MyGroup' for instance.

You can browse to a folder with the drop down next to the Value field.

Set the mail's label to the customer number
If you stored each customer in a contact record, and put their customer ID in one of the custom fields called 'CustID' then you could set incomming mail to be labelled by their customer ID automatically with an action like:

Set Label
Mail.From.Contact.CustID