On Wed, 28 May 1997, Barry wrote:
I had another idea as an additional safety that I really liked. I wanted
to check the from: line on all the incoming mail against all the addresses
in my pine .addressbook. I hacked out a quick C++ program that does just
that. The program recieves the from line as the MAILFROM environmental
variable, parses the .addressbook file, exits with a -1 if there is no
match, or returns 0 if there is a match. Here is what I put in my rc file
:0 cfw
{MAILFROM='formail -x From:' | doIknowyou}
:0 afw
| formail -a "X-I-Know-This-Person: Yes"
For those who don't want to write C++ programs, it could be done like:
cat .addressbook | awk '{ printf("%s\n", $NF)}' | sort >.procmail/friends
This extracts the email addresses from PINE's .addressbook. The awk
script could be run from a cron.daily job or manually or whatever, then
the procmail recipce could look like:
:0:
* ? fgrep -f $HOME/.procmail/friends
$DEFAULT
or:
:0
* ? echo "`formail -rtxz'To:'`" | egrep -i -f $HOME/.procmail/friends
$DEFAULT
PS: I'm not saying this is better or more efficient than Barry's
solution. It is just an alternative which I have tried and which works
for me and it doesn't require C/C++ programming.
--
Friedemann Baitinger baiti(_at_)herrenberg(_dot_)netsurf(_dot_)de