Dovecot-antispam watches designated spam folders and trains mail as spam or not-spam when it moves in or out of those folders respectively.
dovecot-antispam supports dspam, crm114, and generic training by mailing spam and non-spam to training addresses. For crm114, it supports folders for the additional "unsure" classification, and trains when moving from there to spam or normal folders.