We've written a lot about IMAP and Apple Mail. We still maintain IMAP is a blessing and essential for any user with more than one computer. Yet Apple Mail still has surprises for us.
In particular, you never know what folder it's going to choose for sent mail. So it's very easy to end up with your sent mail and your spam mail scattered across three different folders on as many computers.
There is a craftily hidden command which will let you sort this out ver quickly.
Under the Mailbox menu there is menu item called Use This Mailbox For with the following submenu items:
Whenever you find you have duplicate sent boxes or confusing spam mailbox settings (possible variants I've seen: Junk, Spam, Spam Messages, spam, junk), just pick one and make it the blessed folder across all your computers, migrating existing data to the blessed folder on all computers.
Here's a graphic of the menu you are looking for:
Apple Mail: setting mailbox functions for IMAP
Again we do not recommend storing your Apple Mail drafts on the server at all as drafts can multiply like rabbits when you have two copies of Mail open on two different computers.