You could just do something like (untested)
Code:
:0:
* ^From: .*\.(yahoo|gmail).com$
EXCEPTIONAL_MAILBOX
but that would probably give you back most of your spam. Something like a whitelist might be better:
Code:
# this is not a procmail standard variable
WHITELIST=$HOME/.procmailwl
:0:
* ^From:.*\/[a-z0-9_.+-]+@[a-z0-9_.-]+
* ? fgrep -qix "$MATCH" $WHITELIST
EXCEPTIONAL_MAILBOX
Just put the addesses of the people you want mail from in the whitelist, one per line or write a little script to process your mailboxes to generate the whitelist.
Some people plug in things like spamassasin to deal with spam explicitly, though.