procmail recipe

George Georgalis george at galis.org
Sun Mar 6 12:17:10 PST 2005


I've tried working out a procmail recipe, but this one is tough. I think
it requires a separate program to do the second check but I'd like to
figure a way to do it on a (procmail) command line. Either way someone
what to give a shot?

Plan: deliver list postings from specific addresses to a special
maildir, and also deliver any list postings that are replies to those
address to the special maildir.

Catching posts from the addresses (and building the msgid database) is
not so hard (per the duplicate example in man procmailex), but capturing
the messages with references or in-reply-to headers that have a match in
the special.cache is going to require a specialized program, I think.

My (non-working) attempts are commented below:

:0 Whc:special.lock
* ^From:.*(user31 at xxxxxxxxxx|user2 at xxxxxxxxxx|user1 at xxxxxxxxxx)
|formail -D 8192 special.cache
:0 aWhc:special.lock
|formail -D 8192 special.cache
:0 a
* ^Sender:.*dragonflybsd.org
|safecat special special/new
#:0
#* ^Sender:.*dragonflybsd.org
#|formail -zcx references |sed -e '$!N;s/\n/ /' -e 's/ /|/g' -e 's/[<>]//g' -e 's/@/\\@/g' | grep -qe   "`sed -e 's/</|/g' -e 's/>//g' -e 's/<//g' -e 's/@/\\@/g' -e 's/^|//'`" special.cache
#|formail -zcx references |sed -e 's/ /\n/g' -e 's/@/\\@/g' | while read m ; do grep -e $m special.cache ; done


Any ideas?

Oh, BTW, I use that safecat invocation so my maildirs can be sorted
in the order they had mail delivered, otherwise it's functionally
equivalent to a procmail "maildir/" delivery.

// George


-- 
George Georgalis, systems architect, administrator Linux BSD IXOYE
http://galis.org/george/ cell:646-331-2027 mailto:george at xxxxxxxxx





More information about the Users mailing list