dovecot-2.0: Merged 2.0 changes.

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


details:   http://hg.dovecot.org/dovecot-2.0/rev/968a4dd6240a
changeset: 12256:968a4dd6240a
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 24 17:03:40 2010 +0100
description:
Merged 2.0 changes.

diffstat:

 .hgsigs                                  |   2 +
 .hgtags                                  |   2 +
 NEWS                                     |  52 ++++++++++------
 configure.in                             |   6 +-
 doc/example-config/conf.d/10-master.conf |  10 +++
 doc/example-config/dovecot-ldap.conf.ext |   3 +-
 doc/man/dsync.1.in                       |  64 ++++++++++++++++++++-
 src/auth/auth-request-handler.c          |  16 ++++-
 src/auth/auth-request.c                  |  12 +++-
 src/auth/db-sql.c                        |   4 +
 src/dsync/dsync-brain.c                  |   6 ++
 src/dsync/dsync-proxy-client.c           |  10 +++-
 src/dsync/dsync.c                        |  14 ++--
 src/imap/cmd-select.c                    |  27 ++++----
 src/imap/imap-fetch.c                    |   5 +-
 src/lib-imap/imap-seqset.c               |  12 ++++
 src/lib-imap/imap-seqset.h               |   2 +
 src/lib-index/mail-index.c               |  18 ++----
 src/lib-master/master-service.c          |  15 ++++-
 src/lib-master/service-settings.h        |   7 ++
 src/lib-sql/driver-pgsql.c               |   3 +
 src/lib-sql/driver-sqlpool.c             |  20 ++++--
 src/lib-sql/sql-api.h                    |   2 +-
 src/lib-storage/mail-namespace.c         |  11 ++-
 src/lib-storage/mail-storage-private.h   |   2 +
 src/lib-storage/mail-storage-service.c   |  13 +++-
 src/lib-storage/mail-storage.c           |  12 +++-
 src/lib/buffer.c                         |   1 +
 src/lib/eacces-error.c                   |   4 +
 src/lib/unichar.c                        |  22 +++---
 src/lib/unichar.h                        |   8 ++-
 src/master/master-settings.c             |  17 ++++-
 src/master/service-process.c             |  11 ++-
 src/master/service.c                     |  87 ++++++++++++++++++++++-------
 src/plugins/fts-solr/fts-backend-solr.c  |  31 ++++++++++
 src/plugins/quota/quota-storage.c        |   3 +
 src/pop3-login/client.c                  |   5 +
 37 files changed, 411 insertions(+), 128 deletions(-)

diffs (truncated from 1201 to 300 lines):

diff -r 15127cfac241 -r 968a4dd6240a .hgsigs
--- a/.hgsigs	Tue Aug 24 17:03:29 2010 +0100
+++ b/.hgsigs	Tue Aug 24 17:03:40 2010 +0100
@@ -12,3 +12,5 @@
 a15b694f1d64a81eea7959fe34780e9e50356321 0 iEYEABECAAYFAkxGDMMACgkQyUhSUUBViskQUgCfQKbLIx86lOpNuRNE82D4H6aLhx4AoJ1f1CALKXTppHewftXLydxS7qg1
 71b2cb9895d92e2e3c80ecdd351055ab848a4ed6 0 iEYEABECAAYFAkxZwBUACgkQyUhSUUBViskB9ACgmIAgI3syzyHQU7NMwuqJywjCnUMAnA+AnvUgDc7ewsBJMog2F8OkQ0KB
 4a2d840a80bbe85e2101e3a5fb19424c3050f923 0 iEYEABECAAYFAkxhYVUACgkQyUhSUUBVisllmwCdFEJ8CzPbbzKZSKJbmgPTQj4lgP0AoKZXDAxxrs+lWB1kp3ECTyX3gW5T
+c5de2eb14a97e269cc3c6874fc6fdbafdac4edca 0 iEYEABECAAYFAkxljW0ACgkQyUhSUUBVislzOgCePgpbqsyJnDL2peSNvpS6ygVlTEEAn0B5PbmFdPTrelnSoneyG/CgmNVs
+d0d3ba81d2052258b099b9f660866369a56d4a9c 0 iEYEABECAAYFAkxpTKEACgkQyUhSUUBVisnZHgCfW/F0r/rVwHaxm7DNeisa2FVprooAn2c17typ1b38O+sagsqwD1IbPYzf
diff -r 15127cfac241 -r 968a4dd6240a .hgtags
--- a/.hgtags	Tue Aug 24 17:03:29 2010 +0100
+++ b/.hgtags	Tue Aug 24 17:03:40 2010 +0100
@@ -49,3 +49,5 @@
 a15b694f1d64a81eea7959fe34780e9e50356321 2.0.rc3
 71b2cb9895d92e2e3c80ecdd351055ab848a4ed6 2.0.rc4
 4a2d840a80bbe85e2101e3a5fb19424c3050f923 2.0.rc5
+c5de2eb14a97e269cc3c6874fc6fdbafdac4edca 2.0.rc6
+d0d3ba81d2052258b099b9f660866369a56d4a9c 2.0.0
diff -r 15127cfac241 -r 968a4dd6240a NEWS
--- a/NEWS	Tue Aug 24 17:03:29 2010 +0100
+++ b/NEWS	Tue Aug 24 17:03:40 2010 +0100
@@ -1,3 +1,34 @@
+v2.0.0 2010-08-16  Timo Sirainen <tss at iki.fi>
+
+	* Dovecot uses two system users for internal purposes now by default:
+	  dovenull and dovecot. You need to create the dovenull user or change
+	  default_login_user setting.
+	* Global ACLs are now looked up using namespace prefixes. For example
+	  if you previously had INBOX. namespace prefix and a global ACL for
+	  "INBOX.Sent", it's now looked up from "INBOX.Sent" file instead of
+	  "Sent" as before.
+	* Maildir: File permissions are no longer based on dovecot-shared file,
+	  but the mailbox directory.
+
+	+ Redesigned master process. It's now more modular and there is less
+	  code running as root.
+	+ Configuration supports now per-local/remote ip/network settings.
+	+ dsync utility does a two-way mailbox synchronization.
+	+ LMTP server and proxying.
+	+ Added mdbox (multi-dbox) mail storage backend.
+	+ doveadm utility can be used to do all kinds of administration
+	  functions. Old dovecotpw and *view utilities now exist in its
+	  subcommands.
+	+ imap and pop3 processes can now handle multiple connections.
+	+ IMAP: COMPRESS=DEFLATE is supported by imap_zlib plugin
+	+ director service helps NFS installations to redirect users always
+	  to same server to avoid corruption
+
+v2.0.rc6 2010-08-13  Timo Sirainen <tss at iki.fi>
+
+	- dict quota didn't always decrease quota when messages were expunged
+	- Shared INBOX wasn't always listed with FS layout
+
 v2.0.rc5 2010-08-09  Timo Sirainen <tss at iki.fi>
 
 	- Using more than 2 plugins could have caused broken behavior
@@ -53,26 +84,7 @@
 
 v2.0.rc1 2010-07-02  Timo Sirainen <tss at iki.fi>
 
-	* Global ACLs are now looked up using namespace prefixes. For example
-	  if you previously had INBOX. namespace prefix and a global ACL for
-	  "INBOX.Sent", it's now looked up from "INBOX.Sent" file instead of
-	  "Sent" as before.
-	* Maildir: File permissions are no longer based on dovecot-shared file,
-	  but the mailbox directory.
-
-	+ Redesigned master process. It's now more modular and there is less
-	  code running as root.
-	+ Configuration supports now per-local/remote ip/network settings.
-	+ dsync utility does a two-way mailbox synchronization.
-	+ LMTP server and proxying.
-	+ Added mdbox (multi-dbox) mail storage backend.
-	+ doveadm utility can be used to do all kinds of administration
-	  functions. Old dovecotpw and *view utilities now exist in its
-	  subcommands.
-	+ imap and pop3 processes can now handle multiple connections.
-	+ IMAP: COMPRESS=DEFLATE is supported by imap_zlib plugin
-	+ director service helps NFS installations to redirect users always
-	  to same server to avoid corruption
+	* See v2.0.0 notes
 
 v1.2.6 2009-10-05  Timo Sirainen <tss at iki.fi>
 
diff -r 15127cfac241 -r 968a4dd6240a configure.in
--- a/configure.in	Tue Aug 24 17:03:29 2010 +0100
+++ b/configure.in	Tue Aug 24 17:03:40 2010 +0100
@@ -1,5 +1,5 @@
 AC_PREREQ([2.59])
-AC_INIT([Dovecot],[2.0.rc5],[dovecot at dovecot.org])
+AC_INIT([Dovecot],[2.0.0],[dovecot at dovecot.org])
 AC_CONFIG_SRCDIR([src])
 
 AM_INIT_AUTOMAKE([foreign])
@@ -186,6 +186,7 @@
 		want_gnutls=no
 		want_openssl=no
 	elif test x$withval = xgnutls; then
+		AC_ERROR([GNUTLS support is broken currently])
 		want_gnutls=yes
 		want_openssl=no
 	elif test x$withval = xopenssl; then
@@ -2740,6 +2741,3 @@
 if test "$not_sql_drivers" != ""; then
   echo "                 :$not_sql_drivers"
 fi
-
-echo
-echo "NOTE: This is the UNSTABLE development branch of Dovecot v2.0."
diff -r 15127cfac241 -r 968a4dd6240a doc/example-config/conf.d/10-master.conf
--- a/doc/example-config/conf.d/10-master.conf	Tue Aug 24 17:03:29 2010 +0100
+++ b/doc/example-config/conf.d/10-master.conf	Tue Aug 24 17:03:40 2010 +0100
@@ -95,3 +95,13 @@
   # $default_internal_user.
   #user = root
 }
+
+service dict {
+  # If dict proxy is used, mail processes should have access to its socket.
+  # For example: mode=0660, group=vmail and global mail_access_groups=vmail
+  unix_listener dict {
+    #mode = 0600
+    #user = 
+    #group = 
+  }
+}
diff -r 15127cfac241 -r 968a4dd6240a doc/example-config/dovecot-ldap.conf.ext
--- a/doc/example-config/dovecot-ldap.conf.ext	Tue Aug 24 17:03:29 2010 +0100
+++ b/doc/example-config/dovecot-ldap.conf.ext	Tue Aug 24 17:03:40 2010 +0100
@@ -44,9 +44,10 @@
 # TLS options, currently supported only with OpenLDAP:
 #tls_ca_cert_file =
 #tls_ca_cert_dir =
+#tls_cipher_suite =
+# TLS cert/key is used only if LDAP server requires a client certificate.
 #tls_cert_file =
 #tls_key_file =
-#tls_cipher_suite =
 # Valid values: never, hard, demand, allow, try
 #tls_require_cert =
 
diff -r 15127cfac241 -r 968a4dd6240a doc/man/dsync.1.in
--- a/doc/man/dsync.1.in	Tue Aug 24 17:03:29 2010 +0100
+++ b/doc/man/dsync.1.in	Tue Aug 24 17:03:40 2010 +0100
@@ -19,15 +19,56 @@
 It can be used for several different use cases:
 Two\-way synchronization of mailboxes in different servers (via
 .BR ssh (1)),
-creating backups of mails to a remote server, and convert mailboxes
-from/to different mailbox formats.
+creating backups of mails to a remote server, and convert mailboxes from/to
+different mailbox formats.
 .PP
+The syncing is done as perfectly as possible: an IMAP or a POP3 client
+shouldn\(aqt be able to notice any differences between the two mailboxes.
+Two\-way syncing means that it\(aqs safe to do any kind of modifications in
+both sides, and
+.B dsync
+will merge the changes without losing any changes done on either side. This
+is possible because
+.B dsync
+can access Dovecot\(aqs index logs that keep track of changes. It\(aqs of
+course possible to have conflicts during merging, these are resolved in a
+safe way. See the
+.B dsync
+design document for more information.
+.PP
+.B dsync
+uses the same configuration files as the rest of Dovecot (via doveconf
+binary). The entire configuration can be changed by giving \-c parameter to
+another configuration file, or using \-o parameter to override specific
+settings. When executing a remote
+.B dsync
+program it works the same way: it uses its own local configuration.
+.PP
+.B dsync
+can be run completely standalone. It doesn\(aqt require any Dovecot server
+processes to be running, except when using \-u parameter to do a userdb
+lookup from auth process.
+.PP
+.B dsync
+can currently sync only one user at a time. If you want to
+.B dsync
+all users, you\(aqll need to get a list of all users and execute
+.B dsync
+separately for each one.
+
 Any errors are written to stderr.
 .\"------------------------------------------------------------------------
 .SH OPTIONS
 .B dsync
 recognizes the following command line options:
 .TP
+.BI \-c \ config\-file
+read configuration from the given
+.IR config\-file .
+By default
+.I @pkgsysconfdir@/dovecot.conf
+will be used.
+.\"---------------------------------
 .BI \-C\  alt_char
 Specifies an alternative mailbox name character.
 If source and destination mailbox formats are different, it\(aqs possible
@@ -148,6 +189,23 @@
 No changes are ever done to the source location.
 Any changes done in destination are discarded.
 .\"------------------------------------------------------------------------
+.SH "EXIT STATUS"
+.B dsync
+will exit with one of the following values:
+.TP 4
+.B 0
+Synchronization was done perfectly.
+.TP
+.B 2
+Synchronization was done without errors, but some changes couldn\(aqt be done,
+so the mailboxes aren\(aqt perfectly synchronized. Running dsync again
+usually fixes this. Typically this occurs for message modification
+sequences with newly created mailboxes. It can also occur if one of the
+mailboxes change during the syncing.
+.TP
+.B 1, >2
+Synchronization failed.
+.\"------------------------------------------------------------------------
 .SH EXAMPLE
 .SS MIRRORING
 Mirror mailboxes to a remote server.
@@ -163,7 +221,7 @@
 .PP
 .RS
 .nf
-.B dsync \-u username mirror ssh mailuser at example.com dsync \-u username
+.B dsync \-u username mirror ssh \-i id_dsa.dovecot mailuser at example.com dsync \-u username
 .fi
 .RE
 .\"------------------------------------------------------------------------
diff -r 15127cfac241 -r 968a4dd6240a src/auth/auth-request-handler.c
--- a/src/auth/auth-request-handler.c	Tue Aug 24 17:03:29 2010 +0100
+++ b/src/auth/auth-request-handler.c	Tue Aug 24 17:03:40 2010 +0100
@@ -66,10 +66,22 @@
 	while (hash_table_iterate(iter, &key, &value)) {
 		struct auth_request *auth_request = value;
 
-		auth_request_unref(&auth_request);
+		switch (auth_request->state) {
+		case AUTH_REQUEST_STATE_NEW:
+		case AUTH_REQUEST_STATE_MECH_CONTINUE:
+		case AUTH_REQUEST_STATE_FINISHED:
+			auth_request_unref(&auth_request);
+			hash_table_remove(handler->requests, key);
+			break;
+		case AUTH_REQUEST_STATE_PASSDB:
+		case AUTH_REQUEST_STATE_USERDB:
+			/* can't abort a pending passdb/userdb lookup */
+			break;
+		case AUTH_REQUEST_STATE_MAX:
+			i_unreached();
+		}
 	}
 	hash_table_iterate_deinit(&iter);
-	hash_table_clear(handler->requests, TRUE);
 }
 
 void auth_request_handler_unref(struct auth_request_handler **_handler)
diff -r 15127cfac241 -r 968a4dd6240a src/auth/auth-request.c
--- a/src/auth/auth-request.c	Tue Aug 24 17:03:29 2010 +0100
+++ b/src/auth/auth-request.c	Tue Aug 24 17:03:40 2010 +0100
@@ -172,6 +172,8 @@
 	}
 	auth_stream_reply_add(reply, "original_username",
 			      request->original_username);
+	auth_stream_reply_add(reply, "requested_login_user",
+			      request->requested_login_user);
 
 	if (request->local_ip.family != 0) {
 		auth_stream_reply_add(reply, "lip",
@@ -208,6 +210,8 @@
 		request->master_user = p_strdup(request->pool, value);
 	else if (strcmp(key, "original_username") == 0)
 		request->original_username = p_strdup(request->pool, value);
+	else if (strcmp(key, "requested_login_user") == 0)
+		request->requested_login_user = p_strdup(request->pool, value);
 	else if (strcmp(key, "cert_username") == 0) {
 		if (request->set->ssl_username_from_cert) {
 			/* get username from SSL certificate. it overrides
@@ -949,7 +953,13 @@
 
         request->requested_login_user =
                 auth_request_fix_username(request, username, error_r);
-	return request->requested_login_user != NULL;
+	if (request->requested_login_user == NULL)
+		return FALSE;
+
+	auth_request_log_debug(request, "auth",
+			       "Master user lookup for login: %s",
+			       request->requested_login_user);
+	return TRUE;
 }
 
 static void auth_request_validate_networks(struct auth_request *request,


More information about the dovecot-cvs mailing list