For flexibility in terms of other spam filtering setups, perhaps the spam and notspam actions could be customised to one of "forward to an address", or "pipe to another process" which should return something like a 0 for success, or 1 for failure...
A possible setup is to simply cronjob a reaper that retrieves all the mails stored in the Junk folder and send those to dspam or spamassasin. That doesn't require any changes to the mailclient.
Wkr,