Thread: gmail website?
View Single Post
Old 10-09-2004, 07:43 PM   #8 (permalink)
bendsley
Professional Loafer
 
bendsley's Avatar
 
Location: texas
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.
__________________
"You hear the one about the fella who died, went to the pearly gates? St. Peter let him in. Sees a guy in a suit making a closing argument. Says, "Who's that?" St. Peter says, "Oh, that's God. Thinks he's Denny Crane."
bendsley is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360