procmail
[Top] [All Lists]

Re: Another question

1997-12-06 16:31:36
On Sat, 6 Dec 1997, era eriksson wrote:

On Fri, 5 Dec 1997 16:34:48 -0500 (EST), Bishop & Bebe 
<beck(_at_)tiac(_dot_)net>
wrote:
 >    REMOVE = `formail -rzx "From:"`
                               ^^^^^^^
You specifically want "To:" here. The FAQ explains why. 
<http://www.iki.fi/~era/procmail/mini-faq.html>

 >    :0 c
 >    | (sed -n /$REMOVE/d .address > $HOME/temp_file \
 >    mv tempfile .address) ;\

What's the final semicolon and backslash for? You need a semicolon
near the end of the +first+ line though -- the function of the
backslash is to glue everything together on one happy long line,
yielding something like

    | ( sed -n /$REMOVE/d .address > $HOME/temp_file mv tempfile .address) ;

You might also find that doing this with either a perl of sh script will
work more reliably.  I've found that on Netcom's semi-screwed up mail
system it is best to do such things in scripts.  It also makes testing the
things a bit easier.  :-)

#!/bin/sh

# This also leaves temp_file around as a backup
mv .address $HOME/temp_file
grep -v $SAFEREMOVE $HOME/temp_file > .address

--
Smoking is one of the leading causes of statistics.
                -- Fletcher Knebel