+ content_type = tny_mime_part_get_content_type (TNY_MIME_PART (msg));
+ if (content_type && !strcmp (content_type, "multipart/signed")) {
+ TnyList *msg_children;
+ guint length;
+
+ msg_children = TNY_LIST (tny_simple_list_new ());
+ tny_mime_part_get_parts (TNY_MIME_PART (msg), msg_children);
+
+ length = tny_list_get_length (msg_children);
+ if (length == 1 || length == 2) {
+ TnyIterator *iterator;
+
+ iterator = tny_list_create_iterator (msg_children);
+
+ part_to_check = TNY_MIME_PART (tny_iterator_get_current (iterator));
+
+ g_object_unref (iterator);
+ }
+
+ g_object_unref (msg_children);
+ }
+ if (part_to_check == NULL) {
+ part_to_check = g_object_ref (msg);
+ }
+