Timo Sirainen [Thu, 16 Apr 2015 11:19:51 +0000 (14:19 +0300)]
doveadm mailbox metadata: The keys must always be lowercased.
The keys need to be case-insensitive in IMAP, so the IMAP code always also
lowercases them.
Phil Carmody [Thu, 16 Apr 2015 08:46:22 +0000 (11:46 +0300)]
lib: test-array build warnings on Solaris 10
Solaris cc doesn't think I've read N1570 6.7.9p11, 6.5.16.1p2, and 6.3.1.3p2,
and wants to save me from myself.
Reported-by: Juergen Obermann <http://www.dovecot.org/list/dovecot/2015-April/100427.html> Signed-off-by: Phil Carmody <phil@dovecot.fi>
Timo Sirainen [Wed, 15 Apr 2015 18:01:11 +0000 (21:01 +0300)]
imapc: Added imapc_features=zimbra-workarounds
Zimbra (at least v5.0.18_GA_3011.RHEL4_64) can return different headers
depending on whether the whole message body was fetched or only (partial)
headers. This probably happens only for invalid characters that are
translated into '?'. With this workaround enabled we don't use FETCH
BODY.PEEK[], but we do FETCH (BODY.PEEK[HEADER] BODY.PEEK[TEXT]) and merge
the results together. This way the results are always consistent and headers
don't suddenly change.
Timo Sirainen [Tue, 14 Apr 2015 06:58:01 +0000 (09:58 +0300)]
dict-file: Use tabescaping for keys and values to allow LFs in them.
Although this makes the format slightly incompatible, it's doubtful anybody
is using dict values containing \001 characters.
Timo Sirainen [Wed, 8 Apr 2015 04:55:35 +0000 (13:55 +0900)]
lib: Added json-tree API for parsing JSON input into a tree structure.
This makes it easier to access complicated JSON structs that can fit into
memory.
Timo Sirainen [Fri, 27 Mar 2015 13:12:50 +0000 (15:12 +0200)]
imapc: Don't assert-crash when trying to sync a mailbox with MAILBOX_FLAG_SAVEONLY.
We can just skip the sync, because we don't do anything except save mails.
Timo Sirainen [Fri, 27 Mar 2015 12:31:01 +0000 (14:31 +0200)]
quota: When reporting quota value/limit in kilobytes, round the value upwards.
Most importantly this doesn't truncate <1024 values to 0, which also in
quota limit means unlimited.
Timo Sirainen [Sun, 22 Mar 2015 18:54:29 +0000 (20:54 +0200)]
lib-storage: Added mailbox_list_fs_get_list()
Using mailbox_list_init_fs() now sets the mailbox_list pointer to root fs,
which allows the fs backends to lookup the list. Although this can't be done
in the init() function since the list is set only afterwards.
Timo Sirainen [Sun, 22 Mar 2015 18:52:16 +0000 (20:52 +0200)]
lib-fs: When autoloading fs plugins with '-' in the name, translate them to '_'
It's not possible for the function names to contain '-' in any case. Also
Dovecot in general uses '-' instead of '_' in the configuration names. This
change actually allows using either of them.
Timo Sirainen [Fri, 20 Mar 2015 11:27:00 +0000 (13:27 +0200)]
Removed mountpoint checking and updating code.
After a few years it seems like it has just caused more problems than it has
actually fixed. The only thing it's been used for is to make sure that
Dovecot can't create empty user directories when the user's mail filesystem
isn't mounted. But that's supposed to be normally prevented already if the
mount root directory permissions are only writable by root.
For now the mountpoint listing code and doveadm mount code still exists just
in case people have some scripts using those. Those could be removed in v2.3.
If we somehow figured out which mountpoints existed (not so easy because
they could be only visible in userdb lookups for different users), we could
maybe create some kind of a script that checks the permissions at startup.
This would work with Linux at least:
mkdir test
mount / -o bind test
ls -ld test/var/mail # assuming /var/mail mountpoint
umount test
Timo Sirainen [Wed, 18 Mar 2015 23:24:32 +0000 (01:24 +0200)]
imapc: Don't wait for login to succeed at mailbox list creation.
The failure will be visible in the next command. This wait was here mainly
for imap, but cbdfca7d24a6 implements the wait in imap process directly.
Other (current) protocols don't need such wait at all.
Most importantly this change allows doveadm to handle imapc login failures
by seeing them as MAIL_ERROR_PERM errors when listing mailboxes or opening a
mailbox. This allows it to return a different exit code from temporary
failure (which it is not).
Timo Sirainen [Wed, 18 Mar 2015 22:38:01 +0000 (00:38 +0200)]
imapc: If authentication fails, preserve the error message as storage/list error.
This isn't very helpful yet, because the mailbox list creation itself fails.
Phil Carmody [Wed, 18 Mar 2015 15:10:23 +0000 (17:10 +0200)]
lib: buffer - paranoid compile-time check for struct sizes
At the moment, nothing guarantees that the public struct is big
enough to contain the private struct.
Timo Sirainen [Mon, 16 Mar 2015 21:25:34 +0000 (23:25 +0200)]
auth ldap: Start LDAP connection only after auth process initialization is finished.
This way even if connecting to LDAP takes a while it won't cause the master
process to kill the auth process due to it not sending the startup "I'm ok"
notification early enough.
Timo Sirainen [Mon, 16 Mar 2015 21:17:39 +0000 (23:17 +0200)]
auth ldap: If any tls_* settings are given when they're not supported, fail with fatal instead of just warning.
These may be important for intended security, especially tls_cipher_suite.
We shouldn't allow setting them and then somewhat silently just ignore them.
Timo Sirainen [Mon, 16 Mar 2015 21:14:49 +0000 (23:14 +0200)]
auth ldap: Call ldap_init*() already at db_ldap_init().
ldap_init*() doesn't start connecting yet, but this way we can verify that
all the settings are correct.
Timo Sirainen [Mon, 16 Mar 2015 11:53:54 +0000 (13:53 +0200)]
stats: Initial stats refresh timeout callback wasn't set.
This broke after the ioloop change that caused stats_io_deactivate() not to
be called immediately anymore.
Timo Sirainen [Fri, 13 Mar 2015 18:08:34 +0000 (20:08 +0200)]
dsync: Added an extra "finish" state to allow slave-dsync to report error to master-dsync.
I'm not sure if that's actually necessary, but just trying to follow the
different possibilities on how dsync run can finish made me unsure about it.
This should make it at least clear that if a slave-dsync has a failure flag
set at deinit master-dsync will know about it before it returns success.
Timo Sirainen [Fri, 13 Mar 2015 14:04:01 +0000 (16:04 +0200)]
fts: If fts-parser fails, stop indexing instead of ignoring the error and continuing.
This is especially important in case there's just some temporary error.
Timo Sirainen [Fri, 13 Mar 2015 13:06:10 +0000 (15:06 +0200)]
Makefile: Avoid make race conditions when generating files that are used as dependencies.
The file creation needs to be atomic, otherwise another process can start
trying to use an unfinished file. So we first create .tmp file and then mv
it into the final one.
Timo Sirainen [Thu, 12 Mar 2015 13:42:31 +0000 (15:42 +0200)]
dict: cdb support should be available only to dict process.
Because otherwise we need to link libcdb into pretty much all Dovecot
binaries, which is part of what having the dict proxy tries to avoid.
We could implement the direct linking optionally as well, but that would
need to be done in a bit more generic way rather than just hardcoding it only
to cdb support.
Timo Sirainen [Wed, 11 Mar 2015 15:29:12 +0000 (17:29 +0200)]
imapc: Removed Exchange-workaround for ignoring missing BODY[] replies.
This causes data loss if server was actually returning a NO temporary error
that would have succeeded later on.
Timo Sirainen [Mon, 9 Mar 2015 15:14:35 +0000 (17:14 +0200)]
lib: Recent module_dir_load() changes broke error logging.
If there was a required list of modules, the error was properly returned.
But when loading all plugins, the errors weren't logged.
Timo Sirainen [Mon, 9 Mar 2015 13:26:45 +0000 (15:26 +0200)]
fs-posix: Don't close file fd after its writing is finished.
This allows reading the file after writing without having to re-open the
file (which in turn might fail in some situations).