trying to parse a thunderbird mail file

trying to parse a thunderbird mail file

am 12.06.2008 05:45:34 von basil.daoust

Now I have to believe that some Perl modules must exist that can already
parse a email file.
I looked at email::simple but it didn't really work the way I hoped. It
treated the email file as a single email.
I found a example that looked very promising but it requires
Email::Folder and that doesn't seem to be available for ActivePerl 5.10?
I did find a version on cpan but being a windows user running a make has
never worked for me.

What I want to do is open a mail file, that is in plain text,
Split it into individual emails.
Then split the text/plain if available or the text/html if plain/text
not available, out of a multi-part mime messages.
Discarding the stuff that would be non-visible in the normal email.
Now I can do all that using brute force but I kind of thought that
something must exist.

I would like any modules suggested be available via PPM, thanks.

Basil

Here is a cleaned up single email sample from a thunderbird folder:
From - Wed Mar 26 23:14:58 2008
X-UIDL:
X-Mozilla-Status:
X-Mozilla-Status2:
Return-path:
Received:
Received:
Received:
Received:
Received:
Date: Wed, 26 Mar 2008 23:12:38 -0500
From:
Subject: Fwd:
In-reply-to: <014701c88f89$8d2801c0$5e01a8c0@Debcomp2>
To:
Message-id:
MIME-version: 1.0
Content-type: multipart/alternative;
boundary="----=_Part_7841_16001601.1206591158480"
DKIM-Signature:
DomainKey-Signature:
References: <014701c88f89$8d2801c0$5e01a8c0@Debcomp2>
Original-recipient: rfc822;##EMAIL Address##
------=_Part_7841_16001601.1206591158480
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
---------- Forwarded message ----------
Plain text version
-----Original Message-----
From:
Sent: Friday, March 21, 2008 10:05 PM
To:
Subject:
************************************************************ ****************
------=_Part_7841_16001601.1206591158480
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-----Original Message-----
.... HTML VERSION ...
To:
Subject:
************************************************************ ****************
------=_Part_7841_16001601.1206591158480--
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: trying to parse a thunderbird mail file

am 12.06.2008 08:32:42 von Bill Luebkert

Basil A. Daoust wrote:
> Now I have to believe that some Perl modules must exist that can already
> parse a email file.
> I looked at email::simple but it didn't really work the way I hoped. It
> treated the email file as a single email.
> I found a example that looked very promising but it requires
> Email::Folder and that doesn't seem to be available for ActivePerl 5.10?
> I did find a version on cpan but being a windows user running a make has
> never worked for me.
>
> What I want to do is open a mail file, that is in plain text,
> Split it into individual emails.
> Then split the text/plain if available or the text/html if plain/text
> not available, out of a multi-part mime messages.
> Discarding the stuff that would be non-visible in the normal email.
> Now I can do all that using brute force but I kind of thought that
> something must exist.
>
> I would like any modules suggested be available via PPM, thanks.

Try MIME::Parser - if it won't handle the file, just split the file at
each '^File - ' marker you find and feed the individual msgs to the
parser.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: trying to parse a thunderbird mail file

am 12.06.2008 11:15:03 von basil.daoust

Bill Luebkert wrote:
> Basil A. Daoust wrote:
>> Now I have to believe that some Perl modules must exist that can
>> already parse a email file.
>> I looked at email::simple but it didn't really work the way I hoped.
>> It treated the email file as a single email.
>> I found a example that looked very promising but it requires
>> Email::Folder and that doesn't seem to be available for ActivePerl 5.10?
>> I did find a version on cpan but being a windows user running a make
>> has never worked for me.
>>
>> What I want to do is open a mail file, that is in plain text,
>> Split it into individual emails.
>> Then split the text/plain if available or the text/html if plain/text
>> not available, out of a multi-part mime messages.
>> Discarding the stuff that would be non-visible in the normal email.
>> Now I can do all that using brute force but I kind of thought that
>> something must exist.
>>
>> I would like any modules suggested be available via PPM, thanks.
>
> Try MIME::Parser - if it won't handle the file, just split the file at
> each '^File - ' marker you find and feed the individual msgs to the
> parser.
>
I don't see MIME::Parser in PPM?


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: trying to parse a thunderbird mail file

am 12.06.2008 11:27:03 von Brian Raven

Basil A. Daoust <> wrote:
> Bill Luebkert wrote:
>> Basil A. Daoust wrote:
>>> Now I have to believe that some Perl modules must exist that can
>>> already parse a email file. I looked at email::simple but it didn't
>>> really work the way I hoped. =

>>> It treated the email file as a single email.
>>> I found a example that looked very promising but it requires
>>> Email::Folder and that doesn't seem to be available for ActivePerl
>>> 5.10? I did find a version on cpan but being a windows user running
>>> a make has never worked for me. =

>>> =

>>> What I want to do is open a mail file, that is in plain text, Split
>>> it into individual emails.
>>> Then split the text/plain if available or the text/html if
>>> plain/text not available, out of a multi-part mime messages.
>>> Discarding the stuff that would be non-visible in the normal email.
>>> Now I can do all that using brute force but I kind of thought that
>>> something must exist. =

>>> =

>>> I would like any modules suggested be available via PPM, thanks.
>> =

>> Try MIME::Parser - if it won't handle the file, just split the file
>> at each '^File - ' marker you find and feed the individual
>> msgs to the parser. =

>> =

> I don't see MIME::Parser in PPM?

That can happen for a number of reasons. It doesn't exist, a typo, or
perhaps its part of a larger package. According to
http://search.cpan.org/search?query=3DMIME%3A%3AParser&mode= 3Dall it is part
of MIME-tools, which does appear to be in several PPM archives.

HTH

-- =

Brian Raven =


==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================

The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =

Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.

L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
==================== =====3D=
================

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs