diff --git a/mbuni/mmsbox/mmsbox.c b/mbuni/mmsbox/mmsbox.c index 0f935f0..269c96c 100644 --- a/mbuni/mmsbox/mmsbox.c +++ b/mbuni/mmsbox/mmsbox.c @@ -750,11 +750,7 @@ static int add_msg_part(MIMEEntity *res, xmlNodePtr node, Octstr *base_url, if (mt_filter && mmc_id) mt_filter->filter(&x, curl, mmc_id); -#if 1 - /* show it. */ - Octstr *_x = mime_entity_to_octstr(x); - octstr_dump(_x,0); -#endif + mime_entity_add_part(res, x); mime_entity_destroy(x); @@ -956,6 +952,20 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers, } } else { /* all others, make the message as-is and hope for the best! */ List *xh = http_create_empty_headers(); + + if (mt_multipart) { /* if its going to be multi-part, add some nice headers. */ + static int cntr = 0; + char *fext = content_type2file_ext(ctype); + Octstr *attr = octstr_format("%06d.%s", ++cntr,fext); + Octstr *cid_header_val = octstr_format("<%S>", attr); + + http_header_add(xh, "Content-ID", octstr_get_cstr(cid_header_val)); + http_header_add(xh, "Content-Location", octstr_get_cstr(attr)); + + octstr_destroy(attr); + octstr_destroy(cid_header_val); + } + http_header_add(xh, "Content-Type", octstr_get_cstr(ctype)); mime_replace_headers(me, xh);