[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-update.c, 1.44, 1.45

cras at dovecot.org cras at dovecot.org
Sat Jan 14 15:59:53 EET 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv31215/src/lib-storage/index/mbox

Modified Files:
	mbox-sync-update.c 
Log Message:
Use longer line wrapping with X-IMAP, X-IMAPbase and X-Keywords headers
since UW-IMAP doesn't like the wrapping.



Index: mbox-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-update.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- mbox-sync-update.c	13 Jan 2006 20:26:37 -0000	1.44
+++ mbox-sync-update.c	14 Jan 2006 13:59:51 -0000	1.45
@@ -9,6 +9,11 @@
 #include "mbox-storage.h"
 #include "mbox-sync-private.h"
 
+/* Line length when to wrap X-IMAP, X-IMAPbase and X-Keywords headers to next
+   line. Keep this pretty long, as after we wrap we lose compatibility with
+   UW-IMAP */
+#define KEYWORD_WRAP_LINE_LENGTH 1024
+
 static void status_flags_append(struct mbox_sync_mail_context *ctx,
 				const struct mbox_flag_type *flags_list)
 {
@@ -130,9 +135,8 @@
 	for (i = 0, last_break = str_len(dest); i < idx_count; i++) {
 		i_assert(keyword_indexes[i] < keywords_count);
 
-		/* try avoid overly long lines but cutting them
-		   every 70 chars or so */
-		if (str_len(dest) - last_break < 70) {
+		/* wrap the line whenever it gets too long */
+		if (str_len(dest) - last_break < KEYWORD_WRAP_LINE_LENGTH) {
 			if (i > 0)
 				str_append_c(dest, ' ');
 		} else {
@@ -152,7 +156,7 @@
 	size_t last_break;
 
 	p = str_data(dest);
-	if (str_len(dest) < 70)
+	if (str_len(dest) < KEYWORD_WRAP_LINE_LENGTH)
 		last_break = 0;
 	else {
 		/* set last_break to beginning of line */
@@ -164,9 +168,8 @@
 
 	names = array_get(ctx->sync_ctx->mbox->ibox.keyword_names, &count);
 	for (i = 0; i < count; i++) {
-		/* try avoid overly long lines but cutting them
-		   every 70 chars or so */
-		if (str_len(dest) - last_break < 70)
+		/* wrap the line whenever it gets too long */
+		if (str_len(dest) - last_break < KEYWORD_WRAP_LINE_LENGTH)
 			str_append_c(dest, ' ');
 		else {
 			str_append(dest, "\n\t");



More information about the dovecot-cvs mailing list