To use the scripts, use a Mail rule or have cron run the runfilter script. This will generate a list of your current spam message-ids and run mpop. mpop will then use the filter script to see if messages on the server match your spam message listing (using message-id), and delete them if they do.
The scripts assume mpop is installed in /usr/local/bin/, that the 'filter' script is in ~/Documents » Scripts » filter, and that spam email will be found in ~/Library » Mail » Mailboxes » Spam.mbox » Messages. However, you can change these paths in the first script if you wish.
[robg adds: I haven't tested this one.]

