How to extend an existing courier-imap server with an training option for the bayes filter of SpamAssassin. On moving a message to a special spam IMAP folder, the sa-learn program is called to feed the message into the bayes db.