Thursday, June 14, 2007

Search spam in imap folders

I've made an script to search a folder called Spam and learn all emails as spam mails or if the folder is called Ham, then all emails are learned as not-spam.

This two scripts, called search-ham and search-spam are made to work with Vpopmail, Courier-Imap and Spamassassin. To use it, you only need to edit the script amb modify the variables "dominio" to configure the vpopmail domain to search in, "spamdir" to configure the name of the folder where the users are storing the spam or not-spam emails and "ruta", the folder where the vpopmail domain is. And then, you only needs to execute the script or configure a crontab to run periodically.

The script called search-ham is for email classified as not spam and search-spam for email classified as spam. The scripts uses the command sa-learn from Spamassassin to learn spam o ham emails.

The scripts are made with Python. Download here.

0 comments: