dovecot-2.0: Merged changes from dovecot-2.0 branch

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


details:   http://hg.dovecot.org/dovecot-2.0/rev/44e0d823bd1f
changeset: 12265:44e0d823bd1f
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 16 19:15:21 2010 +0100
description:
Merged changes from dovecot-2.0 branch

diffstat:

 .hgsigs                                            |    1 +
 .hgtags                                            |    1 +
 NEWS                                               |   12 +
 TODO                                               |    3 +
 configure.in                                       |   13 +-
 doc/example-config/conf.d/15-lda.conf              |    7 +-
 dovecot.m4                                         |   13 +-
 src/auth/auth-cache.c                              |    2 +-
 src/auth/auth-settings.c                           |   11 +-
 src/auth/auth-worker-server.c                      |   10 +-
 src/auth/userdb-static.c                           |   10 +-
 src/config/config-parser.c                         |   10 +-
 src/config/config-parser.h                         |    2 +
 src/config/doveconf.c                              |   23 +++-
 src/config/old-set-parser.c                        |    9 +
 src/director/director-connection.c                 |    9 +
 src/doveadm/doveadm-mail-list-iter.c               |    5 +-
 src/doveadm/doveadm-mail.c                         |    1 +
 src/dsync/dsync-brain.c                            |    7 +
 src/dsync/dsync-brain.h                            |    1 +
 src/dsync/dsync-worker-local.c                     |   52 ++++++-
 src/dsync/dsync.c                                  |    3 +-
 src/imap/cmd-idle.c                                |   18 +-
 src/imap/cmd-select.c                              |   35 +++-
 src/imap/imap-commands-util.c                      |    1 +
 src/lda/main.c                                     |   35 +++-
 src/lib-imap/test-imap-match.c                     |    4 +-
 src/lib-index/mail-index-fsck.c                    |    6 +-
 src/lib-index/mail-index-lock.c                    |    4 +-
 src/lib-index/mail-index-map-read.c                |    2 +-
 src/lib-index/mail-index-transaction-update.c      |    3 +-
 src/lib-index/mail-transaction-log-file.c          |   22 ++-
 src/lib-index/mail-transaction-log-private.h       |    7 +-
 src/lib-index/mail-transaction-log.c               |   31 ++--
 src/lib-lda/lda-settings.c                         |    2 +
 src/lib-lda/lda-settings.h                         |    1 +
 src/lib-lda/mail-deliver.h                         |    4 +-
 src/lib-mail/message-parser.c                      |  115 +++++++--------
 src/lib-master/master-auth.c                       |    2 +-
 src/lib-master/master-service-settings.c           |   10 +-
 src/lib-settings/settings-parser.c                 |    4 +-
 src/lib-sql/driver-mysql.c                         |   39 ++---
 src/lib-sql/driver-sqlpool.c                       |   89 +++++-------
 src/lib-storage/index/dbox-multi/mdbox-save.c      |    4 +-
 src/lib-storage/index/index-mail.c                 |    2 +-
 src/lib-storage/index/maildir/maildir-mail.c       |   13 +-
 src/lib-storage/index/maildir/maildir-save.c       |   10 +-
 src/lib-storage/index/maildir/maildir-sync-index.c |    2 +-
 src/lib-storage/index/maildir/maildir-uidlist.c    |  151 ++++++++++++---------
 src/lib-storage/index/maildir/maildir-uidlist.h    |   12 +-
 src/lib-storage/index/shared/shared-list.c         |    4 +-
 src/lib-storage/index/shared/shared-storage.c      |    2 +-
 src/lib-storage/list/mailbox-list-fs.c             |    5 +-
 src/lib-storage/list/mailbox-list-maildir.c        |   12 +-
 src/lib-storage/list/mailbox-list-none.c           |    2 +-
 src/lib-storage/mail-namespace.c                   |   41 ++++-
 src/lib-storage/mail-storage.c                     |   13 +-
 src/lib-storage/mailbox-list-private.h             |   10 +-
 src/lib-storage/mailbox-list.c                     |   13 +-
 src/lib-storage/mailbox-list.h                     |    3 +
 src/lib/Makefile.am                                |    1 -
 src/lib/eacces-error.c                             |    7 +-
 src/lib/failures.c                                 |   44 ++++--
 src/lib/fdpass.c                                   |   11 +-
 src/lib/iostream.c                                 |    2 +-
 src/lib/istream-crlf.c                             |   76 ++++++++--
 src/lib/istream.c                                  |   21 +-
 src/lib/lib-signals.c                              |    8 +
 src/lib/lib-signals.h                              |   11 +
 src/lib/mempool-alloconly.c                        |   27 +---
 src/lib/mempool-system-clean.c                     |  175 -------------------------
 src/lib/mempool.h                                  |    8 -
 src/lib/restrict-access.c                          |    2 +-
 src/lmtp/commands.c                                |    8 +-
 src/lmtp/main.c                                    |   10 +-
 src/login-common/client-common-auth.c              |    8 +-
 src/login-common/login-proxy-state.c               |    3 +-
 src/login-common/ssl-proxy-openssl.c               |    2 +-
 src/master/master-settings.c                       |    4 +-
 src/master/service-monitor.c                       |    6 +-
 src/plugins/acl/acl-backend-vfile.c                |    6 +-
 src/plugins/acl/acl-lookup-dict.c                  |    4 +-
 src/plugins/acl/acl-mailbox-list.c                 |    7 +-
 src/plugins/fts/fts-storage.c                      |   39 ++++-
 src/plugins/quota/doveadm-quota.c                  |    4 +-
 src/plugins/quota/quota-private.h                  |    2 +-
 src/plugins/quota/quota.c                          |   46 +++++-
 src/plugins/zlib/istream-bzlib.c                   |    3 +-
 src/plugins/zlib/istream-zlib.c                    |    3 +-
 89 files changed, 838 insertions(+), 648 deletions(-)

diffs (truncated from 3360 to 300 lines):

diff -r 0754787eb000 -r 44e0d823bd1f .hgsigs
--- a/.hgsigs	Thu Sep 16 19:14:35 2010 +0100
+++ b/.hgsigs	Thu Sep 16 19:15:21 2010 +0100
@@ -15,3 +15,4 @@
 c5de2eb14a97e269cc3c6874fc6fdbafdac4edca 0 iEYEABECAAYFAkxljW0ACgkQyUhSUUBVislzOgCePgpbqsyJnDL2peSNvpS6ygVlTEEAn0B5PbmFdPTrelnSoneyG/CgmNVs
 d0d3ba81d2052258b099b9f660866369a56d4a9c 0 iEYEABECAAYFAkxpTKEACgkQyUhSUUBVisnZHgCfW/F0r/rVwHaxm7DNeisa2FVprooAn2c17typ1b38O+sagsqwD1IbPYzf
 8baa8ccb40216d626b9ca66309fca9437a76e6e2 0 iEYEABECAAYFAkxz/QQACgkQyUhSUUBViskVrwCfcB/267/lsPntHEyCkn5nG0cEP34AnjN9AzBApHkaHiDViRxS697HXbMj
+f4eb5306587964fee1074235de19c2c395249156 0 iEYEABECAAYFAkyHvBIACgkQyUhSUUBVismKMACfe7pcnrMHVmdmaUNgvyIperV9Uw4AoJ7bU7dh9SCPE868D3if2bcWNJHa
diff -r 0754787eb000 -r 44e0d823bd1f .hgtags
--- a/.hgtags	Thu Sep 16 19:14:35 2010 +0100
+++ b/.hgtags	Thu Sep 16 19:15:21 2010 +0100
@@ -52,3 +52,4 @@
 c5de2eb14a97e269cc3c6874fc6fdbafdac4edca 2.0.rc6
 d0d3ba81d2052258b099b9f660866369a56d4a9c 2.0.0
 8baa8ccb40216d626b9ca66309fca9437a76e6e2 2.0.1
+f4eb5306587964fee1074235de19c2c395249156 2.0.2
diff -r 0754787eb000 -r 44e0d823bd1f NEWS
--- a/NEWS	Thu Sep 16 19:14:35 2010 +0100
+++ b/NEWS	Thu Sep 16 19:15:21 2010 +0100
@@ -1,3 +1,15 @@
+v2.0.2 2010-09-08  Timo Sirainen <tss at iki.fi>
+
+	* vpopmail support is disabled for now, since it's broken. You can use
+	  it via checkpassword support or its sql/ldap database directly.
+
+	- maildir: Fixed "duplicate uidlist entry" errors that happened at
+	  least with LMTP when mail was delivered to multiple recipients
+	- Deleting ACLs didn't cause entries to be removed from acl_shared_dict
+	- mail_max_lock_timeout setting wasn't working with all locks
+	- auth_cache_size setting's old-style value wasn't autoconverted
+	  and it usually also caused a crash
+
 v2.0.1 2010-08-24  Timo Sirainen <tss at iki.fi>
 
 	* When dsync is started as root, remote dsync command is now also
diff -r 0754787eb000 -r 44e0d823bd1f TODO
--- a/TODO	Thu Sep 16 19:14:35 2010 +0100
+++ b/TODO	Thu Sep 16 19:15:21 2010 +0100
@@ -1,5 +1,8 @@
  - dbox attachments:
    - make sure attachments aren't opened while fetching other mime parts
+ - sql pool: if async query is pending and sync query is sent and there
+   are no more empty connections, it should flush the async query first
+ - DELETEACL doesn't update shared dict
  - NTLMv1 and LM should be disabled if disable_plaintext_auth=yes
  - SEARCH SENT*/HEADER/etc. doesn't seem optimized when using with TEXT/BODY
 
diff -r 0754787eb000 -r 44e0d823bd1f configure.in
--- a/configure.in	Thu Sep 16 19:14:35 2010 +0100
+++ b/configure.in	Thu Sep 16 19:15:21 2010 +0100
@@ -1,5 +1,5 @@
 AC_PREREQ([2.59])
-AC_INIT([Dovecot],[2.0.1],[dovecot at dovecot.org])
+AC_INIT([Dovecot],[2.0.2],[dovecot at dovecot.org])
 AC_CONFIG_SRCDIR([src])
 
 AM_INIT_AUTOMAKE([foreign])
@@ -112,9 +112,9 @@
 			vpopmail_home="$withval"
 			want_vpopmail=yes
 		fi
+		AC_ERROR([vpopmail support is broken. fix it or access its db another way.])
 	fi, [
-		want_vpopmail=auto
-		vpopmail_home="`echo ~vpopmail`"
+		want_vpopmail=no
 	])
 
 # Berkeley DB support is more or less broken. Disabled for now.
@@ -238,12 +238,7 @@
 	mail_storages="shared maildir mbox sdbox mdbox cydir")
 AC_SUBST(mail_storages)
 
-AC_ARG_WITH(moduledir,
-[  --with-moduledir=DIR    Base directory for dynamically loadable modules],
-	moduledir="$withval",
-	moduledir=$libdir/dovecot
-)
-AC_SUBST(moduledir)
+DC_DOVECOT_MODULEDIR
 
 AC_ARG_WITH(docs,
 [  --with-docs             Install documentation (default)],
diff -r 0754787eb000 -r 44e0d823bd1f doc/example-config/conf.d/15-lda.conf
--- a/doc/example-config/conf.d/15-lda.conf	Thu Sep 16 19:14:35 2010 +0100
+++ b/doc/example-config/conf.d/15-lda.conf	Thu Sep 16 19:15:21 2010 +0100
@@ -1,5 +1,5 @@
 ##
-## LDA specific settings
+## LDA specific settings (also used by LMTP)
 ##
 
 # Address to use when sending rejection mails.
@@ -28,6 +28,11 @@
 # Delimiter character between local-part and detail in email address.
 #recipient_delimiter = +
 
+# Header where the original recipient address (SMTP's RCPT TO: address) is taken
+# from if not available elsewhere. With dovecot-lda -a parameter overrides this. 
+# A commonly used header for this is X-Original-To.
+#lda_original_recipient_header =
+
 # Should saving a mail to a nonexistent mailbox automatically create it?
 #lda_mailbox_autocreate = no
 
diff -r 0754787eb000 -r 44e0d823bd1f dovecot.m4
--- a/dovecot.m4	Thu Sep 16 19:14:35 2010 +0100
+++ b/dovecot.m4	Thu Sep 16 19:15:21 2010 +0100
@@ -6,7 +6,16 @@
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 2
+# serial 3
+
+AC_DEFUN([DC_DOVECOT_MODULEDIR],[
+	AC_ARG_WITH(moduledir,
+	[  --with-moduledir=DIR    Base directory for dynamically loadable modules],
+		moduledir="$withval",
+		moduledir=$libdir/dovecot
+	)
+	AC_SUBST(moduledir)
+])
 
 AC_DEFUN([DC_PLUGIN_DEPS],[
 	_plugin_deps=yes
@@ -49,7 +58,7 @@
 
 	eval `grep -i '^dovecot_[[a-z]]*=' "$dovecotdir"/dovecot-config`
 	eval `grep '^LIBDOVECOT[[A-Z_]]*=' "$dovecotdir"/dovecot-config`
-	AX_SUBST_L([dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir])
+	AX_SUBST_L([dovecotdir], [dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir])
 	AX_SUBST_L([DOVECOT_CFLAGS], [DOVECOT_LIBS], [DOVECOT_SSL_LIBS])
 	AX_SUBST_L([LIBDOVECOT], [LIBDOVECOT_LOGIN], [LIBDOVECOT_SQL], [LIBDOVECOT_LDA], [LIBDOVECOT_STORAGE])
 	AX_SUBST_L([LIBDOVECOT_DEPS], [LIBDOVECOT_LOGIN_DEPS], [LIBDOVECOT_SQL_DEPS], [LIBDOVECOT_LDA_DEPS], [LIBDOVECOT_STORAGE_DEPS])
diff -r 0754787eb000 -r 44e0d823bd1f src/auth/auth-cache.c
--- a/src/auth/auth-cache.c	Thu Sep 16 19:14:35 2010 +0100
+++ b/src/auth/auth-cache.c	Thu Sep 16 19:15:21 2010 +0100
@@ -242,7 +242,7 @@
 		sizeof(node->data) + data_size;
 
 	/* make sure we have enough space */
-	while (cache->size_left < alloc_size)
+	while (cache->size_left < alloc_size && cache->tail != NULL)
 		auth_cache_node_destroy(cache, cache->tail);
 
 	node = hash_table_lookup(cache->hash, str_c(str));
diff -r 0754787eb000 -r 44e0d823bd1f src/auth/auth-settings.c
--- a/src/auth/auth-settings.c	Thu Sep 16 19:14:35 2010 +0100
+++ b/src/auth/auth-settings.c	Thu Sep 16 19:15:21 2010 +0100
@@ -256,7 +256,7 @@
 
 /* <settings checks> */
 static bool auth_settings_check(void *_set, pool_t pool,
-				const char **error_r ATTR_UNUSED)
+				const char **error_r)
 {
 	struct auth_settings *set = _set;
 	const char *p;
@@ -266,6 +266,15 @@
 	if (set->debug)
 		set->verbose = TRUE;
 
+	if (set->cache_size > 0 && set->cache_size < 1024) {
+		/* probably a configuration error.
+		   older versions used megabyte numbers */
+		*error_r = t_strdup_printf("auth_cache_size value is too small "
+					   "(%"PRIuUOFF_T" bytes)",
+					   set->cache_size);
+		return FALSE;
+	}
+
 	if (*set->username_chars == '\0') {
 		/* all chars are allowed */
 		memset(set->username_chars_map, 1,
diff -r 0754787eb000 -r 44e0d823bd1f src/auth/auth-worker-server.c
--- a/src/auth/auth-worker-server.c	Thu Sep 16 19:14:35 2010 +0100
+++ b/src/auth/auth-worker-server.c	Thu Sep 16 19:15:21 2010 +0100
@@ -9,6 +9,7 @@
 #include "ostream.h"
 #include "hex-binary.h"
 #include "str.h"
+#include "eacces-error.h"
 #include "auth-request.h"
 #include "auth-worker-client.h"
 #include "auth-worker-server.h"
@@ -153,8 +154,13 @@
 
 	fd = net_connect_unix_with_retries(worker_socket_path, 5000);
 	if (fd == -1) {
-		i_fatal("net_connect_unix(%s) failed: %m",
-			worker_socket_path);
+		if (errno == EACCES) {
+			i_fatal("%s", eacces_error_get("net_connect_unix",
+						       worker_socket_path));
+		} else {
+			i_fatal("net_connect_unix(%s) failed: %m",
+				worker_socket_path);
+		}
 	}
 
 	conn = i_new(struct auth_worker_connection, 1);
diff -r 0754787eb000 -r 44e0d823bd1f src/auth/userdb-static.c
--- a/src/auth/userdb-static.c	Thu Sep 16 19:14:35 2010 +0100
+++ b/src/auth/userdb-static.c	Thu Sep 16 19:15:21 2010 +0100
@@ -203,8 +203,14 @@
 				       AUTH_REQUEST_STATE_MECH_CONTINUE);
 
 		auth_request->context = ctx;
-		auth_request_lookup_credentials(auth_request, "",
-						static_credentials_callback);
+		if (auth_request->passdb != NULL) {
+			auth_request_lookup_credentials(auth_request, "",
+				static_credentials_callback);
+		} else {
+			static_credentials_callback(
+				PASSDB_RESULT_SCHEME_NOT_AVAILABLE,
+				NULL, 0, auth_request);
+		}
 	} else {
 		static_lookup_real(auth_request, callback);
 	}
diff -r 0754787eb000 -r 44e0d823bd1f src/config/config-parser.c
--- a/src/config/config-parser.c	Thu Sep 16 19:14:35 2010 +0100
+++ b/src/config/config-parser.c	Thu Sep 16 19:15:21 2010 +0100
@@ -26,8 +26,6 @@
 #  define GLOB_BRACE 0
 #endif
 
-#define IS_WHITE(c) ((c) == ' ' || (c) == '\t')
-
 static const enum settings_parser_flags settings_parser_flags =
 	SETTINGS_PARSER_FLAG_IGNORE_UNKNOWN_KEYS |
 	SETTINGS_PARSER_FLAG_TRACK_CHANGES;
@@ -568,10 +566,10 @@
 			*value_r = "Expecting '='";
 			return CONFIG_LINE_TYPE_ERROR;
 		}
-		if (line[1] != '\0') {
-			*value_r = "Garbage after '{'";
-			return CONFIG_LINE_TYPE_ERROR;
-		}
+	}
+	if (line[1] != '\0') {
+		*value_r = "Garbage after '{'";
+		return CONFIG_LINE_TYPE_ERROR;
 	}
 	return CONFIG_LINE_TYPE_SECTION_BEGIN;
 }
diff -r 0754787eb000 -r 44e0d823bd1f src/config/config-parser.h
--- a/src/config/config-parser.h	Thu Sep 16 19:14:35 2010 +0100
+++ b/src/config/config-parser.h	Thu Sep 16 19:15:21 2010 +0100
@@ -3,6 +3,8 @@
 
 #define CONFIG_MODULE_DIR MODULEDIR"/settings"
 
+#define IS_WHITE(c) ((c) == ' ' || (c) == '\t')
+
 struct config_module_parser {
 	const struct setting_parser_info *root;
 	struct setting_parser_context *parser;
diff -r 0754787eb000 -r 44e0d823bd1f src/config/doveconf.c
--- a/src/config/doveconf.c	Thu Sep 16 19:14:35 2010 +0100
+++ b/src/config/doveconf.c	Thu Sep 16 19:15:21 2010 +0100
@@ -7,6 +7,7 @@
 #include "env-util.h"
 #include "ostream.h"
 #include "str.h"
+#include "strescape.h"
 #include "settings-parser.h"
 #include "master-service.h"
 #include "all-settings.h"
@@ -146,6 +147,20 @@
 	pool_unref(&ctx->pool);
 }
 
+static bool value_need_quote(const char *value)
+{
+	unsigned int len = strlen(value);
+
+	if (len == 0)
+		return FALSE;
+
+	if (strchr(value, '#') != NULL)
+		return TRUE;
+	if (IS_WHITE(value[0]) || IS_WHITE(value[len-1]))
+		return TRUE;
+	return FALSE;
+}
+
 static int
 config_dump_human_output(struct config_dump_human_context *ctx,
 			 struct ostream *output, unsigned int indent,
@@ -271,7 +286,13 @@
 		value = strchr(key, '=');
 		o_stream_send(output, key, value-key);
 		o_stream_send_str(output, " = ");
-		o_stream_send_str(output, value+1);
+		if (!value_need_quote(value+1))
+			o_stream_send_str(output, value+1);


More information about the dovecot-cvs mailing list