Thursday, August 18, 2011

how to download directly emails attachments into dropbox

I keep on being really happy with Dropbox and today I discover that I can easily drop an email attachment into Dbox almost automatically.
This is the piece of soft that is needed: MailDrop which is developed by Michael Warren who helped me with my issues during the setup.

I freely adapt from the documentation: 
It runs in the background and connects to your email through IMAP. When an email is received with a specified email label or in a folder it downloads the attachments and saves them to a folder that you can connect to your Dropbox account.

There are a few steps needed to be done on your part before MailDrop will be able to run:

IMAP
MailDrop checks your email using IMAP, so this must be enabled for your email account. See your email provider's settings or help section for information on how to do this. Information for enabling Gmail on IMAP can be found at the end of the post.

"Dropbox" label/folder
To keep MailDrop from downloading all attachments emailed to you, it is set to only download emails saved to the "Dropbox" folder. Therefore, for MailDrop to work correctly, you must create a folder named "Dropbox". NOTE: In Gmail, folders are referred to as labels, so in this instance anything with the label "Dropbox" will be downloaded. 

MailDrop email filter (Optional)
This step is recommended to ease the upload process. Setup an email filter which will move/copy any emails with a specified subject to your Dropbox email folder. This way, simply emailing the attachment to yourself with the designated subject (e.g. "MailDrop upload") will put it in your Dropbox. 

then from a shell run the program to do the setup: 
pymaildrop
and follow the instructions and the tutorial

If something goes wrong and it's not working check the log file into ~/.maildrop/ to figure out what's going on*.

*As a distract linux user I faced a couple of troubles (as always happens to me since I don't take enough care to documentation) to set it up because gmail is tricky into its use of labels for nested folders ("-" is used between the parent and son labels while Maildrop uses the "/").
I catched also a small bug (which Michael will quickly solve): when you remove all but one of the label-folder couples into the configuration the last two are inverted that means that the wrong one is removed. To avoid this you simply need to save each time you make some modification to the configuration.

as a side note to enable imap on gmail:
  1. Sign in to Gmail.
  2. Click the gear icon  in the upper-right and select Gmail settings at the top of any Gmail page.
  3. Click Forwarding and POP/IMAP.
  4. Select Enable IMAP.
  5. Configure your IMAP client and click Save Changes.

Note: At this time, it's not possible to enable IMAP while using the basic HTML interface.

ciao alex 

No comments:

Post a Comment