× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

IMAP Email Synchronization

johnstonjs_gmai
Aspirant

IMAP Email Synchronization

This post describes how to utilize Mailsync to maintain a copy of any IMAP email server you have access to on your ReadyNAS. It requires ssh access and apt-get to be installed.

Background: Clearly, I use GMail as my preferred method of electronic communication. A while back Google enabled IMAP access for GMail, which was a great development as POP is detestable. I'm also a pack-rat, and can't bear the thought of losing any of the important emails I have on Google's servers. While it's unlikely Google will stop offering GMail in the near future, you never know.

So I set about figuring out how to back up GMail to my ReadyNAS. Apple's Mail.app can do this, but I'd have to do it manually, and then back up my Mac. No thanks. Mailsync, available from the default Debian repositories, allows this to be done on the ReadyNAS periodically by cron.

HOWTO:

1. Ensure you have ssh access to your ReadyNAS and apt-get installed.
2. Login to your ReadyNAS.
3. Run su to become the superuser.
4. Ensure your Debian repositories are up to date - apt-get update.
5. Install Mailsync - apt-get install mailsync.
6. Stop being the superuser - exit.
7. Configure Mailsync with the desired server information. To do this you need to create a file .mailsync in your users home folder ~/]. This file should contain something like:


store gmail {
server {imap.gmail.com/user=username@gmail.com/ssl/novalidate-cert}
ref {imap.gmail.com}
pat *
passwd your_password_here
}

store localdirectory {
pat .mail/%
prefix .mail/
}

channel default localdirectory gmail {
msinfo .mail_sync_info
}


Now when you execute mailsync -n default you will download all your messages from GMail (or whichever server you used) and they will be located in ~/.mail. It's working fairly well for me so far. To access the mbox you could install an email client like pine or mutt on your ReadyNAS, or install an IMAP server like uw-imapd to access them remotely.
Message 1 of 3
l8nite
Aspirant

Re: IMAP Email Synchronization

Just set this up tonight, it's chugging away. Thanks for the post!

How can I set this up to run automatically? (cron I guess?)
Message 2 of 3
Readyboi
Aspirant

Re: IMAP Email Synchronization

I'll second that question from l8nite about how to set this up as a cron
Message 3 of 3
Top Contributors
Discussion stats
  • 2 replies
  • 3601 views
  • 0 kudos
  • 3 in conversation
Announcements