LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Download all email attachments from my inbox (https://www.linuxquestions.org/questions/linux-software-2/download-all-email-attachments-from-my-inbox-4175471112/)

fakie_flip 07-27-2013 05:11 AM

Download all email attachments from my inbox
 
I lost some files. I was reinstalling from one distro release to the next. I backed up my /home to a separate drive. Before I restored my backup, I booted up windows (dual boot I have for gaming). Windows ran a chkdsk before getting to the login screen. I checked my drive that had the backup, and windows chkdsk had whiped it clean, similarly to what you'd see after reformating with a file system.

In attempt to recover as much as possible, I used file recovery software. I was limited to the amount of files it would recover. Many files I lost are in my email as attachments such as pictures, documents, etc. So I enabled pop3 to download all my email using Thunderbird. I just want all of my attachments. However I ran into a problem. The files are in a different format until I click save attachment from each individual email.

This is what my email downloaded with pop3 looks like. Many emails and attachments seem to be combined in one or more files.

Code:

bullshark@beastlinux ~/.thunderbird/34dxsuww.default/Mail/pop.googlemail.com $ ls
Archives  Archives.msf  Archives.sbd  Inbox  Inbox.msf  msgFilterRules.dat  popstate.dat  Sent  Sent.msf  Trash  Trash.msf@
bullshark@beastlinux ~/.thunderbird/34dxsuww.default/Mail/pop.googlemail.com $

I've been using the same email account for over 5 years, so that's thousands of emails to go through with Thunderbird, very tedious. I'm looking for a way to automate that task. Thanks in advance for the help.

joe_2000 08-07-2013 04:01 AM

Hi. You could write a python script that goes through all mails in your inbox and downloads the attachment.

Use your favorite search engine to look for "python script download email attachment" or similar.
E.g. this one looks as a good starting point:

https://gist.github.com/baali/2633554

fakie_flip 08-26-2013 08:15 PM

I don't see why I have to code in a god awful language. I found software for windows. I'll run it in virtual box.

astrogeek 08-26-2013 08:31 PM

Quote:

Originally Posted by fakie_flip (Post 5016571)
I don't see why I have to code in a god awful language. I found software for windows. I'll run it in virtual box.

Would that be the same windows that wiped out your data to begin with?

fakie_flip 08-27-2013 05:45 AM

Quote:

Originally Posted by astrogeek (Post 5016582)
Would that be the same windows that wiped out your data to begin with?

No, it's WinXP sandboxed in a virtual machine.


All times are GMT -5. The time now is 11:13 PM.