my little (mail-filtering) pony...
Nov. 1st, 2007 03:18 pmI'm looking for a tool to help me filter my email. Whenever I've mentioned this before, someone always mentions procmail. At which point I take a cursory look at procmail, find myself thinking about cats having hairballs, and go do something else.
But at this point, even though I have really excellent spam filtering, my mail is getting unmanageable. Before I actually dig in to the procmail hairball, I'd like to know what, if any, alternatives I should look at.
I think my pony here would be a special purpose language (or better, a python module) with which I could write scripts that I would run either directly on maildirs on my imap server (i.e. I would run them as a local user on the sserver), or that would function essentially as a scriptable imap client.
My starting point for thinking about the features I want is mh: I've been using shell scripts and mh to filter my MIT mail for years; at minimum I want the features that gives me. Which is, in a nutshell, the ability to filter on the content of any header. I could live with less annoying syntax, though:
Edit: Added 2007-11-01 at 19:29
I forgot to mention one of the main reasons this is a pony: I should have made clear that part of the reason I'm thinking in terms of something I can run on the files in a maildir is that I don't necessarily just want to filter mail upon receipt. For instance, I'd like to be able to run aging filters, to archive or trash messages past a certain age that match certain criteria. Or to send mail to myself saying, e.g., "You have mail in your personal inbox from Charlie that's two weeks old. You should answer that and refile it." That said, I'm not really expecting to find my pony, and am looking at sieve docs right now....
But at this point, even though I have really excellent spam filtering, my mail is getting unmanageable. Before I actually dig in to the procmail hairball, I'd like to know what, if any, alternatives I should look at.
I think my pony here would be a special purpose language (or better, a python module) with which I could write scripts that I would run either directly on maildirs on my imap server (i.e. I would run them as a local user on the sserver), or that would function essentially as a scriptable imap client.
My starting point for thinking about the features I want is mh: I've been using shell scripts and mh to filter my MIT mail for years; at minimum I want the features that gives me. Which is, in a nutshell, the ability to filter on the content of any header. I could live with less annoying syntax, though:
# punt any discussion involving tom lord on fsb
rmm `pick -lbrace -to fsb -or -cc fsb -rbrace -and \
-lbrace -from lord@emf.net -or -to lord@emf.net -or \
-cc lord@emf.net -rbrace `Leaving aside how inefficient that code is, I could totally do with being able to express that instead as: for item in inbox:
if item.to(fsb@crynwr.com) or item.cc(fsb@crynwr.com):
for user in ["lord@emf.net", ... ]:
if item.to(user) or item.cc(user) or item.from(user):
trash(item)
refile(item, fsb_folder)I'd also like to be able to alter messages. if item.from(my_fax_service):
# save a copy of the original just in case
copy(message, fax_archive_folder)
for element in item.body.parts:
if element.type != 'application/pdf':
delete(element)
refile(item, faxes)So, if anyone knows of a mail filtering system that would be closer to my pony than procmail, I'd love to hear about it.Edit: Added 2007-11-01 at 19:29
I forgot to mention one of the main reasons this is a pony: I should have made clear that part of the reason I'm thinking in terms of something I can run on the files in a maildir is that I don't necessarily just want to filter mail upon receipt. For instance, I'd like to be able to run aging filters, to archive or trash messages past a certain age that match certain criteria. Or to send mail to myself saying, e.g., "You have mail in your personal inbox from Charlie that's two weeks old. You should answer that and refile it." That said, I'm not really expecting to find my pony, and am looking at sieve docs right now....
no subject
Date: 2007-11-01 07:54 pm (UTC)Unfortunately it looks like the Sieve remove-attach I-D died, so that last example isn't doable.
no subject
Date: 2007-11-01 08:28 pm (UTC)MIT uses Cyrus, so if this is for your MIT mail you may be in luck. I'm not sure if they have a public interface for getting to sieve, though...
BTW, there are even user-friendly front-ends (sieveshell) for people who don't understand coding. This is useful for my home server as well.
no subject
Date: 2007-11-01 09:11 pm (UTC)I will observe that your second example is pretty much what procmail was born to do:
no subject
Date: 2007-11-02 06:13 pm (UTC)no subject
Date: 2007-11-02 07:47 am (UTC)no subject
Date: 2007-11-02 09:42 am (UTC)But I just wanted to say, when I got back home late on my birthday I found a parcel waiting for me.
What a lovely surprise! Thankyou very much... I am a huge fan of Frezzato (his artwork is utterly gorgeous.) And, I'm a huge fan of Spaced too. Dunno if you know much about the series, but it's cult British comedy, the sort of thing where if you were ever a student in a shared house in Britain you find yourself nodding away going "oh my god! That's me! And that's all my mates."
Arf! It is just utter class, I literally end up crying with laughter at it. (Used to watch it loads, but my ex took the dvd's when he left, but now I have my own copies - Raaah!)
No idea how it'd go down to a US audience, (apparently Fox are going to
destroyre-make it for the US.)no subject
Date: 2007-11-04 07:04 pm (UTC)no subject
Date: 2007-11-04 08:12 pm (UTC)I saw a documentary on the US remake of "Men Behaving Badly" a very popular UK sitcom of the 90's. The whole point of Men Behaving Badly was that the main protagonists were slobby, scruffy types with loutish brit-bloke beer-swilling mannerisms. Their house was dirty and scruffy, they wore food-stained clothes, they were not handsome, indeed, they were a bit ugly. In fact, perfectly recognisable young lads that fart and burp a lot.
The US version had them scrubbed up, carefully selected to be perfect, polished beauties, in smart clothes and aspirational smart house with none of the oafish (unattractive) mannerisms. What the foosh?
HORRIBLE HORRIBLE! Well, you've seen Rab C Nesbit, he's extreme but that's what brit comedy is all about... ugly, grotty people, being a bit rubbish. We love it!
There's a lot of american stuff on tv in the UK, stuff like "Friends" or OC Country, I dunno, I can't watch the stuff. It annoys me to death that everyone looks so polished and perfect, even shop workers look like they've just stepped out of a plastic surgery salon or summat.
Well, maybe I exaggerate a little. I can't really talk, I've never managed to watch longer than 5 minutes of "Friends" before having to walk out in disgust and puke (if trapped in someone elses house - in my own home 10 seconds is all I can stand before diving for the remote control.)
Ooops! Small rant unleashed there!
no subject
Date: 2007-11-05 04:49 am (UTC)Hollywood is a fantasy land in more ways than one, including being an object of fantasy for many Americans. Attractive kids all over the country hear from a very young age you could make it big in Hollywood. Most of them couldn't, of course, but a lot try. Which from all I've heard (I've never been there) means that even menial jobs there tend to be filled by well-dressed, good looking people. I remember seeing a comedian once, a short Jewish guy from New York, playing on that as part of his schtick. He was talking about the first time he went to L.A. For like ten years before Star Wars, Harrison Ford was working as a carpenter in Hollywood. Think about living in a town where the guy who fixes your porch stairs looks like Harrison Ford. I suspect most of the people responsible for what goes on the tube haven't spent three days in a row around normal looking people since their teens.