procmail
[Top] [All Lists]

Re: maintaining list

1998-02-21 14:01:19
On Sat, 21 Feb 1998, Marcus Holmes wrote:
Basically I just want to keep a neat list of all the people that have
emailed me, without duplicates obviously. 

This will grab a probable reply address into a variable:

        REPLY_ADDRESS=`formail -zrtxto`

And this will write it to a file, known as $ADDLOG for the illustration.

        :0chiw:
        * ! ? fgrep -isxe "$REPLY_ADDRESS" "$ADDLOG"
        | echo $REPLY_ADDRESS >>$ADDLOG

You may need to adjust the fgrep options if they aren't all in your
version of fgrep.

Or, if your happy with only the "From:" line's address, you can skip using
formail and the var REPLY_ADDRESS, and use the MATCH var instead. Note
that the whitespace in the first condition line is a tab followed by a
space in both occurences, ie. "[^tabspace<]" and "[^tabspace>]". 

        :0chiw:
        * ^From:(.*\<)?\/[^      <]+(_at_)[^     >]+
        * ! ? fgrep -isxe "$MATCH" "$ADDLOG"
        | echo $REPLY_ADDRESS >>$ADDLOG

David Hunt

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