Error moving mail to junk folders

Unable to move to Junk folder because Mailbox ??? does not exist.

In Mail Preferences/Accounts check that Junk mailboxes are properly defined.