Hi there, was working on some code for a spamassisin plugin. If any of the experienced coders are interested, come have look ... there are some RC specific things that I am not sure of.
 
http://roundcubeforum.net/forum/index.php?PHPSESSID=4367c793c11336f70c25c96d75143610&topic=2628.msg10473#msg10473    
 
Seansan