procmail
[Top] [All Lists]

Re: Duplicates sent from lists

2004-02-17 21:07:28
On Tue, 17 Feb 2004, LuKreme wrote:

    { ADDTOCACHE=`echo "$LISTNAME $LISTPOST" >> $LISTCACHE` }

I've often found it annoying that formail won't cache an arbitrary header
when using -D.  It'd be very nice to be able to say

* ? formail -xList-Post: -D 1024 listpost.cache

You can sort of hack it with:

* ? echo "Message-Id: `formail -xList-Post:`" | \
        formail -D 1024 listpost.cache

But that's three processes and plus a shell to do what one process could
have done if-only ... of course, you can extract List-Post with a MATCH
recipe to avoid one formail and the backticks, but still ...

Anyway, once you have listpost.cache, you can do something like this:

* ? formail -xTo: -xCc: | \
        fgrep --word-regexp --fixed-strings "$(strings listpost.cache)"

(I haven't actually tested that in an rc file, but you get the idea.)
Adjust the size of the cache to be sure of not overflowing argument size
limits when expanding $(strings ...).  Needs GNU fgrep, I suppose.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>