Filtering email with filter(1)

Some time ago I was browsing through list of orphaned Debian packages1. and encountered filter program with very promising description — “filter is one of the original mail filtering programs written for UNIX”.

It is much simplier than procmail, its manual page is page, not manual, while supporting almost anything I need:

Syntax of filter rules is much less cryptic and less verbose, than one of procmail. Compare

if (subject = "Foo") then save "/tmp/foo.mbox"

with much more verbose procmail rule.


Unfortunately, filter does not provide equivalence of two features of procmail, that are significant to my email workflow:

Both filter and procmail are long dead mature. Source code of filter is twice as short, if you care about such things. Half of that is regular expression engine, that is built it modern implementations of standard C library. Give filter a shot.

Definitely, filter would benefit from some care. Use standard regular expression engine, add support for X-Spam-Level header and here it is – perfect email filtering solution. Maybe, one day, in my copious free time…