Re: write fetched mime section

Marko Ivancic <[email protected]> Sun, 16 Apr 2006 20:39:15 +0200
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
Hi

I cannot find a solution, all I want to do is:

1. I have a mailmime* (only headers with mailmime_data empty) I get this 
struct with mailprivacy_msg_get_bodystructure(NULL,messege,mime)


2. I fetch the missing parts with:

mailmessage_fetch_section(message,InnerMime,&resultText,&result_len);

And This works fine I get all the right missing piece, but now

3. I try to write this back into the entire mime with (is like 
set_body_text but can change the encoded atribute)

struct mailmime_data * data;
   
    data = mailmime_data_new(MAILMIME_DATA_TEXT, nEncoding,
                             nEncoded, data_str, length, NULL);
    if (data == NULL)
        return MAILIMF_ERROR_MEMORY;

    build_info->mm_data.mm_single = data;

And write it out with mailmime_write_mem(...)

This works for tri missing parts on the fourth it begins to write 
somewhere in the middle (overlaps the writting). Is this a bug or am I 
missing something here ??

Thanks for Help

by,
Marko

Marko Ivancic wrote:
> Tnx Mr Dinh
>
> I will try with thi.
>
> But I have another question. I tried to set the text mime part with 
> mailmime_set_body_text for all my single parts.
>
> Then I try to write it back with mailmime_write_mem into a MMAPString. 
> For the Html and plain txt works but then the write is not more 
> complete (missing a part of MIME). So it is not posible to use the 
> mailmeime_set_body_text function for all single parts ??
>
> tnx
> By
> Marko
>
> DINH Viet Hoa wrote:
>> Marko Ivancic wrote :
>>
>>   
>>> My question now is how do I insert on this position my fetched data ?? I 
>>> looked all the examplse in libetpan and etpanX but I can not find the 
>>> answer to this.
>>>     
>>
>> int mailprivacy_get_mime(struct mailprivacy * privacy,
>>     int check_privacy, int reencode,
>>     char * content, size_t content_len,
>>     struct mailmime ** result_mime)
>>
>> This is the function you may be looking for (it is on libetpan side).
>> You can implement a function to get a MIME part from fetched data using 
>> this function as a model (this function is rather internal to libetpan).
>>
>>   
>