Replacing procmail with maildrop

Conrad J. Sabatier conrads at cox.net
Mon Sep 26 07:44:20 UTC 2011


On Sun, 25 Sep 2011 22:01:13 -0600 (MDT)
Warren Block <wblock at wonkity.com> wrote:

> Recent discussion here about the desirability of replacing procmail 
> finally convinced me to switch to maildrop.  It turned out to be 
> relatively painless.  I took some notes that may be helpful for
> others considering the change:
> 
> http://www.wonkity.com/~wblock/docs/html/maildrop.html

Thank you for that!  I've been reluctant to switch from procmail to
anything else just yet (although I know I'll have to do so eventually,
if this port is going to be expired), but these tips you've provided
certainly will help.

I'm just wondering, though, if you could offer any advice on how
to convert something like the following procmail recipe I use for my
FreeBSD mailing lists.

I like to store my FreeBSD lists each under a separate MH folder under
$MAILDIR/FreeBSD, so the following recipe strips off everything
outside the angle brackets in the List-Id header (including the
brackets themselves, of course), and then the trailing ".freebsd.org"
and leading "freebsd-" and from the actual list name, to derive the
correct folder name.

So, for instance. the list name "freebsd-ports.freebsd.org" winds up as
the folder name "ports".

One problem is, without procmail's "formail" utility, how to
extract and strip the List-Id header.  Does maildrop include a tool
similar to formail?  Also, can one define a custom "to" command, in
order to use the nmh "rcvstore" command?

I've included only the parts of my .procmailrc needed to provide a
clear picture of what's going on:

# Path to executables from the nmh package
NMH_PATH=/usr/local/libexec/nmh

# Make sure everything we need is here
PATH=/bin:/usr/bin:/usr/local/bin:${NMH_PATH}

# Probably not necessary, but doesn't hurt either
MAILDIR=${HOME}/Mail
SHELL=/bin/sh

# the nmh command to store mail into a folder
STORE=rcvstore

# extension to use for lockfiles
LOCKEXT=.lock

# recipe for FreeBSD lists
:0
* ^List-Id:.*freebsd.org
{
        ListId=`formail -c -x List-Id: | \
                sed -e 's/^.*<//' -e 's/>.*$//' \
                        -e 's/\.freebsd\.org//' \
                        -e 's/^freebsd-//'`

        :0:FreeBSD$LOCKEXT
        | $STORE +FreeBSD/${ListId}
}

Thanks in advance for any help!

-- 
Conrad J. Sabatier
conrads at cox.net


More information about the freebsd-ports mailing list