show_part_content (part, stream_stdout);
        g_object_unref(stream_stdout);
     }
-    else if (g_mime_content_type_is_type (content_type, "multipart", "*"))
+    else if (g_mime_content_type_is_type (content_type, "multipart", "*") ||
+            g_mime_content_type_is_type (content_type, "message", "rfc822"))
     {
        /* Do nothing for multipart since its content will be printed
         * when recursing. */
 
        printf (", \"content\": %s", json_quote_chararray (ctx, (char *) part_content->data, part_content->len));
     }
-    else if (g_mime_content_type_is_type (content_type, "multipart", "*"))
+    else if (g_mime_content_type_is_type (content_type, "multipart", "*") ||
+            g_mime_content_type_is_type (content_type, "message", "rfc822"))
     {
        printf (", \"content\": [");
     }
 
     content_type = g_mime_object_get_content_type (GMIME_OBJECT (part));
 
-    if (g_mime_content_type_is_type (content_type, "multipart", "*"))
+    if (g_mime_content_type_is_type (content_type, "multipart", "*") ||
+       g_mime_content_type_is_type (content_type, "message", "rfc822"))
        printf ("]");
 
     printf ("}");