Updated May 2025 (checked all links)
Originally posted the answer when the question was 'just' 7 years old, it is now ~10 years old. At the time, I was looking for a solution to migrate off of Google Workspaces as they were about to charge their free legacy users.
This question had a few answered, most were spot on. But I felt at least one was missing, and there was probably room for more. So below is the original list, refreshed as of Oct 2024.
NOTE: Most of the answers are not necessarily backup/restore, as my personal focus was syncing two IMAP accounts. I'll add a [sync only] note next to projects I know are sync-only options without a download solution. Keep in mind, that spinning a local IMAP server - shouldn't be complex, but I'm not covering in this post.
Timeline of answers:
Back in 2014 Mehmet mentioned imapsync[sync only]
This is probably still the most focused solution maintained out there, even now in 2024, as this is an active stream of revenue for the author, Gilles Lamiral. The source is available, currently the latest code is on GitHub
Although not available as a distro package (like some of the other options), it does have an official docker-hub hosted image at gilleslamiral/imapsync. For more info see: https://imapsync.lamiral.info/INSTALL.d/Dockerfile
A docker container image for the WebUI is available, it was last updated 2021 years ago, which matches the WebUI code changes in the GitHub repo. This was done by Lucas Silva, not by the original author.
Interestingly relevant to this question, Gilles Lamiral maintains a list of like-minded applications on his web-site. Check it out.
Back in 2017 Quarind mentioned imap-backup
This is a ruby based solution which is still being maintained.
Back in 2021 Patrick Decat mentioned OfflineIMAP
offlineimap3 is the "more" maintained, Python3-based fork of the original, Python2-based
offlineimap. Both have their last updated entry in the Changelog.md at 2021.
offlineimap3 is available in major distros.
According to this open Issue in offlineimap3, although a new release hasn't been issued for a few years, the project is still maintained and has some fairly recent PRs merged in. The thread also mentions a fork:
My searches led me to these additional options:
The packages below are available on Debian 11 (bullseye), but I don't know much about them:
- imapcopy
Unmaintained since ~2009 - interimap
Still actively maintained at developer's website - mailsync
On SourceForge - mswatch
repo. Requires something to do the actual syncing. - vdirsyncer
site. Companion to other IMAP synchronizers, for syncing Calendar and Contacts.
Specifically for Gmail / Google Workspace mailboxes*:
* Not an IMAP solution, but might be related to somebody's search, so I feel it's worth mentioning
I'll try and keep this list updated, as I see this still attracts interest from time to time. Personally, I had good experiences with Got Your Back and imapsync.