Replacing procmail with maildrop

Matthew D. Fuller fullermd at over-yonder.net
Mon Sep 26 09:16:03 UTC 2011


On Mon, Sep 26, 2011 at 04:07:31AM -0500 I heard the voice of
Conrad J. Sabatier, and lo! it spake thus:
>
> OK, I'm starting to get a little better of an idea of what to do.
> My main concern so far has been the ability to nest a set of
> commands within a recipe the way procmail allows.

Well, it's C-like; you can put braces around the body of the if and
have however much you want inside there.


> I don't want to use the full list name as it appears in the List-Id
> header, but a simpler, pared down version of it.  This was fairly
> easy to do in procmail; I just have to work out the correct syntax
> for doing it with maildrop.

What I had there

> > if(/^List-ID: freebsd-([a-z]+).freebsd.org/)
> >     to FreeBSD/$MATCH1

should give you (mod bugs in my top-of-my-head'ing of course) the same
sorta result as your

>> :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}
>> }

in that it winds up in FreeBSD/[the stuff between "freebsd-" and
".freebsd.org"].  Except without forking off a bunch of external
programs, just to pull out a piece of a header   :p


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.


More information about the freebsd-ports mailing list