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 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.
To backup IMAP emails to other file formats, webmail apps, you can utilize the smart IMAP Backup tool that can simply backup IMAP files to other file formats, webmail apps. It is simple to access for everyone. The tool supports multiple IMAP accounts at once. Using the tool, you can export IMAP data to PST, PDF, MBOX, IMAP Server, EML, EMLx, Gmail, Office 365, Exchange Server, Outlook.com, Yahoo Mail, etc. https://www.cubexsoft.com/blog/import-imap-into-office-365/