From Eric Mandel:

Go to your top MAIL (or Mail) directory, then say:

find . -exec egrep From: {} \; | awk '{print $NF}' | sed 's/[<>]//g' | egrep '@' | sort -u | awk '{print "whitelist_from", $0}'

and capture it in your ~/.spamassasin/user_prefs file

This is the first one I got, and I used it, and it worked!

Two others I got but have not tried:

From Guenter Eichorn: A perl script,

From Ben Maughan:

Not sure if this is exactly what you want, but running

cat ~/.addressbook | perl -e 'foreach (<>){chomp; my @a=split /\s+|,/, $_; foreach my $f (@a){next unless $f=~/\@/; $f=~s/\<|\>|\(|\)//g; print "$f\n";}}' | uniq | awk '{printf "whitelist_from %s\n",$1}'

and appending the output to your spam.prefs file will whitelist everyone in your addressbook. I use pine not exmh so don't know if the addressbook set-up is the same.

Cheers, Ben