procmail
[Top] [All Lists]

my whitelist strategy - feedback welcome

1998-05-27 17:53:57
Here's the whitelist strategy I'm using. All feedback is welcome.

First I filter my mailing list messages. Then any message from someone
listed in my whitelist gets put into my IN_whitelist folder using this
recipe:

 :0:
 * ? formail -rtzxTo: | fgrep -i -f $HOME/Procmail/whitelist
 IN_whitelist


I keep my whitelist updated by running the following script, which I
call makewhitelist, every time I log on:

--- begin makewhitelist ---
 cat $HOME/Msgs/AddressBook* \
  |fgrep "@" \
  |sed -e "s/^.*[^A-Za-z0-9_.+-]\([A-Za-z0-9_(_dot_)+-]*(_at_)\)/\1/" \
       -e "s/\(@[A-Za-z0-9_.+-]*\)[^A-Za-z0-9_.+-].*$/\1/" \
  |sort -fu \
           > $HOME/Procmail/whitelist.tmp
 
 cat $HOME/Msgs/Sent* \
  |egrep -i "^To: .*@|^Cc: .*@" \
  |sed -e "s/^.*[^A-Za-z0-9_.+-]\([A-Za-z0-9_(_dot_)+-]*(_at_)\)/\1/" \
       -e "s/\(@[A-Za-z0-9_.+-]*\)[^A-Za-z0-9_.+-].*$/\1/" \
  |sort -fu \
           >> $HOME/Procmail/whitelist.tmp
 
 sort -fu $HOME/Procmail/whitelist.tmp > $HOME/Procmail/whitelist
 
 rm $HOME/Procmail/whitelist.tmp
--- end makewhitelist ---

So what I'm doing is putting every email address that's in one of my
AddressBooks, or in a ^To or ^Cc line in one of my Sent mail folders,
into my whitelist. The cool thing about this is that my Sent mail
folders contain messages sent from all my accounts because I use an
IMAP mail client (pine) and have my sent folder set to this machine on
all my accounts.  Another cool thing is that with Pine 4 (which should
be released RSN), the AddressBook can be shared by all my accounts so
that will also be a centralized way to harvest my whitelist addresses.

I'm sure there are ways to make my script more efficient, especially
the sed part, so please let me know if you have ideas for improving
this strategy.

Thanks,
Nancy

-- 
Nancy McGough
Infinite Ink
http://www.ii.com


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