Mail-in-a-Box already has backup functionality, but I’ve been playing around with an alternative, complementary approach. Essentially backups solve two separate problems: 1) creating reliability through redundancy, and 2) keeping a history of changes. I’m tackling the first problem — creating redundancy.
What I want is an easy-to-set-up Dovecot IMAP instance that can host a local copy of all the mail that exists on my account on Mail-in-a-Box. If my server dies (or I lose internet), I can still access all my mail through the local IMAP instance. Thunderbird etc. can provide this with the right caching settings, but I don’t want a cache — I want a full copy, so that if I need to completely re-build my Mail-in-a-Box server, I can painlessly restore all my local mail to the freshly-built server and have everything back in minutes. And I can always be confident that the mirrored backup is working (important!) because I’m regularly accessing my mail via the local instance.
It’s just a proof of concept, but I’ve got some scripts to accomplish this in my standalone-dovecot-imap repo. It works pretty simply: sdimap init
creates a new IMAP instance in the current directory. Run sdsync mirror youruser@yourdomain.com yourserver.yourdomain.com
to copy all the mail from the server down to the local instance.
Ultimately what I really want is to keep only the last N days (90, 180, whatever) of email on my Mail-in-a-Box server. All the rest — the years of archived email — would be safely stored inside an encrypted volume on my home PC, The sdsync
script would automatically pull down the latest mail (moving mail around locally if I happened to re-file it on the server) and automatically delete old mail from the server (after it reached a certain age). That way I get the benefits of having my email in the cloud, but without the risk of someone breaking into the server and having access to years of email archives.
Apologies in advance for the meandering post. I thought maybe there’d be a few others who are also interested in a set up like this.