summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--export.c2
-rw-r--r--imap.c2
-rw-r--r--imap.h3
3 files changed, 4 insertions, 3 deletions
diff --git a/export.c b/export.c
index 5647086..644055c 100644
--- a/export.c
+++ b/export.c
@@ -170,7 +170,7 @@ bool exportData(FILE *imap, enum Atom tag, struct List items) {
 
 		if (section.ptr[0].type == Atom) {
 			name = section.ptr[0].atom;
-			if (name == AtomHeaderFields) {
+			if (name == AtomHeader) {
 				bodyHeader = data;
 			} else if (name == AtomText) {
 				bodyText = data;
diff --git a/imap.c b/imap.c
index 9743ac8..b47a520 100644
--- a/imap.c
+++ b/imap.c
@@ -97,7 +97,7 @@ static void imapLine(FILE *imap) {
 }
 
 static struct Data parseAtom(void) {
-	size_t len = strcspn(ptr, " ()[]{\"");
+	size_t len = (*ptr == '.' ? 1 : strcspn(ptr, " .()[]{\""));
 	struct Data data = {
 		.type = Atom,
 		.atom = atomn(ptr, len),
diff --git a/imap.h b/imap.h
index a2c13bd..0aa5636 100644
--- a/imap.h
+++ b/imap.h
@@ -57,8 +57,9 @@
 	X(AtomEnvelope, "ENVELOPE") \
 	X(AtomBodyStructure, "BODYSTRUCTURE") \
 	X(AtomBody, "BODY") \
-	X(AtomHeaderFields, "HEADER.FIELDS") \
+	X(AtomHeader, "HEADER") \
 	X(AtomText, "TEXT") \
+	X(AtomDot, ".") \
 	X(AtomUntagged, "*")
 
 enum Atom {