Steve Kemp's Blog Writings relating to Debian & Free Software

Replacing ugly things would save the world many hours

Wed, 5 Mar 2014 12:32:38 GMT

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.

| 11 comments.

 

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 (https://github.com/ndmitchell/shake) -- more powerful, much less annoying, and can even run many Makefiles (http://neilmitchell.blogspot.com/2014/01/running-makefiles-with-shake.html). With some work, Shake could replace make even in large projects with existing Makefiles!

[gravitar] 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.

[gravitar] 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 https://github.com/teythoon/afew

[gravitar] 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 :)

[gravitar] 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 http://www.exim.org/exim-html-current/doc/html/spec_html/filter.html for the spec.

 

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

Spiral Logo

Recent Posts

Recent Tags

Links

Search

Search prior entries:

RSS Feed

  • Subscribe to feed