summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-10 11:36:52 -0400
committerJune McEnroe <june@causal.agency>2020-04-10 11:36:52 -0400
commit0bd5498a520c6d43434749ebcc87e80969f4f1ad (patch)
tree875d59b13e1d8f01a8008fc6303124f3dd6e8034
parentLink mbox files into message/ (diff)
downloadbubger-0bd5498a520c6d43434749ebcc87e80969f4f1ad.tar.gz
bubger-0bd5498a520c6d43434749ebcc87e80969f4f1ad.zip
Only write UIDNEXT when finished
-rw-r--r--archive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archive.c b/archive.c
index 350fdfa..b6960e3 100644
--- a/archive.c
+++ b/archive.c
@@ -103,6 +103,7 @@ int main(int argc, char *argv[]) {
 		if (!pass) errx(EX_CONFIG, ENV_PASSWORD " unset");
 	}
 
+	uint32_t uidNext = 0;
 	enum Atom login = 0;
 	enum Atom examine = atom("EXAMINE");
 	enum Atom thread = atom("THREAD");
@@ -154,8 +155,6 @@ int main(int argc, char *argv[]) {
 				if (next == prev) {
 					examine = 0;
 					fprintf(imap, "ayy LOGOUT\r\n");
-				} else {
-					uidWrite("UIDNEXT", next);
 				}
 			}
 		}
@@ -186,4 +185,5 @@ int main(int argc, char *argv[]) {
 		respFree(resp);
 	}
 	fclose(imap);
+	uidWrite("UIDNEXT", uidNext);
 }