Replacing ugly things would save the world many hours

Wednesday, 5 March 2014

There are some tools that we use daily, whether we realize it or not, that are unduly ugly. Over time you learn to use them and you forget just how hard they are to learn, and you take it for granted.

Today I had to guide somebody through using procmail, and I'd forgotten how annoying it is.

In brief I use procmail in three ways, each of which I had to document:

  • Run a command, given a new email, and replace the original email with the output of that command.
  • Run a command, silently. Just for fun.
  • Match a regular expression on a header-field, and file accordingly.
    • Later extended to matching regexps on multiple headers. ("AND" + "OR" )

There are some projects that are too entrenched to ever be replaced ("make", I'm looking at you), but procmail? I reckon there's a chance a replacement would be useful, quickly.

Then again, maybe I'm biased.



Comments On This Entry

[gravitar] smcv

Submitted at 21:11:41 on 4 march 2014

The post right below yours on Planet Debian () describes a setup including delivery through Dovecot's LDA, which reads Sieve filters. I use something similar myself, but with Postfix instead of Exim - Sieve is basically "procmail, but sane".

[gravitar] Tom Murphy

Submitted at 22:56:00 on 4 march 2014

"make" may be a lot less irreplaceable than you think!

Take a look at Shake ( -- more powerful, much less annoying, and can even run many Makefiles ( With some work, Shake could replace make even in large projects with existing Makefiles!

[author] Steve Kemp

Submitted at 23:16:47 on 4 march 2014

[gravitar] cstamas

Submitted at 06:49:39 on 5 march 2014

Courier's MDA is also a good alternative to procmail (which is horrible in many ways).

I also agree that Dovecot is the best in this regard.

[author] Steve Kemp

Submitted at 07:35:56 on 5 march 2014

Although I do have dovecot setup for remote IMAP access you might remember that my email client doesn't support IMAP...

[gravitar] foobar

Submitted at 08:04:40 on 5 march 2014

Take a look at

[author] Steve Kemp

Submitted at 08:06:24 on 5 march 2014

Thanks for the link.

My own notes are here:

[gravitar] Peter Pentchev

Submitted at 15:59:39 on 5 march 2014

I assume that you are already aware of maildrop? Well, it is an improvement over procmail, at least in terms of syntax and reliability. It sounds as though you're thinking of a replacement in broader terms, but still it might be worth it to take a look at maildrop, see if you can't switch to it with some (even if minor) immediate benefits, and then again consider the broader picture :)

[author] Steve Kemp

Submitted at 16:03:54 on 5 march 2014

Thanks for the pointer to maildrop - at the moment I'm investigating it, along with:

I do like the idea of Lua, but if I have to "program" in Perl, Python, or similar, then that isn't the end of the world.

[gravitar] -dsr-

Submitted at 20:19:39 on 6 march 2014

I came here to say good things about maildrop, but I see someone has already. Instead, I'll point out that I used to futz around with Mail::Audit (and prior to that, procmail) and just about everything is less aggravating to do in maildrop.

I am implementing sieve for people at work, but the kind of people who could write their own sieve recipes are the kind of people I won't mind allowing to ssh in to the mail server and edit their maildrop recipes.

[gravitar] Wouter Verhelst

Submitted at 09:32:17 on 7 march 2014

The only reason you should still be using procmail today is "I'm too lazy to replace it". There are several alternatives:

- maildrop
- Sieve (which is actually an RFC-defined protocol, not a file format, and is supported by many IMAP-speaking MUAs)
- My personal favourite: if you use exim as MTA, you can use exim filter files. See for the spec.


Comments are closed on posts which are more than ten days old.

Recent Posts

Recent Tags