Replacing procmail with maildrop
Conrad J. Sabatier
conrads at cox.net
Mon Sep 26 09:31:00 UTC 2011
On Mon, 26 Sep 2011 04:16:01 -0500
"Matthew D. Fuller" <fullermd at over-yonder.net> wrote:
> 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
Yes, I realized that just moments after my last reply. Somehow
that went right over my head at first. :-)
I like this already! Thanks again.
Conrad
--
Conrad J. Sabatier
conrads at cox.net
More information about the freebsd-ports
mailing list