Re: [gmime-devel] Splitting an EML file (that contains several mails inside) and retrieving message header's values



Hi Nick,

Unfortunately the format of the messages you linked to aren't using proper MIME to attach the messages to the body of the parent, so it'll be more difficult but still doable.

The email that you linked to is a simple text/plain email with the other emails embedded as plain text inside.

What you'll need to do is parse the main message (just like any of the sample programs do, or tests/test-parser.c) and then you'll want to repeat the process on the content stream of the text/plain mime part of the message you already parsed (when parsing the inner messages, you'll want to set the mime parser to scan from-lines since the inner messages are formatted like mbox).

Hope that helps,

Jeff


From: "Nick" <eveningnick gmail com>
To: gmime-devel-list gnome org
Sent: Tuesday, July 10, 2012 4:22:57 PM
Subject: [gmime-devel] Splitting an EML file (that contains several mails inside) and retrieving message header's values

Hello

Could you please help me to perform these tasks (subj) using the gmime library?
I have an EML file, that contains several emails exported by Apple
Mail (I have selected several email titles and clicked "Save=>Save in
a raw message format"). Here's such an EML file:
http://rghost.net/39143609

I believe this isn't very difficult, but I am totally confused.
I am not asking for the code (that would be too much), but at least
what are the basic steps i need to do to split this single exported
file with several emails into several valid .eml files, and how to
retrieve the information, like "subject", "received date/time",
"sender", "to", "cc", "contentHtml", and whether the eml has
attachments?

I've managed to build the GMime library and its samples.

Have I chosen the right instrument (gmime) to do this? Maybe there are
better unix-oriented solutions?
I've found a lot of high-level windows (mostly, .Net) libraries for
high level processing of Mime files, but gmime seems to be the only
choice for Unix systems. Parsing the exported EML manually according
to RFC specifications (and foreseeing all the caveats of the format)
seems to be too difficult for me.

Thank you for any help.
_______________________________________________
gmime-devel-list mailing list
gmime-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gmime-devel-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]