IMAP: Folder structure and Junk E-mail filter

In my IMAP account, the default mail folders like Inbox, Sent Items, Deleted Items, etc are subfolders of my Inbox folder.

I have been able to set the Sent Items and Deleted Items folders of my IMAP account so that they now work, but the Junk E-mail filter does not work.

Why are my folders all under the Inbox folder and how can I make the Junk E-mail folder work with my IMAP account?