This script learns spam/ham from Maildir IMAP directories through spamassasin and can be scheduled via cron.