From: <din...@fr...> - 2006-12-27 11:54:03
|
On Dec 27, 2006, at 6:46 AM, Matt Ronge wrote: > Hello all, > > For testing purposes I have a directory filled with different e-mail > messages, and I'm going to be loading a few of the messages, parsing > them using LibEtPan and using them as test data for unit tests. I'm > reading data in from a file as a string, and them I'm passing the > data to the function: > > mailmessage * data_message_init(char * data, size_t len) which is in > the data_message_driver.c file. The data is loaded properly, but many > of the structures within mailmessage have not been filled, and none > of the data has been parsed. msg_data->msg_message and a few other > variables are filled inside mailmessage, but not much else. How can I > force LibEtPan to parse the data and fill the structures in > mailmessage? I poked around a bit in the code, but I didn't come up > with anything nice. Any thoughts? > > Is there a better way to load an individual message from a file? You can use : mailmessage_get_bodystructure(msg, &dummy); msg->msg_mime will be filled with the mime structure of the message. the headers of the message will be in the main part of the mime =20 structure. (if not, you have mailmessage_fetch_envelope() to get the headers) --=20 DINH Vi=EAt Ho=E0 |