Delete emails from server Mac Mail
The only folders you can keep locally for IMAP are:


Drafts
Sent
Trash
Spam


If you want to empty other IMAP mailboxes, you will want to set up local folders on the Mac - use the built in help and search for "Create Mailbox" to get the steps to make a local folder so you can move all the messages there and then send a delete command to the IMAP server to actually remove them if they don't auto purge.