If you want to migrate your IMAP emails to another email client and file format then I will highly recommend you try the
MacSonik IMAP Email Backup Tool for Mac. It saves all emails, including their attachments and metadata, to local storage. The software gives you an amazing feature of removing duplicate IMAP emails that helps you to eliminate duplicate mail items from the conversion process. Moreover, you can also download the free demo edition that allows migrating 50 emails from IMAP to Outlook free of cost.