Timo Sirainen [Thu, 17 Apr 2014 12:21:55 +0000 (14:21 +0200)]
auth: Use special AUTH_SUBSYS_DB/MECH parameters as auth_request_log*() subsystem.
This avoids hardcoded strings all over the place and also allows assigning
the correct passdb/userdb name for log messages generated by generic
passdb/userdb code, which doesn't know exactly where it was called from.
Timo Sirainen [Thu, 17 Apr 2014 08:17:09 +0000 (10:17 +0200)]
lib-http: http_client_request_finish_payload() no longer waits for the entire result payload.
The caller can now read it instead, or just discard it by not reading it.
Timo Sirainen [Wed, 16 Apr 2014 14:05:12 +0000 (16:05 +0200)]
maildir: Added maildir_empty_new setting to avoid keeping mails in new/ directory.
This is useful for example when using an external MDA that calls "doveadm
index" and the user hasn't opened the mailbox for a long time.
Also this removes the delay that user may see when opening a rarely accessed
mailbox, which renames a ton of files to cur/ while the user is waiting.
Timo Sirainen [Tue, 15 Apr 2014 22:04:29 +0000 (00:04 +0200)]
lib-storage: Further changes to mailbox_alloc_guid() caching.
We'll now cache the GUIDs forever and force invalidation after mailbox
rename or when mailbox GUIDs have been updated. This is what dsync needs,
especially for good performance, and currently there aren't any other users
for this API.
Timo Sirainen [Tue, 15 Apr 2014 21:44:54 +0000 (23:44 +0200)]
lib-storage: mailbox_alloc_guid() shouldn't refresh GUID cache on every nonexistent GUID.
Refresh it only if we know it has had some changes (made by our process) or
timestamp has changed. This should handle the cases that are currently
important (=single dsync run).
Timo Sirainen [Tue, 15 Apr 2014 15:20:02 +0000 (17:20 +0200)]
virtual: Delay opening the backend mailboxes until it's really necessary.
This should improve the performance a lot with mailbox_list_index=yes when
opening virtual mailboxes whose backend mailboxes are mostly unchanged.
Timo Sirainen [Tue, 15 Apr 2014 15:06:57 +0000 (17:06 +0200)]
lib-storage: Replaced mail_get_real_mail() with mail_get_backend_mail() that can fail.
For now the mail_get_real_mail() can still be used for backwards
compatibility.
Timo Sirainen [Wed, 9 Apr 2014 20:19:29 +0000 (23:19 +0300)]
lazy_expunge: If setting is empty, disable the plugin.
Instead of assuming that we want to use prefix="" as the lazy_expunge
namespace, which is highly unlikely anyone will ever want to do.
Timo Sirainen [Wed, 9 Apr 2014 15:14:33 +0000 (18:14 +0300)]
doveadm backup: Another attempt at fixing assert-crashes when deleting mailboxes.
Only two-way syncs really care about the mailbox deletion logs which set
existence=DELETED. So actually the log reading could be skipped entirely for
doveadm backup to speed things up.
In any case the code currently relies that after
sync_tree_sort_and_delete_mailboxes() the tree no longer has nodes with
existence=DELETED and mailbox_guid!=0, because that assert-crashes in
sync_create_mailboxes(). The assert() could probably simply be changed into
an if(), but might as well keep the code as it was originally intended and
not have the sync/backup behave more differently than needed.
Timo Sirainen [Wed, 9 Apr 2014 14:05:12 +0000 (17:05 +0300)]
maildir: If GUID can't be preserved in filename due to size change, set it in dovecot-uidlist
This fixes problems with dsync when zlib is used and filenames/GUIDs don't
contain (correct) S=sizes.
Timo Sirainen [Thu, 3 Apr 2014 22:23:29 +0000 (01:23 +0300)]
maildir: If istream_opened is set by a plugin, don't try to fix S=size by renaming.
Although this could be fixed in a nicer way by actually calculating the
correct S=size and using that for renaming.
Timo Sirainen [Thu, 3 Apr 2014 21:14:42 +0000 (00:14 +0300)]
maildir: If istream_opened hook is set, don't return stat()ed file size as physical size.
That's pretty much always wrong. The hook is set with e.g. zlib and
mail-filter and similar plugins that modify the mail stream.
Timo Sirainen [Thu, 3 Apr 2014 16:51:52 +0000 (19:51 +0300)]
Added io_add_istream() and related functionality for combining the ioloop/istream.
The idea here is that it's possible to implement asynchronous istreams when
there isn't a file descriptor that can be used to reliably receive updates.
Timo Sirainen [Thu, 3 Apr 2014 11:41:25 +0000 (14:41 +0300)]
DEBUG: Make sure errno isn't changed by vsnprintf()/malloc()/free() implementations.
They shouldn't, so this should only be a sanity check when running with
devel-checks. Various parts in the code rely on errno not being changed by
*_strdup_printf() calls.
Timo Sirainen [Thu, 3 Apr 2014 09:54:18 +0000 (12:54 +0300)]
i_stream_read(): If stream_errno is set, fail immediately.
Previously the stream_errno was reset to 0, but this required the istream
implementation to correctly set the stream_errno back, which wasn't often
done.
Timo Sirainen [Fri, 21 Mar 2014 15:52:50 +0000 (17:52 +0200)]
imapc: Cache LIST replies for a while to be able to immediately ask for mailbox flags/existence.
Besides giving better performance, this will fix bugs in some servers where
LISTing a single mailbox doesn't necessarily return it. (In this case a
mailbox named "in" wasn't returned, but I think Dovecot has had bugs related
to this also.)
Timo Sirainen [Thu, 20 Mar 2014 15:00:31 +0000 (17:00 +0200)]
imapc: Avoid hanging when running into server problems.
imapc_mail_fetch_flush() caused imail->fetch_count to drop to 0, but
imapc_mailbox_run() still started imapc_client_run() which was doing
nothing.
Timo Sirainen [Mon, 17 Mar 2014 14:57:21 +0000 (16:57 +0200)]
liblib: Added negative %variable lengths to count backwards from the end of the value.
For example %0.-2 for "12345" returns "123".
Patch by Norbert Weinhold / Open-Xchange.
Timo Sirainen [Tue, 11 Mar 2014 11:26:33 +0000 (13:26 +0200)]
fts-lucene: Skip returned duplicate results.
This caused assert-crash at least when searching from virtual mailbox
because the score array was larger than the actual number of results.
Timo Sirainen [Mon, 10 Mar 2014 22:39:27 +0000 (00:39 +0200)]
mdbox: Added mdbox_purge_preserve_alt setting to keep the file within alt storage during purge.
Perhaps it would be better for this setting to be the default in v2.3 and
maybe be removed entirely? Not a good idea to change during v2.2.x anyway,
so for now this is a setting.
Timo Sirainen [Mon, 24 Feb 2014 18:30:51 +0000 (12:30 -0600)]
lib-storage: Fixed support for list=no prefix="" listing.
This behavior works with e.g. Outlook where it's allowed to CREATE and LIST
the Sent/Trash/etc mailboxes to root level, even though the primary
namespace has a prefix.