The Getmail-Maildrop Experience

I can understand why nobody commented on the monitor question (I've now got a KVM by the way), but I was most disappointed to only recieve feedback from two people for my request for book suggestions, both saying they don't use books. If anyone else has any ideas, please leave a comment.

Anyway, on to the e-mail. Until this week, I have been using fetchmail to download my e-mails, and then feed them in to Exim. It all worked quite well, although the cpu usage had a constant average of around 10%, and this week, fetchmail started terminating itself when things got busy, ie every few minutes.

So, I replaced fetchmail with getmail (thank you Andrew) - much better. Rather than delivering to an MTA, it delivers to a MDA; no SMTP madness, it just pipes the e-mail into a new process. For my MDA, I nearly went with Postfix, but in the end chose maildrop because the internet told me to.

Maildrop filters use regular expressions, so my 200+ rule whitelist was going to look very messy. I therefore wrote a small wrapper script that pulls all the rules from a nice simple text file, creates a filter file, tests it, and if all is well it swaps it for the live one. At some point I'll put on a web front end, and I'll be well away.

The internet seems to be missing one key fact about maildrop - how to test the syntax of the filter file, without trying to deliver mail. Simple answer:

maildrop .mailfilter.tmp < /dev/null

where .mailfilter.tmp is the filter you want to test. If there is an error, there will be output on STDERR.

I'm still not convinced by the getmail/maildrop combination; getmail is run from a cron job rather than a daemon, and maildrop is run once for every e-mail. That's going to be over 26,000 program loads a day, which seems a bit unnecessary when a daemon could run once, so I might look at writing an integrated solution at some point. Not just yet though - this seems to be working very well, and cpu usage is at a steady 0%! Sounds good enough to me.

I have been making copious amounts of notes on linux for the past few years, and at some point I will put up an bunch of hints, howtos and support scripts. But that will have to wait for some free time :)

Comments

Hurry up and add an RSS feed so I can stop having to remember to check your site!

Laura

Richard, your blog is almost as interesting as Simon's!

I'm convinced it will be better when I get categories in here - friends can see what I'm up to in life, tech friends can see what tech stuff I'm doing, and nobody will have to read my rambles about my work any more :)

Procmail isn't as good as maildrop! ;)

DavidH

And to think you once said something about linux being some unmentionable appendage of some unlikeable creature.

Leave a comment