about summary refs log tree commit diff
diff options
context:
space:
mode:
-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);
 }