Horcrux Email Backup lets you automatically backup your mails from any IMAP supported email accounts with great ease. The best part is, you have an option to restore the backup'ed emails to any other email account, retaining all your tags/folder hierarchy. Note: This is a background app, it resides on the Mac menu bar called "H". Click on that to get back to the preferences.
Updated on Sep 11 2022
Note: The downloadable demo is version 4.1.36; the version available for purchase on the Mac App Store is version 4.1.37.