Accessing GMail as a Filesystem on Mac OS X

THIS IS STILL INCOMPLETE

Hey all,

it’s quite a while since my last posting. Had a lot to do recently and was busy.

Initially this blog was about how to access your GMail account via a filesystem mount on your Mac OS X desktop. By doing so, you can access all your Mails in your GMail Inbox as files on a Volume on your Desktop. However, as I had some difficulties actually getting this to work, I extended it with information on SpotlightFS.

Why would you want to do that?

Because it’s fun and possible!

Ok, how do you do it then?

I use MacFUSE for this – you can find out about MacFUSE on this site. Excellent information on the standard gmailfs that we’ll use, can be found here.

Now, off to the installation process.

Download the following files:

By the way, I think you should propably try to follow the versions given and copy/unpack all sourcecode (that is libgmail, gmailfs, and fuse, the other three are Mac OS X Apps) to the /usr/local directory.

MacFUSE

Install the MacFUSE package. This is one of the few occassions where you need to restart your Mac – broke my 198 Day counter, but gave me the chance to also apply the latest security fixes and Apple updates. Anyway, the restart is of course necessary, as MacFUSE needs to interact with the MacOS X Kernel.

SpotlightFS

After the restart you should give Spotlight-FS a try. Place the Spotlight-FS App in your Utilities folder and double click on it. A new mountpoint, called SpotlightFS will be shown in you folder view and your desktop. If you open it, you will see a folder named Smarter Folder. Create a new folder with the contents of your Sptlight query. I choose Adobe Interactive Forms, because I want to get all docs and infos about Adobes Interactive Forms from my harddrive.

Adobe Interactive Forms

This is an exciting possibility to get easy barrier free access to the hundreds of informations all scattered around my home folder. You can find out more on this here.

Now let’s take a closer look on the other we downloaded, what twhere they about? ah, getting gmailfs to work on your Mac.

SSHFS

Next give the sshfs a run. This one is about accessing an ssh server as a filesystem server, maybe presented as a folder on your desktop.

You will of course need an ssh server, if you do not have one at hand, don’t worry, Mac OS X comes prepacked with one. Open the System Preferences Pane and click on Sharing. In the Sharing Dialog activate the Remote Login Service. This will enable the sshd and allow you to login via ssh to the IP address given.

Sharing Preferences

Next start up the sshfs application and log on to your own system.

SSHFS

Fuse

To get GMailFS working you need a pythin binding for Fuse, which, in turn, requires a patch from MacFUSE to compile on MacOS X. If you try to compile fuse straight away, you will get an error like during the make run.

Make error

These are the steps you need to do:

  1. Download the MacFUSE source from CVS repository
  2. Patch the Fuse source with
  3. Compile Fuse from the dowloaded directory

You should propably become root for this and you need the mac os x patch for your fuse package (2.6.3 if you followed this):


   su -
   cd /usr/local
   tar -xvf fuse-2.6.3
   svn checkout http://macfuse.googlecode.com/svn/trunk/ macfuse

In the fuse-2.6.3 source directory, patch and compile fuse:


   cd fuse-2.6.3
   patch -p1    sudo make install

This is the moment I got stuck the first time, the bl… fuse would not compile even though I patched the source with the Mac OS X patch.

GMailFS

Let’s next get the gmail-fs thing working. That’s what this is all about, ins’t it?

The needed libgmail is a python library so you need to install it via the command line – start the Terminal application from your utilities folder. In the command line window cd to the folder where you downloaded and unpacked the libgmail tarball:


   cd Desktop/libgmail-0.1.5.1
   python setup.py build
   sudo python setup.py install

Setup libgmail

Make sure the library was installed with the standard python framework – MacOS X can have different python versions and if you install it, say with the 2.3 python framework and later try to call it from the 2.4 framework, this fails. Strictly speaking you should use the python 2.3 or 2.4 framework and you should make sure that it is called with a simple python, like shown in the above picture.

Next, download the Python FUSE bindings from it’s CVS repository:


   cd Desktop
   cvs -d:pserver:anonymous@fuse.cvs.sourceforge.net:/cvsroot/fuse co -P python
   cd python
   

Now, after the libgmail is installed, copy the gmailfs-0.7.3 directory to your /usr/local directory.


   cd Desktop
   sudo cp -pr gmailfs-0.7.3 /usr/local
   cd /usr/local/gmailfs-0.7.3

Unfortunately this led to an error in my case, so lets dive into this abit deeper.


   python gmailfs.py
   Traceback (most recent call last):
     File "gmailfs.py", line 20, in ?
       from fuse import Fuse
   ImportError: No module named fuse

Advertisements
Explore posts in the same categories: Apple, Howto, Linux, Mac OS X

3 Comments on “Accessing GMail as a Filesystem on Mac OS X”

  1. Licenser Says:

    The problem you encounter is that, that you forgot to installthe fule bindings.
    You’ll have to do a:
    python setup.py build
    sudo python setup.py install
    in the python directlry you got via CVS. I encountered the problem that my pkg-config was not existing then.
    I use fink and did: fink install pkgconfig (without the – between pkg and conifg!) to get it then all I had to do was linking the config directlry of it:
    ln -s /usr/local/lib/pkgconfig/ /sw/lib/pkgconfig
    and copying the right .pc file from the fuse directory to there
    cp fuse-X/fuse.pc /usr/local/lib/pkgconfig/

    and tada it works!

  2. Idetrorce Says:

    very interesting, but I don’t agree with you
    Idetrorce


  3. […] and I wondered if that could be an avenue of attack. I’d seen people able to treat their Gmail accounts as external disks…and utilities like ForkLift used FUSE technology to work with at least some of “FTP, […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: