changeset 2222:c01f238a37a0 HEAD

Removed UIDPLUS after all, it needs more thinking about with maildir.
author Timo Sirainen <tss@iki.fi>
date Mon, 21 Jun 2004 17:51:04 +0300
parents e0cb58614ebc
children cf5967239463
files configure.in src/imap/cmd-append.c src/imap/cmd-copy.c
diffstat 3 files changed, 10 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Mon Jun 21 17:44:47 2004 +0300
+++ b/configure.in	Mon Jun 21 17:51:04 2004 +0300
@@ -1,7 +1,7 @@
 AC_INIT(src)
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(dovecot, 1.0-test19)
+AM_INIT_AUTOMAKE(dovecot, 1.0-test20)
 
 AM_MAINTAINER_MODE
 
@@ -1206,7 +1206,7 @@
 dnl ** capabilities
 dnl **
 
-capability="IMAP4rev1 SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN LISTEXT NAMESPACE UIDPLUS"
+capability="IMAP4rev1 SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN LISTEXT NAMESPACE"
 AC_DEFINE_UNQUOTED(CAPABILITY_STRING, "$capability", IMAP capabilities)
 
 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
--- a/src/imap/cmd-append.c	Mon Jun 21 17:44:47 2004 +0300
+++ b/src/imap/cmd-append.c	Mon Jun 21 17:51:04 2004 +0300
@@ -56,12 +56,9 @@
         struct mailbox_keywords old_flags;
 	struct mail_full_flags flags;
 	struct istream *input;
-	struct mail *mail;
 	time_t internal_date;
 	const char *mailbox, *internal_date_str;
 	uoff_t msg_size;
-	string_t *reply;
-        struct msgset_generator_context msgset_ctx;
 	unsigned int count;
 	int ret, failed, timezone_offset, nonsync;
 
@@ -88,8 +85,7 @@
 		}
 	}
 
-	if (mailbox_get_status(box, STATUS_KEYWORDS | STATUS_UIDVALIDITY,
-			       &status) < 0) {
+	if (mailbox_get_status(box, STATUS_KEYWORDS, &status) < 0) {
 		client_send_storage_error(client, storage);
 		mailbox_close(box);
 		return TRUE;
@@ -104,10 +100,6 @@
 	/* if error occurs, the CRLF is already read. */
 	client->input_skip_line = FALSE;
 
-	reply = str_new(default_pool, 256);
-	str_printfa(reply, "OK [APPENDUID %u ", status.uidvalidity);
-
-	msgset_generator_init(&msgset_ctx, reply);
 	count = 0;
 	failed = TRUE;
 	save_parser = imap_parser_create(client->input, client->output,
@@ -195,15 +187,13 @@
 					      client->input->v_offset,
 					      msg_size);
 		if (mailbox_save(t, &flags, internal_date, timezone_offset,
-				 NULL, input, &mail) < 0) {
+				 NULL, input, NULL) < 0) {
 			i_stream_unref(input);
 			client_send_storage_error(client, storage);
 			break;
 		}
 		i_stream_unref(input);
 
-		msgset_generator_next(&msgset_ctx, mail->uid);
-
 		if (client->input->closed)
 			break;
 
@@ -211,8 +201,6 @@
 	}
         imap_parser_destroy(save_parser);
 
-	msgset_generator_finish(&msgset_ctx);
-
 	if (failed)
 		mailbox_transaction_rollback(t);
 	else {
@@ -227,10 +215,8 @@
 
 	if (!failed) {
 		client_sync_full(client);
-		str_append(reply, "] Append completed.");
-		client_send_tagline(client, str_c(reply));
+		client_send_tagline(client, "OK Append completed.");
 	}
-	str_free(reply);
 
 	return TRUE;
 }
--- a/src/imap/cmd-copy.c	Mon Jun 21 17:44:47 2004 +0300
+++ b/src/imap/cmd-copy.c	Mon Jun 21 17:51:04 2004 +0300
@@ -7,13 +7,11 @@
 
 static int fetch_and_copy(struct mailbox_transaction_context *t,
 			  struct mailbox *srcbox,
-			  struct mail_search_arg *search_args,
-			  string_t *reply)
+			  struct mail_search_arg *search_args)
 {
 	struct mail_search_context *search_ctx;
         struct mailbox_transaction_context *src_trans;
-	struct mail *mail, *dest_mail;
-        struct msgset_generator_context srcset_ctx, destset_ctx;
+	struct mail *mail;
 	string_t *dest_str;
 	int ret;
 
@@ -27,8 +25,6 @@
 	}
 
 	dest_str = t_str_new(128);
-	msgset_generator_init(&srcset_ctx, reply);
-	msgset_generator_init(&destset_ctx, dest_str);
 
 	ret = 1;
 	while ((mail = mailbox_search_next(search_ctx)) != NULL) {
@@ -36,25 +32,11 @@
 			ret = 0;
 			break;
 		}
-		if (mailbox_copy(t, mail, &dest_mail) < 0) {
+		if (mailbox_copy(t, mail, NULL) < 0) {
 			ret = -1;
 			break;
 		}
 
-		msgset_generator_next(&srcset_ctx, mail->uid);
-		msgset_generator_next(&destset_ctx, dest_mail->uid);
-
-	}
-
-	msgset_generator_finish(&srcset_ctx);
-	msgset_generator_finish(&destset_ctx);
-
-	if (str_len(dest_str) == 0)
-		str_truncate(reply, 0);
-	else {
-		str_append_c(reply, ' ');
-		str_append_str(reply, dest_str);
-		str_append(reply, "] Copy completed.");
 	}
 
 	if (mailbox_search_deinit(search_ctx) < 0)
@@ -72,9 +54,7 @@
 	struct mailbox *destbox;
 	struct mailbox_transaction_context *t;
         struct mail_search_arg *search_arg;
-	struct mailbox_status status;
 	const char *messageset, *mailbox;
-	string_t *reply;
 	int ret;
 
 	/* <message set> <mailbox> */
@@ -110,18 +90,8 @@
 		}
 	}
 
-	if (mailbox_get_status(destbox, STATUS_UIDVALIDITY, &status) < 0) {
-		client_send_storage_error(client, storage);
-		if (destbox != client->mailbox)
-			mailbox_close(destbox);
-		return TRUE;
-	}
-
-	reply = str_new(default_pool, 512);
-	str_printfa(reply, "OK [COPYUID %u ", status.uidvalidity);
-
 	t = mailbox_transaction_begin(destbox, FALSE);
-	ret = fetch_and_copy(t, client->mailbox, search_arg, reply);
+	ret = fetch_and_copy(t, client->mailbox, search_arg);
 
 	if (ret <= 0)
 		mailbox_transaction_rollback(t);
@@ -142,12 +112,7 @@
 			client_sync_full(client);
 		else
 			client_sync_full_fast(client);
-		if (str_len(reply) > 0)
-			client_send_tagline(client, str_c(reply));
-		else {
-			client_send_tagline(client,
-				"OK Copy completed, no messages found.");
-		}
+		client_send_tagline(client, "OK Copy completed.");
 	}
 
 	if (destbox != client->mailbox)