You can easily backup your entire mailbox using this tool. Simply follow the given steps:
Download and Run the IMAP Email Backup Tool
Add your IMAP account to the software. Preview your data files in different modes
Apply the data filters and export in your desired format