Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Sep 2011 04:16:01 -0500
From:      "Matthew D. Fuller" <fullermd@over-yonder.net>
To:        "Conrad J. Sabatier" <conrads@cox.net>
Cc:        Warren Block <wblock@wonkity.com>, ports@freebsd.org
Subject:   Re: Replacing procmail with maildrop
Message-ID:  <20110926091601.GM14862@over-yonder.net>
In-Reply-To: <20110926040731.52dc8bc2@cox.net>
References:  <alpine.BSF.2.00.1109251513240.63569@wonkity.com> <20110926024350.4e881c1b@cox.net> <20110926084516.GL14862@over-yonder.net> <20110926040731.52dc8bc2@cox.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110926091601.GM14862>