27 Dec 2006 12:53
Re: data_message_init and reading data from files
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 structure. (if not, you have mailmessage_fetch_envelope() to get the headers) -- -- DINH Viêt Hoà ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
RSS Feed