procmail
[Top] [All Lists]

Re: maintaining list

1998-02-22 06:25:08
Ok. Well this is what I figured out on my own:

:0c Wh:
| formail -xFrom: >> .procadd


now can I add the following to that recipe:

cat -u .procadd > .procsort

so to have:

:0c Wh:
| formail -xFrom: >> .procadd
| cat -u .procadd > .procsort

This will I think save all the From lines to .procadd and then remove all
the duplicate entries. Can I just keep listing commands there like that?
Like:

| tr '[A-Z]' '[a-z]' < .procsort > .procaddresses

To change it all to lowercase? How can I do that in one recipe?


Marcus Holmes                           mholmes(_at_)world(_dot_)std(_dot_)com  
                
Software Tool & Die                     http://www.nitrogen.org 




On Sat, 21 Feb 1998, David Hunt wrote:

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>