[dovecot-cvs] dovecot/src/pop3 commands.c,1.45,1.46

cras at dovecot.org cras at dovecot.org
Sat Aug 27 17:35:09 EEST 2005


Update of /var/lib/cvs/dovecot/src/pop3
In directory talvi:/tmp/cvs-serv12143

Modified Files:
	commands.c 
Log Message:
If more mail comes after we have synced ourself initially, don't access/show
the new mails. For example UIDL could have shown more than needed, and it
may have expunged the new mails when quitting.



Index: commands.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/commands.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- commands.c	28 Jun 2005 09:54:02 -0000	1.45
+++ commands.c	27 Aug 2005 14:35:06 -0000	1.46
@@ -182,6 +182,7 @@
 static int expunge_mails(struct client *client)
 {
 	struct mail_search_arg search_arg;
+        struct mail_search_seqset seqset;
 	struct mail_search_context *ctx;
 	struct mail *mail;
 	uint32_t idx;
@@ -191,7 +192,10 @@
 		return TRUE;
 
 	memset(&search_arg, 0, sizeof(search_arg));
-	search_arg.type = SEARCH_ALL;
+	seqset.seq1 = 1;
+	seqset.seq2 = client->messages_count;
+	search_arg.type = SEARCH_SEQSET;
+	search_arg.value.seqset = &seqset;
 
 	ctx = mailbox_search_init(client->trans, NULL, &search_arg, NULL);
 	mail = mail_alloc(client->trans, 0, NULL);
@@ -422,6 +426,7 @@
 	struct mail_search_context *search_ctx;
 	struct mail *mail;
 	struct mail_search_arg search_arg;
+        struct mail_search_seqset seqset;
 
 	client->last_seen = 0;
 
@@ -439,7 +444,10 @@
 	if (enable_last_command) {
 		/* remove all \Seen flags */
 		memset(&search_arg, 0, sizeof(search_arg));
-		search_arg.type = SEARCH_ALL;
+		seqset.seq1 = 1;
+		seqset.seq2 = client->messages_count;
+		search_arg.type = SEARCH_SEQSET;
+		search_arg.value.seqset = &seqset;
 
 		search_ctx = mailbox_search_init(client->trans, NULL,
 						 &search_arg, NULL);
@@ -591,14 +599,15 @@
 
 	ctx = i_new(struct cmd_uidl_context, 1);
 
-	if (message == 0)
-		ctx->search_arg.type = SEARCH_ALL;
-	else {
+	if (message == 0) {
+		ctx->seqset.seq1 = 1;
+		ctx->seqset.seq2 = client->messages_count;
+	} else {
 		ctx->message = message;
 		ctx->seqset.seq1 = ctx->seqset.seq2 = message;
-		ctx->search_arg.type = SEARCH_SEQSET;
-		ctx->search_arg.value.seqset = &ctx->seqset;
 	}
+	ctx->search_arg.type = SEARCH_SEQSET;
+	ctx->search_arg.value.seqset = &ctx->seqset;
 
 	wanted_fields = 0;
 	if ((uidl_keymask & UIDL_MD5) != 0)



More information about the dovecot-cvs mailing list