Manipulating Maildirs with Python
My e-mail still isn't as shiny as I'd like. In particular, my use of Exim Filters to sort incoming mail into folders lacks the ability to mark messages as read (although it's still miles ahead of the dreaded Procmail). This would be handy for high-traffic mailing lists which I don't have time to read on a daily basis, but which I find it hard to ignore the "unread" icon next to the folders for.
One day, I should probably move to using the Dovecot LDA and its sieve implementation, which supports the "imap4flags" extension, thus allowing marking messages as read, making them turn purple in Thunderbird, and all sorts of other cool stuff. Sadly, life (or this afternoon) is too short.
In the meantime, I've solved the problem in the usual way I deal with life's imperfections: gratuitious Python - http://pastebin.org/77199 run from a crojob every five minutes.
(Disclaimer: letting scratty little bits of Python anywhere near something as important as your e-mail is probably a Very Bad Idea.)