Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jberkman
evolution-data-server-2.6
bnc-165922-could-not-parse-mime.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-165922-could-not-parse-mime.patch of Package evolution-data-server-2.6
--- camel/providers/groupwise/camel-groupwise-folder.h 2005-08-31 09:56:07.000000000 +0530 +++ camel/providers/groupwise/camel-groupwise-folder.h 2006-07-25 09:03:26.044024784 +0530 @@ -40,6 +40,8 @@ extern "C" { #include <camel/camel-internet-address.h> #include <camel/camel-data-cache.h> #include <camel/camel-multipart.h> +#include <camel/camel-multipart-signed.h> +#include <camel/camel-multipart-encrypted.h> #include <camel/camel-offline-journal.h> #include "camel-groupwise-summary.h" --- camel/providers/groupwise/camel-groupwise-folder.c 2006-07-25 09:12:53.450765848 +0530 +++ camel/providers/groupwise/camel-groupwise-folder.c 2006-07-25 09:11:37.353334416 +0530 @@ -644,6 +644,7 @@ groupwise_sync (CamelFolder *folder, gbo camel_message_info_free(info); continue; } else { + gw_info->server_flags = gw_info->info.flags; const char *uid = camel_message_info_uid (info); if (diff.changed & CAMEL_MESSAGE_SEEN) read_items = g_list_append (read_items, (char *)uid); @@ -977,6 +978,10 @@ groupwise_refresh_folder(CamelFolder *fo return; } + if (!cnc) + return; + + if (camel_folder_is_frozen (folder) ) { gw_folder->need_refresh = TRUE; } @@ -1033,7 +1038,10 @@ groupwise_refresh_folder(CamelFolder *fo g_free (summary->time_string); - summary->time_string = g_strdup (t_str); + //summary->time_string = g_strdup (t_str); + ((CamelGroupwiseSummary *) folder->summary)->time_string = g_strdup (t_str); + camel_folder_summary_touch (folder->summary); + groupwise_sync_summary (folder, ex); g_free (t_str); t_str = NULL; @@ -1541,10 +1549,13 @@ groupwise_folder_item_to_msg( CamelFolde CamelMultipart *multipart; int errno; char *body = NULL; + int body_len = 0; const char *uid = NULL; gboolean is_text_html = FALSE; gboolean is_text_html_embed = FALSE; gboolean is_base64_encoded = FALSE; + gboolean has_mime_822 = FALSE; + CamelStream *temp_stream; uid = e_gw_item_get_id(item); cnc = cnc_lookup (priv); @@ -1558,8 +1569,7 @@ groupwise_folder_item_to_msg( CamelFolde char *attachment = NULL; int len = 0; - if (!g_ascii_strcasecmp (attach->name, "Mime.822") || - !g_ascii_strcasecmp (attach->name, "TEXT.htm") || + if (!g_ascii_strcasecmp (attach->name, "TEXT.htm") || !g_ascii_strcasecmp (attach->name, "Header")) { status = e_gw_connection_get_attachment (cnc, @@ -1578,11 +1588,66 @@ groupwise_folder_item_to_msg( CamelFolde } }//if attachment and len } // if Mime.822 or TEXT.htm + + for (al = attach_list ; al != NULL ; al = al->next) { + EGwItemAttachment *attach = (EGwItemAttachment *)al->data; + if (!g_ascii_strcasecmp (attach->name, "Mime.822")) { + if (attach->size > MAX_ATTACHMENT_SIZE) { + long count = 0; + int i, t_len=0, offset=0, t_offset=0; + char *t_attach = NULL; + GString *gstr = g_string_new (NULL); + + count = (attach->size)/(1024*1024); + count++; + len = 0; + for (i = 0; i<count; i++) { + status = e_gw_connection_get_attachment_base64 (cnc, + attach->id, t_offset, MAX_ATTACHMENT_SIZE, + (const char **)&t_attach, &t_len, &offset); + if (status == E_GW_CONNECTION_STATUS_OK) { + gstr = g_string_append (gstr, t_attach); + t_offset = offset; + g_free (t_attach); + t_attach = NULL; + t_len = 0; + } + } + body = soup_base64_decode (gstr->str, &len); + body_len = len; + g_string_free (gstr, TRUE); + } else { + status = e_gw_connection_get_attachment (cnc, + attach->id, 0, -1, + (const char **)&attachment, &len); + if (status != E_GW_CONNECTION_STATUS_OK) { + g_warning ("Could not get attachment\n"); + camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Could not get message")); + return NULL; + } + body = g_strdup (attachment); + body_len = len; + g_free (attachment); + } + has_mime_822 = TRUE; + } + } + }//if attach_list msg = camel_mime_message_new (); - multipart = camel_multipart_new (); + if (has_mime_822) { + temp_stream = camel_stream_mem_new_with_buffer (body, body_len); + if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) msg, temp_stream) == -1) { + camel_object_unref (msg); + camel_object_unref (temp_stream); + msg = NULL; + goto end; + } + } else { + multipart = camel_multipart_new (); + } camel_mime_message_set_message_id (msg, uid); type = e_gw_item_get_item_type (item); @@ -1615,7 +1680,11 @@ groupwise_folder_item_to_msg( CamelFolde } } - groupwise_populate_msg_body_from_item (cnc, multipart, item, body); + + if (has_mime_822) + goto end; + else + groupwise_populate_msg_body_from_item (cnc, multipart, item, body); /*Set recipient details*/ groupwise_msg_set_recipient_list (msg, item); @@ -1711,18 +1780,6 @@ groupwise_folder_item_to_msg( CamelFolde g_strfreev (t); camel_mime_part_set_content_location (part, attach->name); } - } else if (attach->contentType && - !strcmp (attach->contentType, "application/pgp-signature")) { - camel_mime_part_set_filename(part, g_strdup(attach->name)); - camel_data_wrapper_set_mime_type(CAMEL_DATA_WRAPPER (multipart), "multipart/signed"); - has_boundary = TRUE; - camel_content_type_set_param(CAMEL_DATA_WRAPPER (multipart)->mime_type, "protocol", attach->contentType); - } else if (attach->contentType && - !strcmp (attach->contentType, "application/pgp-encrypted")) { - camel_mime_part_set_filename(part, g_strdup(attach->name)); - camel_data_wrapper_set_mime_type(CAMEL_DATA_WRAPPER (multipart), "multipart/encrypted"); - has_boundary = TRUE; - camel_content_type_set_param(CAMEL_DATA_WRAPPER (multipart)->mime_type, "protocol", attach->contentType); } else { camel_mime_part_set_filename(part, g_strdup(attach->name)); camel_mime_part_set_content_id (part, attach->contentid); @@ -1756,6 +1813,7 @@ groupwise_folder_item_to_msg( CamelFolde camel_object_unref (multipart); +end: if (body) g_free (body);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor