evolution filter to procmail conversion

evolution filter to procmail conversion

I find evolution to be pretty slow to filter my mail; if I come back after a weekend without evo running, then it can take a good 20 minutes or so filtering mail before it’s ready again. I use a pretty roundabout way of getting mail: fetchmail fetches it from the main mailserver and delivers it using procmail to my maildir inbox on NFS, which is then served by IMAP from the fileserver back to evo on my workstation. I like IMAP, and ideally the mail would just get delivered to the fileserver, but I don’t have that luxury yet :)

But I’m using procmail, which means that all the mail can potentially be filtered as it’s delivered, which would save plenty of perceived time. I wondered if there was such a beast that could convert evolution filters to procmailrc format. Turns out there isn’t.

But it also turns out that the filters are stored in an overengineered bit of XML in your .evolution directory, and after perusing it I realised I could probably write an XSLT to convert it.

So, here’s the first draft of evo2procmail.xsl which isn’t terribly crash hot, but can give you a .procmailrc fragment that’s pretty close to what you want. It will definitely need some editing afterwards, as I haven’t bothered translating evo filter names into their actual headers, nor do the targets look anything like what you want to send them to.

Run it like this:

xsltproc evo2procmail.xsl ~/.evolution/mail/filters.xml

Enjoy! (Experienced XSLT hackers are encouraged to improve this :)