GmailFS provides a mountable Linux filesystem which uses your Gmail account as its storage medium. GmailFS is a Python application and uses the FUSE userland filesystem infrastructure to help provide the filesystem, and libgmail to communicate with Gmail.
GmailFS supports most file operations such as read, write, open, close, stat, symlink, link, unlink, truncate and rename. This means that you can use all your favourite unix command line tools to operate on files stored on Gmail (e.g. cp, ls, mv, rm, ln, grep etc. etc.).
Here is an image for the proof-of-concept.
--------------------------------------------------------------------------
Installing GmailFS:
-----------------
1) Make sure you have Python 2.3 installed. Most Linux distributions will have their own package for this (you'll also need the appropriate python2.3-dev packages).
2) Install version 1.3 of FUSE. Some Linux distributions (such as
Debian) come with a package. If your distro doesn't, you can find the source at
FUSE's SourceForge download page.
3) Download the
Python FUSE bindings. These are also available from
FUSE's CVS page - but if you grab CVS, remember that the Python bindings don't work with the rest of CVS at the moment (as at 2004-08-26); you still need to use FUSE 1.3. Untar fuse-python.tar.gz and follow the instructions in fuse-python/INSTALL.
4) Download
libgmail. After untarring, copy libgmail.py and constants.py to somewhere Python can find them (/usr/local/lib/python2.3/site-packages/ works for Debian, others may vary).
5) Download
gmailfs.tar.gz. After untarring, copy gmailfs.py to somewhere easily accessible (for example, /usr/local/bin/gmailfs.py).
-- Copy mount.gmailfs to /sbin/mount.gmailfs. This is a modified version of mount.fuse distributed with FUSE 1.3.
--------------------------------------------------------------------------
Using GmailFS
-------------
You can mount your Gmail filesystem either via fstab or on the command line using mount.
To use fstab, create an entry /etc/fstab that looks something like:
/usr/local/bin/gmailfs.py /path/of/mount/point gmailfs noauto,username=gmailuser, password=gmailpass, fsname=zOlRRa
Note: If you cut and paste this entry remember to remove the spaces after the commas
The username and password fields speak for themselves. The fsname is the name of this Gmail filesystem. It is important to choose a hard-to-guess name here - because if others can guess the fsname, they can corrupt your Gmail filesystem by injecting spurious messages into your Inbox.
To mount from the command line, do:
mount -t gmailfs /usr/local/bin/gmailfs.py /path/of/mount/point -o username=gmailuser, password=gmailpass, fsname=zOlRRa
Note: If you cut and paste this entry remember to remove the spaces after the commas
Warning: both of these methods have serious security issues. If you run a multi-user system, others can easily see your Gmail username and password. If this is a problem for you then you will need to modify gmailfs.py , changing DefaultUsername,DefaultPassword and DefaultFsname as appropriate. A future version of GmailFS will load these values from config files in the user's home directory.
GmailFS also has a blocksize option. The default blocksize is 5MB. Files smaller than the minimum blocksize will only use the amount of space required to store the file, NOT the full blocksize. Note that any files created during a previous mount with a different blocksize will retain their original blocksize until deleted. For most applications you will make best use of your bandwidth by keeping the blocksize as large as possible.
When you delete files, GmailFS will place the files in the trash.
libgmail does not currently support purging items from the trash, so you will have to do this manually when logged into your Gmail account.
To avoid seeing the messages created for your Gmail filesystem you probably want to create a filter which automatically archives GmailFS messages as they come into your Inbox. The best approach is probably to search for the fsname value; it'll be in the subject of all GmailFS messages.