Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Accessing received Thunderbird emails

by gsd4me (Sexton)
on Aug 06, 2017 at 12:27 UTC ( #1196850=perlquestion: print w/replies, xml ) Need Help??
gsd4me has asked for the wisdom of the Perl Monks concerning the following question:

Dear all

This may be straightforward, but finding the answer sure isn't!

A Perl script residing on my website builds data into an email and sends it to me in a pre-formatted way - so:

field 1:item 1

field 2:item 2

etc

My Thunderbird email program receives the emails as and when they are sent, downloaded from the server running my system, and filters put them into the relevant email folders based on various fields in the email "from", "subject", etc.

What I currently do is every now and again (nothing here is time-related) open up the emails individually, cut and paste the data into a workbook file that holds all the received data and then run a secondary Perl script to analyse this workbook data to get the output that I need

SO I want to cut out the phase of "open workbook, open each email, cut and paste data, close each email, close workbook, run secondary Perl script" and I was hoping that there would be an easy Perl way of altering the secondary Perl script to simply access the internal details of these emails on my PC, so the source of the data is simply a different place from the workbook holding the data.

All the examples that I have found so far using web searches talk about more complex server-based activities than I want.

Any suggestions for a relevant Perl package?

Many thanks

Replies are listed 'Best First'.
Re: Accessing received Thunderbird emails
by marto (Bishop) on Aug 06, 2017 at 15:05 UTC

    The Mail::Box package sounds like the tool to use for reading the content of your emails. There are example scrips as part of the distribution which are worth looking at.

Re: Accessing received Thunderbird emails
by derion (Novice) on Aug 10, 2017 at 09:16 UTC

    I am doing a lot of stuff with E-Mails we get from customers and suppliers. My preferred way is the way you mentioned, doing some filtering based on subject and sender, then access the mails with Net::IMAP::Simple and then deleting them or putting them into a subfolder ./archiv or ./done. In most cases I store the data in a database table which makes sense when it comes to evaluating the data in my opinion.

    If you want / need Excel files you could use Excel::Writer::XLSX in addition to create Spreadsheets based on your database.

Re: Accessing received Thunderbird emails
by Anonymous Monk on Aug 07, 2017 at 08:00 UTC
    Ive used mail::box to read .mbox file, and ive used mozilla thunderbird to read .mbox file

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1196850]
Approved by Athanasius
Front-paged by Corion
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-08-24 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (367 votes). Check out past polls.

    Notices?