Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Downloads All the attachments from all the emails under a specified gmail label
Ruby
Tree: 14e34adf12

Merge pull request #1 from drumond19/master

Update to use mail gem instead of tmail
latest commit 14e34adf12
@thekindofme authored
Failed to load latest commit information.
README Improve README file
gmail_attachment_downloader.rb Use mail gem instead of tmail

README

How to Run
	* Edit the script to reflect your account and other settings.
	* Install the necessary gems (mail)
	
Things you should know about

    * This was tested on ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]
    * You need mail gem -> gem install mail
    * Your Gmail account should be IMAP enabled (more info).
    * The script will first go through all the mails with some label applied on them. And it will download the attachments on these mails one by one. After it have processed one email, it will put on another label on it, to signify that this message’s attachments have been downloaded. So you could continue this script from where it stopped, if the script crashes out in the middle of the process.
    * I first tried doing this using ruby-gmail gem, but for some reason it fails to detect the attachments. But this may be fixed when you are reading this post. So if you want a more simpler script with more gmail oriented functionalities have a look at that project.
    * Whatever you do, do not violate Gmail’s ToS.

Issues

    * This process emails one by one, it is not multi threaded. And it will take sometime. So be patient and let it do its job.
    * When a certain email is processed and its attachments are downloaded the script will attach a label to it. This might/might not remove the existing labels from that email. If it does not remove them, you will need to do so manually, if and when you are starting the script to resume its work from where it stopped last time.
    * The script doesn’t know about (gmail) threads, it processes individual emails.

http://thekindofme.wordpress.com/2010/01/29/gmail-attachment-downloader-script/
Something went wrong with that request. Please try again.