+ /* Here is the weird form of this command, to process only an
+ * encapsulated message/rfc822 section.
+ */
+ if (section) {
+ memset(&encap, 0, sizeof encap);
+ safestrncpy(encap.desired_section, section, sizeof encap.desired_section);
+ mime_parser(TheMessage->cm_fields['M'],
+ NULL,
+ *extract_encapsulated_message,
+ NULL, NULL, (void *)&encap, 0
+ );
+ CtdlFreeMessage(TheMessage);
+ TheMessage = NULL;
+
+ if (encap.msg) {
+ encap.msg[encap.msglen] = 0;
+ TheMessage = convert_internet_message(encap.msg);
+ encap.msg = NULL; /* no free() here, TheMessage owns it now */
+
+ /* Now we let it fall through to the bottom of this
+ * function, because TheMessage now contains the
+ * encapsulated message instead of the top-level
+ * message. Isn't that neat?
+ */
+
+ }
+ else {
+ if (do_proto) cprintf("%d msg %ld has no part %s\n",
+ ERROR + MESSAGE_NOT_FOUND, msg_num, section);
+ retcode = om_no_such_msg;
+ }
+
+ }
+
+ /* Ok, output the message now */
+ retcode = CtdlOutputPreLoadedMsg(
+ TheMessage, mode,
+ headers_only, do_proto, crlf);