about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-13 17:34:44 -0400
committerJune McEnroe <june@causal.agency>2020-04-13 17:34:44 -0400
commitd0fd62ac40d972f41d6fc9d59cfce5295c2f4dff (patch)
tree34f4fb1c244e73e34fa9c2a25abba4a1ec9a102a
parentFetch multipart body parts (diff)
downloadbubger-d0fd62ac40d972f41d6fc9d59cfce5295c2f4dff.tar.gz
bubger-d0fd62ac40d972f41d6fc9d59cfce5295c2f4dff.zip
Fetch .TEXT of single-part nested messages
-rw-r--r--export.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/export.c b/export.c
index 52f6f88..f703e20 100644
--- a/export.c
+++ b/export.c
@@ -111,13 +111,19 @@ static void exportFetchParts(
 			exportFetchParts(imap, parts, &structure->parts.ptr[i]);
 			parts->len--;
 		}
-	} else if (structure->message.structure) {
+	} else if (
+		structure->message.structure &&
+		structure->message.structure->multipart
+	) {
 		exportFetchParts(imap, parts, structure->message.structure);
 	} else {
 		fprintf(imap, " BODY[");
 		for (size_t i = 0; i < parts->len; ++i) {
 			fprintf(imap, "%s%" PRIu32, (i ? "." : ""), parts->ptr[i].number);
 		}
+		if (structure->message.structure) {
+			fprintf(imap, ".TEXT");
+		}
 		fprintf(imap, "]");
 	}
 }