This is a really neat tool that one day you may find useful.
poptool.py is a python script that allows you to clean up your POP mailbox.
Usage is like this:
poptool.py -n -uUserName -Ppassword hostname --kill "subject.startswith('Obvious spam signature')"
The text after the --kill is Python code that is excuted to produce a boolean value whether or not to kill the mail in question. Note that you have full access to all the headers and can make the expression as complicated as you like.
n.b. -n means dry run...
Later:
One of our servers got disconected from the net over night and (wrongly) assumed that all the servers it was monitoring were down so sent a mail every few minutes, for every server that was "down", to the support address. As a result we each had 3000 mails in our mailbox when it started up again. I thought of cleaning them out with poptool but it failed with the following error:
poplib.error_proto: -ERR [AUTH] You must use stronger authentication such as AUTH or APOP to connect to this server
Aggghh the server uses APOP which the poptool doesn't seem to support.
Posted by stuartcw at August 21, 2003 08:08 PM