+ if (node->envelope_file) {
+ printf ("On %s, %s wrote:\n",
+ notmuch_message_get_header (node->envelope_file, "date"),
+ notmuch_message_get_header (node->envelope_file, "from"));
+ } else if (GMIME_IS_MESSAGE (node->part)) {
+ GMimeMessage *message = GMIME_MESSAGE (node->part);
+ InternetAddressList *recipients;
+ const char *recipients_string;
+
+ printf ("> From: %s\n", g_mime_message_get_sender (message));
+ recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);
+ recipients_string = internet_address_list_to_string (recipients, 0);
+ if (recipients_string)
+ printf ("> To: %s\n",
+ recipients_string);
+ recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_CC);
+ recipients_string = internet_address_list_to_string (recipients, 0);
+ if (recipients_string)
+ printf ("> Cc: %s\n",
+ recipients_string);
+ printf ("> Subject: %s\n", g_mime_message_get_subject (message));
+ printf ("> Date: %s\n", g_mime_message_get_date_as_string (message));
+ printf (">\n");
+ } else if (GMIME_IS_PART (node->part)) {
+ GMimeContentType *content_type = g_mime_object_get_content_type (node->part);
+ GMimeContentDisposition *disposition = g_mime_object_get_content_disposition (node->part);
+
+ if (g_mime_content_type_is_type (content_type, "application", "pgp-encrypted") ||
+ g_mime_content_type_is_type (content_type, "application", "pgp-signature")) {
+ /* Ignore PGP/MIME cruft parts */
+ } else if (g_mime_content_type_is_type (content_type, "text", "*") &&
+ !g_mime_content_type_is_type (content_type, "text", "html")) {
+ GMimeStream *stream_stdout = g_mime_stream_file_new (stdout);