aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-07-12 14:27:11 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-07-12 14:27:11 +0800
commit36b6d6469d484f928a58b1420a9c47d416d9d9ed (patch)
tree88c4b2eeb924ff15b77e2e6e6ae6db76a87d9a2d /camel
parent414ee2389f48a7ac5f7c982ae9a64fd7c7669f46 (diff)
downloadgsoc2013-evolution-36b6d6469d484f928a58b1420a9c47d416d9d9ed.tar
gsoc2013-evolution-36b6d6469d484f928a58b1420a9c47d416d9d9ed.tar.gz
gsoc2013-evolution-36b6d6469d484f928a58b1420a9c47d416d9d9ed.tar.bz2
gsoc2013-evolution-36b6d6469d484f928a58b1420a9c47d416d9d9ed.tar.lz
gsoc2013-evolution-36b6d6469d484f928a58b1420a9c47d416d9d9ed.tar.xz
gsoc2013-evolution-36b6d6469d484f928a58b1420a9c47d416d9d9ed.tar.zst
gsoc2013-evolution-36b6d6469d484f928a58b1420a9c47d416d9d9ed.zip
Handle multipart/encrypted parts too.
2002-07-12 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (get_content): Handle multipart/encrypted parts too. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): Handle multipart/encrypted types too. svn path=/trunk/; revision=17434
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/camel-mime-part-utils.c10
-rw-r--r--camel/providers/imap/camel-imap-folder.c16
3 files changed, 26 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 1b0055c5e0..462b529baf 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,12 @@
+2002-07-12 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/imap/camel-imap-folder.c (get_content): Handle
+ multipart/encrypted parts too.
+
+ * camel-mime-part-utils.c
+ (camel_mime_part_construct_content_from_parser): Handle
+ multipart/encrypted types too.
+
2002-07-11 Jeffrey Stedfast <fejj@ximian.com>
* providers/smtp/camel-smtp-transport.c (smtp_data): Don't let any
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index 037493b501..348343b489 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -39,6 +39,7 @@
#include "camel-mime-message.h"
#include "camel-multipart.h"
#include "camel-multipart-signed.h"
+#include "camel-multipart-encrypted.h"
#include "camel-seekable-substream.h"
#include "camel-stream-fs.h"
#include "camel-stream-filter.h"
@@ -342,9 +343,12 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParse
case HSCAN_HEADER:
d(printf("Creating body part\n"));
/* multipart/signed is some fucked up type that we must treat as binary data, fun huh, idiots. */
- if (header_content_type_is(camel_mime_parser_content_type(mp), "multipart", "signed")) {
- content = (CamelDataWrapper *)camel_multipart_signed_new();
- camel_multipart_construct_from_parser((CamelMultipart *)content, mp);
+ if (header_content_type_is (camel_mime_parser_content_type (mp), "multipart", "signed")) {
+ content = (CamelDataWrapper *) camel_multipart_signed_new ();
+ camel_multipart_construct_from_parser ((CamelMultipart *) content, mp);
+ } else if (header_content_type_is (camel_mime_parser_content_type (mp), "multipart", "encrypted")) {
+ content = (CamelDataWrapper *) camel_multipart_encrypted_new ();
+ camel_multipart_construct_from_parser ((CamelMultipart *) content, mp);
} else {
content = camel_data_wrapper_new ();
simple_data_wrapper_construct_from_parser (content, mp);
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index a14b8fb637..174a551a99 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -57,6 +57,7 @@
#include "camel-mime-utils.h"
#include "camel-multipart.h"
#include "camel-multipart-signed.h"
+#include "camel-multipart-encrypted.h"
#include "camel-operation.h"
#include "camel-session.h"
#include "camel-stream-buffer.h"
@@ -1660,17 +1661,20 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
}
}
- return (CamelDataWrapper *)body_mp;
+ return (CamelDataWrapper *) body_mp;
} else if (header_content_type_is (ci->type, "multipart", "*")) {
CamelMultipart *body_mp;
char *child_spec;
int speclen, num;
- body_mp = camel_multipart_new ();
- camel_data_wrapper_set_mime_type_field (
- CAMEL_DATA_WRAPPER (body_mp), ci->type);
+ if (header_content_type_is (ci->type, "multipart", "encrypted"))
+ body_mp = (CamelMultipart *) camel_multipart_encrypted_new ();
+ else
+ body_mp = camel_multipart_new ();
- camel_multipart_set_boundary (body_mp, NULL);
+ /* need to set this so it grabs the boundary and other info about the multipart */
+ /* we assume that part->content_type is more accurate/full than ci->type */
+ camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (body_mp), part->content_type);
speclen = strlen (part_spec);
child_spec = g_malloc (speclen + 17); /* dot + 10 + dot + MIME + nul */
@@ -1716,7 +1720,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
g_free (child_spec);
- return (CamelDataWrapper *)body_mp;
+ return (CamelDataWrapper *) body_mp;
} else if (header_content_type_is (ci->type, "message", "rfc822")) {
content = (CamelDataWrapper *) get_message (imap_folder, uid, part_spec, ci->childs, ex);
g_free (part_spec);