Here's a new version, it compiles (and appears to work) except the part in "copy_reclassified". Can anyone help me (probably only Timo knows how) with that? http://johannes.sipsolutions.net/edit/Projects/dovecot-dspam-integration/pseudo-code johannes