Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does anybody have a good recommendation for an automated Gmail backup? I am happy using Gmail for now, I just want my own copy of all of my emails that I can search and read - offline if necessary.

I tried to use Nextcloud's email app to backup my gmail, but after sending it up I realized that it is just an alternate interface to access email on Google's server, not a proper backup solution. (It only supports IMAP, not POP3.)

If I can't find a better solution, I may just set up Thunderbird and put it and POP3 mode, but I'd really prefer something that could sit on a server and run automatically without me having to touch it.

(For what it's worth, I ended up keeping my Nextcloud server set up because I found that I really like the notes app. I also have it doing a daily backup of my contacts from my phone and it's replaced Dropbox for small file storage. I already had my photos backing up to a Plex instance on the same server, or else I would probably be using the photo backup feature as well. )




I recommend using isync (aka mbsync) https://isync.sourceforge.io/ to download an offline, IMAP-style copy of your email; it seems to be faster than offlineimap http://www.offlineimap.org/ which does the same thing. Many people have it run on a simple cron job. You can then use Thunderbird etc. on your full local copy of the mailbox.


Thank you, I'll try that out!


https://github.com/jay0lee/got-your-back Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.


Cool, I'll check it out. Thanks!


Getmail is probably your best bet for an automated email backup - that will fetch your email over IMAP (getmail-gmail-xoauth-tokens can use oauth to connect to IMAP) and store it as a maildir or mbox. You can then use that with whatever client or search system you like.

You could then use this maildir as the backend for a dovecot IMAP server and use any webmail client of your choosing to connect to this and search it etc.

I'd avoid POP3 - very old protocol and it removes your mail from the server (is this your goal?). You're definitely better using IMAP. Even if you want to delete mail from the server, you're probably safer to fetch it by IMAP, then delete it.


Thanks! That sounds like about what I'm looking for!

And, yea, I'm not so concerned about which protocol to use or deleting the email from Google's server, I just want my own local copy of it.


If you use a local mail client, you could drag all your gmail folders to the local folder area. Most clients will then copy all the emails to a local destination. Then you could have a rule that copies all incoming mail into the local folder, catching any future mails.


In don’t use Gmail but I use offlineimap which would do what you want. You can then use the files with thunderbird as a regular mailbox but off your local copy instead of gmail’s.

I have it run with a systemd timer at regular intervals and it’s backed up with borgmatic at regular intervals using another systemd timer.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: