spamassassin learning from spam folder

Hi,

I want to optimize spamassassin and know that this is possible to run a sa-learn command with the option --spam through the spam folder. I know that spam mails are put there from spamassassin, but spamassassin does not recognize the spam mails which the user - which uses IMAP - has moved there.
Also the other way round this command with the --ham option should be used in the inbox, if the user moved some good mails from the spam folder to the inbox.

Any suggestions how I can do this with a script for all users on my server?

Best reagards,
Christian