These days it seems like everyone is on the free web storage bandwagon, offering somewhere between tens of MB up to 2GB file storage and all kinds of options on how to share that with other people. But remember back in the day when GMail was first lauched, and it was a hit because it offered 2 gigabytes of storage space where its closet competitors had only 10 megabytes free?
Well those inbox sizes have continued to grow, up to 7.5gb as of this writing. GMail isn’t the only one with a big mailbox any more, but it’s certainly the most well-known. What if you could convert that space into a web-based drive and store files into it? Even at a 3-to-4 ratio (base64 encoding) you can still cram over 5gb into it, which is enough for many people to store a complete photo library, a document backup, etc. Free offsite backup for just a bit of legwork.
This is a script called “mail-drive.pl” which does exactly that: it provides an interface to an IMAP mailbox and allows users to put, get, list or delete files from the store. Individual files are broken down to smaller attachment sizes to fit into the mailbox on storage, and retrieved in the proper order when pulling to disk. Using this, with a wrapper script in a cron job, will allow me to keep backups in a special gmail inbox which I can then get back later if I ever need it. Free offsite backup!
- mail-drive.pl, Version 0.1, 1.5kb
Just a followup to anyone who may be using this: the line $imap->move is incorrect and should be changed to $imap->copy. This will allow the script to run, and also properly delete mails from the server.