Imap-backup: Backup Gmail or other IMAP accounts to disk
github.com
github.com
It's not that clear from the website but you should find imapsync in your distribution's package repo if you want to try it before supporting the author. I don't doubt the "no questions asked" refund policy, but I'm done fighting for my money back after bad experiences in the app stores.
It comes with the author's custom "no limits" licence (looks a lot like the WTFPL), so it probably qualifies as free & open source, but you don't get a support contract of course.
The author's site also has a "give me your IMAP credentials and I'll migrate your mailbox for you, free up to a size limit" service, https://imapsync.lamiral.info/X/ , which boggles the mind. On principle I couldn't trust it.
Thunderbird doesn't prompt for this while connecting like a web browser does. It fails to connect without a clear warning in this case.
Full shameful disclosure: Since my backup is only locally accessible on a trusted network I used insecure IMAP on port 143
[1]: https://serverfault.com/questions/532172/thunderbird-not-tru...
https://github.com/terhechte/postsack
It parses 500k mails in < 1 Minute, so it is quite fast. There's a web / wasm build of the UI here: https://terhech.de/web_demo/
I'm confused -- Mbox files can indeed be viewed offline.
(Not to say your point about the ease of automating Takeout is not valid.)
Well this is what just a normal email client does - it downloads latest emails via IMAP.
That's why imap-backup is useful.
Lol that’s an email client! Not all email clients have a manual UI.
But the crucial question is, can you use it after your account was automatically blocked? That's when I would acutally have an urgent need for it.
If you do this every year (I do it on Jan 1st as part of some other yearly reminders) then at most you lose 2 months of data (certainly not downplaying the gravity of that but it's better than everything).
If you make the tools transparent I think he won't notice, or even notice how fast it is to search everything locally.
My solution, though may not be the best, is to use Thunderbird and let it save a local copy, and not to delete from IMAP. I did a Google Take out of over 7GB of my primary email account, converted to MBOX, and dumb that in the local folder. Now, I have a searchable archive of my emails from 2005 onwards (I have lost everything before that).
That is the general gist, thought the overall setup is a bit winded and involved multiple IDs, etc.
It uses Google's API to fetch and send e-mails, and is quite performant.
But most interesting, if you don't want to backup to disk but say, migrate to a new IMAP server: https://imapsync.lamiral.info/
For anyone interested, or has suggestions on how to improve my general backup process (DBs, pfsense router config dumps, bitwarden passwords etc), here is the general process I use:
- Run a backup container as part of the docker-compose file as part of the service definition
- This container will always run, and start a cron service
- The cron is run from an env var set to the cron schedule syntax
- The cron runs an entrypoint script that calls a mounted mounted script in a consistent location (/cron/run.sh)
- The script will do some basic integrity checking, like making sure the file containers some data, is over 1MB and a few other things. This could be greatly improved. In the future for databases, I want to actually restore it to a database in a container and query it for data
- Zip, compress and place the data on a cloud service like S3
- On completion, the entrypoint script calls healthchecks.io to inform that a ran was done. I will get an alert if this task does not run in a set amount of time. The healthchecks.io alerts are created with the terraform provider, but I would love a way to integrate this with my current setup
In the future, I should really be doing some kind of integrity checking of these files once on the cloud.I used Duplicati for a long time, but I had a disk failure on my home server recently and when I went to restore from a Duplicati backup on S3, it was corrupted. I should have had alerts set up for this, but I have now sworn off any solution that I don't fully understand whats happening with.
It works better because it can copy rules, labels, stars, etc.
I'm not exactly sure if you can migrate to a new provider by providing the mailbox yourself, but you can still use things like notmuch to index and search on the mbox.
I run my business emails on Google Workspace because the price is right, but I've spent a fair amount of time considering a move due to their invasive scanning etc.
Edit: or https://github.com/djipko/gbackup-rs/ which was a more recent bookmark
And any ideas how to search through it once you have the data on your home computer?
On my SSD ripgrep takes about 5 seconds in cold start to search over all of it, then less than a second after that (presumably because drive caches have populated). It may be enough if you only search mail infrequently, otherwise perhaps Recoll [0] indexer might help, I believe it can handle .mbox files (so each message would be indexed as a separate document)
[0] https://www.lesbonscomptes.com/recoll/pages/features.html
https://github.com/terhechte/postsack
It parses my 13gb Gmail backup in under a minute.
I do that once every minute using Cron, and it has been serving me quite well.
I don't usually open up my archive folder, when I do it takes quite a lot of time to open on neomutt at least. Notmuch works really well after indexing though.
One suggestion - make it clearer that the backup format is not proprietary and can be consumed by other software. I assume that you're using a standard mbox format...
Presumably their storage will be more durable than yours. I saw one person mention using it to help migrate to another system.
What other reasons do you have?
Freeing up space in the 'online' store by copying everything with attachments over 6 years old to your machine and deleting it.
keeping a copy for offline access
keeping a copy incase the provider blocks your account for some reason.
Modifying stuff in some way the UI won't let you do (for example modifying emails in the inbox)
Backup storage doesn't necessarily need to be more durable than the thing it's backing up, as long as it has different failure causes. (also, "my storage" or a replica of it could easily be rented from a different cloud provider, but generally, if a single event impacts my home storage and my email provider at the same time, I likely have other worries)
> What other reasons do you have?
Companies temporarily or permanently suspend users for a long list of reasons, often without warning. Companies are not safe from bugs or outages. Accounts can get hacked even if you're careful. E-Mail is extremely important and at the same time usually a small amount of data, so easy to back up.
It is like $5 per User.
* Except for pre-defined ones.