Hacking Gmail

(Grace) #1

Chapter 16 — Using GmailFS 217


Replace the XXXXXwith a hard-to-guess string. This string, the name of the file
system, must be weird and difficult to guess, because (as you will see) people can
corrupt the system by sending you mail with that name in the subject line.

Mounting GmailFS from fstab


Linux machines have a file called /etc/fstab, which contains the details of all of
the drives and partitions the system can see. You can add GmailFS to the fstab
file to make the drive a permanent addition to your system.

To use fstab, place an entry inside /etc/fstabthat looks like this:

/usr/local/bin/gmailfs.py /gmailfs gmailfs noauto,
fsname=XXXXX

Again, replace the XXXXXwith the name you wish to give the file system. You will
probably need root access to add things to the fstabfile. Once the line has been
added, reboot the machine.

Passing Commands to the File System


With the commands passed in the previous section, you now have a file system
mounted at /gmailfs. So, from the command line you can use cd /gmailfs
and then use any of the normal shell commands:ls,mkdir,rm, and so on. For
all intents and purposes, the GmailFS is just the same as if it were a 1 gigabyte
hard disk.

Copying files to and from a GmailFS directory is pretty quick, depending of
course on the speed of your Internet connection, but running lsto get a directory
listing takes a very long time if you have lots of mail. To understand why, take a
look at how GmailFS works.

Using Multiple GmailFS Drives

Because you are giving the GmailFS system a specific, hard-to-guess name, denoted in the com-
mand line by the fsname=parameter, you are actually able to run more than one file system
from the same Gmail account. You can mount as many as you like, as long as each one has a
different name.

Free download pdf