User Tools

Site Tools


bloglike:2013-06

This is an old revision of the document!


Issue 2013 - July

Backing up Gmail

For whatever reasons I've decided to start backing up my gmail account. This is pretty straight forward even on Slackware.

  1. In Gmail, go to Settings → Forwarding and POP/IMAP and Enable IMAP
  2. Download OfflineIMAP and unpack it
  3. create ~/.offlineimaprc and ~/.netrc as shown below
  4. you're all set at this point
  5. to run OfflineIMAP from cron use -q quiet parameter

File ~/.offlineimaprc:

[general]
accounts = Gmail

[Account Gmail]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = Maildir
localfolders = PATH_WHERE_TO_BACKUP

[Repository Remote]
type = IMAP
ssl = yes
remotehost = imap.gmail.com
remoteuser = GMAIL_LOGIN
sslcacertfile = /etc/ssl/certs/ca-certificates.crt

File ~/.netrc if you don't want to enter password every time OfflineIMAP is run:

machine imap.gmail.com
login GMAIL_LOGIN
password SECRET_PASSWORD

File ~/.netrc is actually reason why I have written this article. I didn't like idea of having this file in my $HOME directory. In theory, every application executed under your UID can read this file. So I've created an extra user solely for purpose of backing up my Gmail account. I admit, this isn't a silver bullet. It's perhaps only a tiny bit more secure than before. And it still doesn't beat root user whom can read any file on the system. But no other applications, unless executed as a root, should be able to access these files.

Actually, I'd like to check whether SELinux, or its equivalent, could be used to restrict applications from accessing files like ~/.netrc despite application has proper UID to do so. But later.

bloglike/2013-06.1371296123.txt.gz · Last modified: 2013/06/15 06:35 by stybla