Mount a GMail account as Filesystem using gmailfs

Warning: my experience with gmailfs was not excellent! It was a bit slow and you always risk to lose data you stored on that account.


based on IMAP: http://sr71.net/projects/gmailfs/
(it used to be http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem.html but this was based on the Webinterface and that changed often)

gmailfs works with FUSE. So make sure Fuse is installed and works: http://wiki.ubuntuusers.de/fuse

Add user philipp to group fuse, install the python-fuse Ubuntu package and get the gmailfs code:

sudo usermod -aG fuse philipp
sudo aptitude install python-fuse
cd ~/Downloads
git clone git://git.sr71.net/gmailfs.git

you also need lgconstants.py from libgmail. See http://libgmail.cvs.sourceforge.net/viewvc/libgmail/libgmail/

cd ~/Downloads/gmailfs
wget http://libgmail.cvs.sourceforge.net/viewvc/*checkout*/libgmail/libgmail/lgconstants.py

set up the config file (get it here: http://sr71.net/projects/gmailfs/gmailfs.conf ) and put it in the folder /etc/gmailfs/ :

# this goes in /etc/gmailfs/gmailfs.conf
[connection]
# The proxy URL
#proxy = http://user:pass@proxyhost:port
# or just 
#proxy = http://proxyhost:port

# The number or retries for the proxy connection.
#retries = 3

[account]
username = gmailfsuser12322634@gmail.com
password = s33kr1t

[filesystem]
fsname = linux_fs_4

[references]
# reference = filesystem:username:password

[logs]
# Change this to DEBUG for verbose output (useful for debugging)
level = INFO

# if you'd like logs to go to stdout, comment out this variable.
# For logging to, say, stderr, use /dev/stderr of your system's
# equivalent for it
logfile = ~/.gmailfs.log

set up a folder to mount the filesystem:

cd
mkdir gmail-mnt

and run (to mount):

python ~/Downloads/gmailfs/gmailfs.py -o allow_root none ~/gmail-mnt

Comments