dovecot-2.2: Merged changes from v2.1 tree.

dovecot at dovecot.org dovecot at dovecot.org
Wed Jan 9 05:39:06 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/f06419a40a06
changeset: 15608:f06419a40a06
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jan 09 05:38:13 2013 +0200
description:
Merged changes from v2.1 tree.

diffstat:

 .hgsigs                                       |   1 +
 .hgtags                                       |   1 +
 NEWS                                          |   7 ++++++
 src/lib-storage/index/dbox-common/dbox-file.c |   1 +
 src/lib-storage/index/dbox-multi/mdbox-save.c |  28 ++++++++++++++++++--------
 src/lib-storage/index/index-mail.c            |   9 ++++++-
 src/lib/buffer.c                              |   2 +-
 src/lib/net.c                                 |   4 +++
 8 files changed, 41 insertions(+), 12 deletions(-)

diffs (148 lines):

diff -r 2ae4a40b3b24 -r f06419a40a06 .hgsigs
--- a/.hgsigs	Tue Jan 08 16:24:20 2013 +0200
+++ b/.hgsigs	Wed Jan 09 05:38:13 2013 +0200
@@ -54,3 +54,4 @@
 741d800a192fa23572bb14196df2a8917cf20614 0 iEYEABECAAYFAlC3A5EACgkQyUhSUUBVisnmlACcCm6jc7NRoTkBtrJLcz+P325U1xcAn2+0eghqEMiP+rzRJC55oQxV00Zy
 75bfda4a7c6c9aa04b6a6ef233fc527356171a06 0 iEYEABECAAYFAlC4WKwACgkQyUhSUUBViskaOACgmcwWV8hgsCOWvkbdh0OIw1ImSQYAn1RcTL0CG3M8+XG7QrrxSfQ7+V99
 86bccdf46d172524ca19a1a8a16a50ac30a6743c 0 iEYEABECAAYFAlDqonoACgkQyUhSUUBVisnqqACfaqdR6GxUAJznotKT9WHIUVhVgcIAoJIEa0SBzlGIWThmLvtQByF9vXcc
+cf9d62fd0b143efa8e49fac998eb78a648cdd8a9 0 iEYEABECAAYFAlDqjXUACgkQyUhSUUBViskUEwCfYTWHeDmPr8HfxSBQN17SD5IwDygAnROhb3IVTm9niDun4gxPxbHLo/Pe
diff -r 2ae4a40b3b24 -r f06419a40a06 .hgtags
--- a/.hgtags	Tue Jan 08 16:24:20 2013 +0200
+++ b/.hgtags	Wed Jan 09 05:38:13 2013 +0200
@@ -90,4 +90,5 @@
 f5941f3ac7622361634b6cba464da79cc883d1bb 2.2.alpha1
 741d800a192fa23572bb14196df2a8917cf20614 2.1.11
 75bfda4a7c6c9aa04b6a6ef233fc527356171a06 2.1.12
+cf9d62fd0b143efa8e49fac998eb78a648cdd8a9 2.1.13
 86bccdf46d172524ca19a1a8a16a50ac30a6743c 2.2.beta1
diff -r 2ae4a40b3b24 -r f06419a40a06 NEWS
--- a/NEWS	Tue Jan 08 16:24:20 2013 +0200
+++ b/NEWS	Wed Jan 09 05:38:13 2013 +0200
@@ -30,6 +30,13 @@
 	+ LMTP proxy: Implemented XCLIENT extension for passing remote IP
 	  address through proxy.
 
+v2.1.13 2013-01-06  Timo Sirainen <tss at iki.fi>
+
+	- Some fixes to cache file changes in v2.1.11.
+	- fts-solr: Overlong UTF8 sequences in mails were rejected by Solr and
+	  caused the mails to not be indexed.
+	- virtual storage: Sorting mailbox by from/to/cc/bcc didn't work.
+
 v2.1.12 2012-11-30  Timo Sirainen <tss at iki.fi>
 
 	- dovecot-config in v2.1.11 caused build problems with Pigeonhole
diff -r 2ae4a40b3b24 -r f06419a40a06 src/lib-storage/index/dbox-common/dbox-file.c
--- a/src/lib-storage/index/dbox-common/dbox-file.c	Tue Jan 08 16:24:20 2013 +0200
+++ b/src/lib-storage/index/dbox-common/dbox-file.c	Wed Jan 09 05:38:13 2013 +0200
@@ -469,6 +469,7 @@
 	ctx->file = file;
 	if (file->fd != -1) {
 		ctx->output = o_stream_create_fd_file(file->fd, 0, FALSE);
+		o_stream_set_name(ctx->output, file->cur_path);
 		o_stream_cork(ctx->output);
 	}
 	return ctx;
diff -r 2ae4a40b3b24 -r f06419a40a06 src/lib-storage/index/dbox-multi/mdbox-save.c
--- a/src/lib-storage/index/dbox-multi/mdbox-save.c	Tue Jan 08 16:24:20 2013 +0200
+++ b/src/lib-storage/index/dbox-multi/mdbox-save.c	Wed Jan 09 05:38:13 2013 +0200
@@ -411,14 +411,14 @@
 	struct dbox_save_mail *save_mail;
 	struct mdbox_mailbox *src_mbox;
 	struct mdbox_mail_index_record rec;
-	const void *data;
+	const void *guid_data;
+	guid_128_t wanted_guid;
 	bool expunged;
 
 	ctx->ctx.finished = TRUE;
 
 	if (mail->box->storage != _ctx->transaction->box->storage ||
-	    _ctx->transaction->box->disable_reflink_copy_to ||
-	    _ctx->data.guid != NULL)
+	    _ctx->transaction->box->disable_reflink_copy_to)
 		return mail_storage_copy(_ctx, mail);
 	src_mbox = (struct mdbox_mailbox *)mail->box;
 
@@ -428,6 +428,20 @@
 			      &rec.map_uid) < 0)
 		return -1;
 
+	mail_index_lookup_ext(mail->transaction->view, mail->seq,
+			      src_mbox->guid_ext_id, &guid_data, &expunged);
+	if (guid_data == NULL || guid_128_is_empty(guid_data)) {
+		/* missing GUID, something's broken. don't copy using
+		   refcounting. */
+		return mail_storage_copy(_ctx, mail);
+	} else if (_ctx->data.guid != NULL &&
+		   (guid_128_from_string(_ctx->data.guid, wanted_guid) < 0 ||
+		    memcmp(guid_data, wanted_guid, sizeof(wanted_guid)) != 0)) {
+		/* GUID change requested. we can't do it with refcount
+		   copying */
+		return mail_storage_copy(_ctx, mail);
+	}
+
 	/* remember the map_uid so we can later increase its refcount */
 	if (!array_is_created(&ctx->copy_map_uids))
 		i_array_init(&ctx->copy_map_uids, 32);
@@ -438,12 +452,8 @@
 	mail_index_update_ext(ctx->ctx.trans, ctx->ctx.seq,
 			      ctx->mbox->ext_id, &rec, NULL);
 
-	mail_index_lookup_ext(mail->transaction->view, mail->seq,
-			      src_mbox->guid_ext_id, &data, &expunged);
-	if (data != NULL) {
-		mail_index_update_ext(ctx->ctx.trans, ctx->ctx.seq,
-				      ctx->mbox->guid_ext_id, data, NULL);
-	}
+	mail_index_update_ext(ctx->ctx.trans, ctx->ctx.seq,
+			      ctx->mbox->guid_ext_id, guid_data, NULL);
 	index_copy_cache_fields(_ctx, mail, ctx->ctx.seq);
 
 	save_mail = array_append_space(&ctx->mails);
diff -r 2ae4a40b3b24 -r f06419a40a06 src/lib-storage/index/index-mail.c
--- a/src/lib-storage/index/index-mail.c	Tue Jan 08 16:24:20 2013 +0200
+++ b/src/lib-storage/index/index-mail.c	Wed Jan 09 05:38:13 2013 +0200
@@ -1459,8 +1459,13 @@
 {
 	struct index_mail *mail = (struct index_mail *)_mail;
 
-	if (mail->data.seq == seq)
-		return;
+	if (mail->data.seq == seq) {
+		if (!saving)
+			return;
+		/* we started saving a mail, aborted it, and now we're saving
+		   another mail with the same sequence. make sure the mail
+		   gets reset. */
+	}
 
 	mail->mail.v.close(&mail->mail.mail);
 
diff -r 2ae4a40b3b24 -r f06419a40a06 src/lib/buffer.c
--- a/src/lib/buffer.c	Tue Jan 08 16:24:20 2013 +0200
+++ b/src/lib/buffer.c	Wed Jan 09 05:38:13 2013 +0200
@@ -325,7 +325,7 @@
 	const struct real_buffer *buf = (const struct real_buffer *)_buf;
 	void *ret;
 
-	if (buf->pool->datastack_pool) {
+	if (buf->pool != NULL && buf->pool->datastack_pool && buf->alloc > 0) {
 		/* this doesn't really do anything except verify the
 		   stack frame */
 		ret = p_realloc(buf->pool, buf->w_buffer,
diff -r 2ae4a40b3b24 -r f06419a40a06 src/lib/net.c
--- a/src/lib/net.c	Tue Jan 08 16:24:20 2013 +0200
+++ b/src/lib/net.c	Wed Jan 09 05:38:13 2013 +0200
@@ -279,7 +279,11 @@
 	sa.un.sun_family = AF_UNIX;
 	if (i_strocpy(sa.un.sun_path, path, sizeof(sa.un.sun_path)) < 0) {
 		/* too long path */
+#ifdef ENAMETOOLONG
+		errno = ENAMETOOLONG;
+#else
 		errno = EINVAL;
+#endif
 		return -1;
 	}
 


More information about the dovecot-cvs mailing list