I installed the plugin movespam, which itself should move messages marked as spam to the Spam folder.
plugins/movespam/config.inc.php
// If this string is at the beginning of the subject, the message will be moved to the junk folder.
$rcmail_config['movespam_subject'] = '[*****SPAM*****]';
// True to move all spam. False to move only new (unread) spam.
$rcmail_config['movespam_seen'] = true;
plugins/movespam/movespam.php
class movespam extends rcube_plugin
{
public $task = 'mail';
private $open_mbox = 'INBOX';
private $spam_mbox = 'JUNK';
private $spam_text = '[*****SPAM*****]';
private $move_seen = true;
... {code} ....
}