+ case 'X':
+ {
+ int count, flags = 0;
+
+ if (hdr->content->parts)
+ count = mutt_count_body_parts(hdr, flags);
+ else {
+ mutt_parse_mime_message(ctx, hdr);
+ count = mutt_count_body_parts(hdr, flags);
+ mutt_free_body(&hdr->content->parts);
+ }
+
+ /* The recursion allows messages without depth to return 0. */
+ if (optional)
+ optional = count != 0;
+
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+ snprintf (dest, destlen, fmt, count);
+ }
+ break;
+