dovecot-2.0: Merged latest dovecot-2.0 changes.

dovecot at dovecot.org dovecot at dovecot.org
Sat Oct 2 14:34:08 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/fe13b7f577d2
changeset: 12270:fe13b7f577d2
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Oct 02 12:33:21 2010 +0100
description:
Merged latest dovecot-2.0 changes.

diffstat:

 .hgsigs                                            |    2 +
 .hgtags                                            |    2 +
 NEWS                                               |   48 ++++++
 TODO                                               |    7 +
 configure.in                                       |    4 +-
 doc/example-config/conf.d/20-pop3.conf             |    7 +
 src/auth/auth-client-connection.c                  |    2 +-
 src/auth/auth-request-handler.c                    |   31 +++-
 src/auth/auth-request-handler.h                    |    1 +
 src/auth/auth-request.h                            |    1 +
 src/config/config-parser.c                         |   38 ++--
 src/config/config-request.c                        |   50 ++++++-
 src/config/doveconf.c                              |   14 +
 src/director/director-connection.c                 |    4 +-
 src/doveadm/doveadm-mail-fetch.c                   |    2 +-
 src/dsync/dsync.c                                  |    9 +
 src/imap/imap-client.c                             |    2 +-
 src/imap/imap-commands-util.c                      |    8 +-
 src/lda/main.c                                     |    3 +-
 src/lib-dict/Makefile.am                           |    2 +
 src/lib-index/mail-index-sync.c                    |    7 +-
 src/lib-index/mail-index.c                         |    3 +-
 src/lib-index/mail-transaction-log-file.c          |   38 +++-
 src/lib-index/mail-transaction-log-private.h       |    1 +
 src/lib-index/mail-transaction-log.c               |   18 ++-
 src/lib-index/mailbox-log.c                        |   14 +-
 src/lib-master/master-service-settings.c           |    3 +
 src/lib-master/master-service-settings.h           |    1 +
 src/lib-storage/index/dbox-single/sdbox-copy.c     |   10 +-
 src/lib-storage/index/index-mail.c                 |   37 +++-
 src/lib-storage/index/index-mail.h                 |    2 +
 src/lib-storage/index/maildir/maildir-mail.c       |   74 ++++----
 src/lib-storage/index/maildir/maildir-storage.c    |   36 ++-
 src/lib-storage/index/maildir/maildir-storage.h    |    2 +
 src/lib-storage/index/maildir/maildir-sync-index.c |    2 +
 src/lib-storage/index/maildir/maildir-sync.c       |   34 ++-
 src/lib-storage/index/maildir/maildir-uidlist.c    |   12 +-
 src/lib-storage/index/maildir/maildir-uidlist.h    |    1 +
 src/lib-storage/index/maildir/maildir-util.c       |   52 ++++++
 src/lib-storage/list/mailbox-list-maildir.c        |    6 +-
 src/lib-storage/list/mailbox-list-subscriptions.c  |   19 +-
 src/lib-storage/list/subscription-file.c           |   48 ++---
 src/lib-storage/mail-storage-service.c             |    2 +
 src/lib-storage/mail-storage-service.h             |    4 +-
 src/lib-storage/mail-storage.h                     |    4 +-
 src/lib/istream.c                                  |    5 +
 src/lib/istream.h                                  |    3 +
 src/lib/module-dir.c                               |    4 +-
 src/lmtp/commands.c                                |    6 +
 src/login-common/client-common.h                   |    1 +
 src/login-common/sasl-server.c                     |    3 +
 src/plugins/acl/acl-api.h                          |    3 +
 src/plugins/acl/acl-backend-vfile.c                |   62 +++++--
 src/plugins/acl/acl-backend.c                      |   21 ++
 src/plugins/acl/acl-cache.c                        |   36 +----
 src/plugins/acl/acl-lookup-dict.c                  |   70 +++++---
 src/plugins/imap-zlib/imap-zlib-plugin.c           |    3 +
 src/plugins/quota/quota-storage.c                  |    6 +
 src/plugins/virtual/virtual-config.c               |   31 ++-
 src/plugins/virtual/virtual-storage.c              |   35 +---
 src/plugins/zlib/Makefile.am                       |    3 +-
 src/plugins/zlib/istream-bzlib.c                   |    7 +-
 src/plugins/zlib/istream-zlib.c                    |    7 +-
 src/plugins/zlib/zlib-plugin.c                     |    9 +-
 src/pop3/Makefile.am                               |    3 +-
 src/pop3/pop3-client.c                             |  191 +++++++++++++++--------
 src/pop3/pop3-settings.c                           |    2 +
 src/pop3/pop3-settings.h                           |    1 +
 68 files changed, 811 insertions(+), 368 deletions(-)

diffs (truncated from 2510 to 300 lines):

diff -r c68984eaf277 -r fe13b7f577d2 .hgsigs
--- a/.hgsigs	Fri Sep 24 19:50:20 2010 +0100
+++ b/.hgsigs	Sat Oct 02 12:33:21 2010 +0100
@@ -17,3 +17,5 @@
 8baa8ccb40216d626b9ca66309fca9437a76e6e2 0 iEYEABECAAYFAkxz/QQACgkQyUhSUUBViskVrwCfcB/267/lsPntHEyCkn5nG0cEP34AnjN9AzBApHkaHiDViRxS697HXbMj
 f4eb5306587964fee1074235de19c2c395249156 0 iEYEABECAAYFAkyHvBIACgkQyUhSUUBVismKMACfe7pcnrMHVmdmaUNgvyIperV9Uw4AoJ7bU7dh9SCPE868D3if2bcWNJHa
 a475e8d4eb213ae00d1d5e98cb75a470e34b252d 0 iEYEABECAAYFAkyTv5EACgkQyUhSUUBVisl4hgCfQxnLPCOrJ/opxRG3q30lWdML46AAni7Dotuow6acR2kK12l5jLl7fwu6
+7f5c5778c4b96d2fabee5ba22e635b5bdcf01a2b 0 iEYEABECAAYFAkyfh0gACgkQyUhSUUBVisn2UwCcCCL3V2F9//heGMDIMZ0kmQvDRvsAn2y5UibslT7gJ1QfoIIJokJhTcLS
+2690facaa9271c6b7c1c94b23c9051112cb9cc32 0 iEYEABECAAYFAkymThgACgkQyUhSUUBVislLzgCgmD1FpSMIVMb+xYIW1X/i5c4M14kAn3251AG6/aDke0XtaJTDMdmnoLvx
diff -r c68984eaf277 -r fe13b7f577d2 .hgtags
--- a/.hgtags	Fri Sep 24 19:50:20 2010 +0100
+++ b/.hgtags	Sat Oct 02 12:33:21 2010 +0100
@@ -54,3 +54,5 @@
 8baa8ccb40216d626b9ca66309fca9437a76e6e2 2.0.1
 f4eb5306587964fee1074235de19c2c395249156 2.0.2
 a475e8d4eb213ae00d1d5e98cb75a470e34b252d 2.0.3
+7f5c5778c4b96d2fabee5ba22e635b5bdcf01a2b 2.0.4
+2690facaa9271c6b7c1c94b23c9051112cb9cc32 2.0.5
diff -r c68984eaf277 -r fe13b7f577d2 NEWS
--- a/NEWS	Fri Sep 24 19:50:20 2010 +0100
+++ b/NEWS	Sat Oct 02 12:33:21 2010 +0100
@@ -1,3 +1,51 @@
+v2.0.5 2010-10-01  Timo Sirainen <tss at iki.fi>
+
+	* acl: Fixed the logic of merging multiple ACL entries. Now it works as
+	  documented, while previously it could have done slightly different
+	  things depending on the order of the entries.
+	* virtual: Allow opening virtual mailboxes that refer to non-existing
+	  mailboxes. It seems that the benefits of this outweigh the lack of
+	  error message when typoing a mailbox name.
+
+	+ Added some disk I/O optimizations to Maildir and index code. They're
+	  especially helpful with short-lived connections like POP3.
+	+ pop3: Added pop3_fast_size_lookups setting.
+	- doveconf sometimes failed with complaining about missing ssl_key
+	  setting, causing e.g. dovecot-lda to fail.
+	- lda: If there's an error in configuration, doveconf didn't exit with
+	  EX_TEMPFAIL as it should have.
+	- sdbox: Fixed memory leak when copying messages with hard links. 
+	- zlib + sdbox combination didn't work
+	- zlib: Fixed several crashes, which mainly showed up with mbox.
+	- quota: Don't crash if user has quota disabled, but plugin loaded.
+	- doveadm fetch uid was actually returning sequence, not uid.
+	- v2.0.4's subscription listing ignored (and logged a warning about)
+	  subscriptions=no namespaces' entries in some configurations.
+	  (So listing shared mailboxes' subscriptions could have been broken.)
+	- acl: Fixed crashing when sometimes listing shared mailboxes via
+	  dict proxy.
+
+v2.0.4 2010-09-26  Timo Sirainen <tss at iki.fi>
+
+	* multi-dbox: If :INDEX=path is specified, keep
+	  storage/dovecot.map.index* files also in the index path rather than
+	  in the main storage directory.
+
+	  WARNING: if you specified :INDEX= with earlier mdbox installation,
+	  you must now manually move the storage indexes to the expected
+	  directory! Otherwise Dovecot won't see them and will rebuild the
+	  indexes, possibly unexpunging some mails.
+
+	- Maildir: Copying messages with hard links sometimes caused the
+	  source maildir's entire tmp/ directory to be renamed to destination
+	  maildir as if it were a message.
+	- Maildir: v2.0.3 broke expunging copied messages sometimes
+	- Maildir: INBOX whose tmp/ directory was lost couldn't be opened
+	- single-dbox: Messages weren't copied with hard links
+	- vpopmail support is hopefully working again.
+	- dsync: POP3 UIDLs weren't copied with Maildir
+	- dict file: Fixed fd leak (showed up easily with LMTP + quota)
+
 v2.0.3 2010-09-17  Timo Sirainen <tss at iki.fi>
 
 	* dovecot-lda: Removed use of non-standard Envelope-To: header as a
diff -r c68984eaf277 -r fe13b7f577d2 TODO
--- a/TODO	Fri Sep 24 19:50:20 2010 +0100
+++ b/TODO	Sat Oct 02 12:33:21 2010 +0100
@@ -1,5 +1,12 @@
  - dbox attachments:
    - make sure attachments aren't opened while fetching other mime parts
+ - doveadm -A <<EOF expunge + purge + EOF
+ - dsync: give error if source and dest are the same
+ - sent, drafts: .Sent/dovecot.index: modseq_hdr.log_offset too large
+ - mail_max_lock_timeout error could be reported more nicely, also ones coming
+   from lib-index
+ - dsync: if mailbox is renamed due to it being invalid, its subscription
+   isn't renamed
  - doveadm director assign <user> <host> - do it permanently in memory
  - LSUB shows subscribed namespace prefix as prefix/, also SUBSCRIBE adds the /
  - sql pool: if async query is pending and sync query is sent and there
diff -r c68984eaf277 -r fe13b7f577d2 configure.in
--- a/configure.in	Fri Sep 24 19:50:20 2010 +0100
+++ b/configure.in	Sat Oct 02 12:33:21 2010 +0100
@@ -1,5 +1,5 @@
 AC_PREREQ([2.59])
-AC_INIT([Dovecot],[2.0.3],[dovecot at dovecot.org])
+AC_INIT([Dovecot],[2.0.5],[dovecot at dovecot.org])
 AC_CONFIG_SRCDIR([src])
 
 AM_INIT_AUTOMAKE([foreign])
@@ -2046,7 +2046,7 @@
 fi
 AM_CONDITIONAL(LDAP_PLUGIN, test "$have_ldap_plugin" = "yes")
 
-dict_drivers=client
+dict_drivers=
 
 if test $want_db != no; then
   AC_CACHE_CHECK([db_env_create in -ldb],i_cv_have_db_env_create,[
diff -r c68984eaf277 -r fe13b7f577d2 doc/example-config/conf.d/20-pop3.conf
--- a/doc/example-config/conf.d/20-pop3.conf	Fri Sep 24 19:50:20 2010 +0100
+++ b/doc/example-config/conf.d/20-pop3.conf	Sat Oct 02 12:33:21 2010 +0100
@@ -19,6 +19,13 @@
   # Keep the mailbox locked for the entire POP3 session.
   #pop3_lock_session = no
 
+  # POP3 requires message sizes to be listed as if they had CR+LF linefeeds.
+  # Many POP3 servers violate this by returning the sizes with LF linefeeds,
+  # because it's faster to get. When this setting is enabled, Dovecot still
+  # tries to do the right thing first, but if that requires opening the
+  # message, it fallbacks to the easier (but incorrect) size.
+  #pop3_fast_size_lookups = no
+
   # POP3 UIDL (unique mail identifier) format to use. You can use following
   # variables, along with the variable modifiers described in
   # doc/wiki/Variables.txt (e.g. %Uf for the filename in uppercase)
diff -r c68984eaf277 -r fe13b7f577d2 src/auth/auth-client-connection.c
--- a/src/auth/auth-client-connection.c	Fri Sep 24 19:50:20 2010 +0100
+++ b/src/auth/auth-client-connection.c	Sat Oct 02 12:33:21 2010 +0100
@@ -352,7 +352,7 @@
 	if (conn->request_handler != NULL) {
 		if (abort_requests)
 			auth_request_handler_abort_requests(conn->request_handler);
-		auth_request_handler_unref(&conn->request_handler);
+		auth_request_handler_destroy(&conn->request_handler);
 	}
 
         master_service_client_connection_destroyed(master_service);
diff -r c68984eaf277 -r fe13b7f577d2 src/auth/auth-request-handler.c
--- a/src/auth/auth-request-handler.c	Fri Sep 24 19:50:20 2010 +0100
+++ b/src/auth/auth-request-handler.c	Sat Oct 02 12:33:21 2010 +0100
@@ -29,6 +29,8 @@
 	void *context;
 
 	auth_request_callback_t *master_callback;
+
+	unsigned int destroyed:1;
 };
 
 static ARRAY_DEFINE(auth_failures_arr, struct auth_request *);
@@ -103,6 +105,18 @@
 	pool_unref(&handler->pool);
 }
 
+void auth_request_handler_destroy(struct auth_request_handler **_handler)
+{
+	struct auth_request_handler *handler = *_handler;
+
+	*_handler = NULL;
+
+	i_assert(!handler->destroyed);
+
+	handler->destroyed = TRUE;
+	auth_request_handler_unref(&handler);
+}
+
 void auth_request_handler_set(struct auth_request_handler *handler,
 			      unsigned int connect_uid,
 			      unsigned int client_pid)
@@ -116,6 +130,12 @@
 {
 	i_assert(request->handler == handler);
 
+	if (request->removed_from_handler) {
+		/* already removed it */
+		return;
+	}
+	request->removed_from_handler = TRUE;
+
 	/* if db lookup is stuck, this call doesn't actually free the auth
 	   request, so make sure we don't get back here. */
 	timeout_remove(&request->to_abort);
@@ -219,6 +239,13 @@
 	struct auth_stream_reply *reply;
 	string_t *str;
 
+	if (handler->destroyed) {
+		/* the client connection was already closed. we can't do
+		   anything but abort this request */
+		request->internal_failure = TRUE;
+		result = AUTH_CLIENT_RESULT_FAILURE;
+	}
+
 	reply = auth_stream_reply_init(pool_datastack_create());
 	switch (result) {
 	case AUTH_CLIENT_RESULT_CONTINUE:
@@ -359,10 +386,12 @@
 	unsigned int id;
 	buffer_t *buf;
 
+	i_assert(!handler->destroyed);
+
 	/* <id> <mechanism> [...] */
 	list = t_strsplit(args, "\t");
 	if (list[0] == NULL || list[1] == NULL ||
-	    str_to_uint(list[0], &id) < 0) {
+	    str_to_uint(list[0], &id) < 0) {
 		i_error("BUG: Authentication client %u "
 			"sent broken AUTH request", handler->client_pid);
 		return FALSE;
diff -r c68984eaf277 -r fe13b7f577d2 src/auth/auth-request-handler.h
--- a/src/auth/auth-request-handler.h	Fri Sep 24 19:50:20 2010 +0100
+++ b/src/auth/auth-request-handler.h	Sat Oct 02 12:33:21 2010 +0100
@@ -29,6 +29,7 @@
 		(auth_request_callback_t *)callback, context, \
 		master_callback)
 #endif
+void auth_request_handler_destroy(struct auth_request_handler **handler);
 void auth_request_handler_unref(struct auth_request_handler **handler);
 void auth_request_handler_abort_requests(struct auth_request_handler *handler);
 
diff -r c68984eaf277 -r fe13b7f577d2 src/auth/auth-request.h
--- a/src/auth/auth-request.h	Fri Sep 24 19:50:20 2010 +0100
+++ b/src/auth/auth-request.h	Sat Oct 02 12:33:21 2010 +0100
@@ -109,6 +109,7 @@
 	unsigned int userdb_lookup:1;
 	unsigned int userdb_lookup_failed:1;
 	unsigned int secured:1;
+	unsigned int removed_from_handler:1;
 
 	/* ... mechanism specific data ... */
 };
diff -r c68984eaf277 -r fe13b7f577d2 src/config/config-parser.c
--- a/src/config/config-parser.c	Fri Sep 24 19:50:20 2010 +0100
+++ b/src/config/config-parser.c	Sat Oct 02 12:33:21 2010 +0100
@@ -9,6 +9,7 @@
 #include "module-dir.h"
 #include "settings-parser.h"
 #include "service-settings.h"
+#include "master-service.h"
 #include "master-service-settings.h"
 #include "all-settings.h"
 #include "old-set-parser.h"
@@ -285,12 +286,13 @@
 			   const struct config_module_parser *p,
 			   const char **error_r)
 {
-	/* skip checking settings we don't care about */
-	if (*ctx->module != '\0' &&
-	    !config_module_want_parser(ctx->root_parsers, ctx->module, p->root))
-		return 0;
+	for (; p->root != NULL; p++) {
+		/* skip checking settings we don't care about */
+		if (*ctx->module != '\0' &&
+		    !config_module_want_parser(ctx->root_parsers,
+					       ctx->module, p->root))
+			continue;
 
-	for (; p->root != NULL; p++) {
 		settings_parse_var_skip(p->parser);
 		if (!settings_parser_check(p->parser, ctx->pool, error_r))
 			return -1;
@@ -654,8 +656,9 @@
 			str_append_c(str, '<');
 			str_append(str, value);
 		} else {
-			if (str_append_file(str, key, value, &error) < 0 &&
-			    config_require_key(ctx, key)) {
+			if (!config_require_key(ctx, key)) {
+				/* don't even try to open the file */
+			} else if (str_append_file(str, key, value, &error) < 0) {
 				/* file reading failed */
 				ctx->error = p_strdup(ctx->pool, error);
 				return -1;
@@ -663,18 +666,20 @@
 		}
 		break;
 	case CONFIG_LINE_TYPE_KEYVARIABLE:
-		if (!ctx->expand_values) {
+		/* expand_parent=TRUE for "key = $key stuff".
+		   we'll always expand it so that doveconf -n can give
+		   usable output */
+		p = strchr(value, ' ');
+		if (p == NULL)
+			var_name = value;
+		else
+			var_name = t_strdup_until(value, p);
+		expand_parent = strcmp(key, var_name) == 0;
+
+		if (!ctx->expand_values && !expand_parent) {
 			str_append_c(str, '$');
 			str_append(str, value);
 		} else {
-			p = strchr(value, ' ');
-			if (p == NULL)
-				var_name = value;
-			else
-				var_name = t_strdup_until(value, p);
-
-			/* expand_parent=TRUE for "key = $key stuff" */
-			expand_parent = strcmp(key, var_name) == 0;


More information about the dovecot-cvs mailing list