Timo Sirainen [Mon, 6 Oct 2014 09:21:24 +0000 (12:21 +0300)]
doveadm backup: When deleting a mailbox, log a warning, not just a debug message.
Because we're also returning temporary failure in any case, so there needs
to be some kind of a warning/error logged.
Stephan Bosch [Sat, 4 Oct 2014 14:32:48 +0000 (17:32 +0300)]
lib-http: Fixed detecting disconnection when ioloop is running only intermittently.
This fix only applies to ioloops created and run by lib-http itself.
Stephan Bosch [Sat, 4 Oct 2014 14:31:38 +0000 (17:31 +0300)]
lib: Fixed io_loop_move_timeout() to retain the next_run time, so that the timeout is not implicitly reset.
This problem became with timeout_add_absolute(), since resetting an
absolute timeout causes it to fire immediately (msecs == 0).
Stephan Bosch [Sat, 4 Oct 2014 14:30:54 +0000 (17:30 +0300)]
lib-http: client: Fixed problem occuring when a nested ioloop was run inside a request callback using the same client.
If requests in the nested ioloop would use the same connection as the one
that called the callback, the requests would (in the best scenario) all be
doomed to time out.
Timo Sirainen [Fri, 3 Oct 2014 13:31:33 +0000 (16:31 +0300)]
lib-lda, lmtp: Separate internal errors from remote errors.
LMTP proxy shouldn't log remote errors with error level, because the proxy
itself didn't have any failure.
This is an API change, but I'm not aware of any plugins actually using the
lmtp-client.h directly.
Timo Sirainen [Fri, 3 Oct 2014 13:04:06 +0000 (16:04 +0300)]
master: If log process crashes, restart it immediately.
The regular service_monitor_listen_start() doesn't work for it, because the
log fds aren't in the listeners.
Stephan Bosch [Wed, 1 Oct 2014 07:33:49 +0000 (10:33 +0300)]
lib-http: client: Fixed recovery after connection failure.
If a parallel already connected connection was active, the queue wasn't notified of the failure.
Only pending connections should be considered in this case and not established ones.
Stephan Bosch [Wed, 1 Oct 2014 07:33:39 +0000 (10:33 +0300)]
lib-http: client: Fixed aborting request in the middle of sending payload.
If the request payload is so big that it cannot be sent all at once, the
caller may at some point abort the request when it is still being sent. The
bug occurred when the request finally finished sending. It erroneously
advanced the state to WAITING rather than remaining ABORTED, thus
'reviving' the request unexpectedly.
Stephan Bosch [Tue, 30 Sep 2014 20:49:52 +0000 (23:49 +0300)]
lib-http: client: The http_client_queue_fail() function aborted requests in an unsafe manner.
Copied queues before freeing the requests, because the destroyed requests modify the queue.
Timo Sirainen [Thu, 25 Sep 2014 21:32:03 +0000 (00:32 +0300)]
lib-storage: Don't assume that we must read the whole message to get its virtual size.
This is true only with mbox format. All the other formats have various
metadata available where it's stored.
Timo Sirainen [Thu, 25 Sep 2014 16:43:28 +0000 (19:43 +0300)]
imap: die-callback didn't set log prefixes correctly for client handlers
Calling mail_storage_service_io_activate_user() unfortunately doesn't set
the ioloop context itself, so timeouts weren't inheriting it. It seemed a
bit difficult to change this, so for now I just moved the call to the
timeout handler.
Timo Sirainen [Thu, 25 Sep 2014 12:50:03 +0000 (15:50 +0300)]
lib: If file_wait_lock*() fails, try to include the current pid holding the lock in error message.
This is currently supported via fcntl(F_GETLK) and also via Linux
/proc/locks.
Timo Sirainen [Wed, 24 Sep 2014 22:13:12 +0000 (01:13 +0300)]
lib-storage: Added mailbox_get_index_path() and caching of the index path.
This solves some potential assert-crashes on race conditions when opening a
mailbox while it's being deleted.
Timo Sirainen [Wed, 24 Sep 2014 21:42:56 +0000 (00:42 +0300)]
lib-storage: Headers were sometimes added to dovecot.index.cache with wrong line number value.
This happened if the header parsing was done multiple times for the same
mail. The end result being that when fetching multiple headers as a stream,
the headers could have been returned in the wrong order. This messed up at
least dsync's header hash comparisons.
Timo Sirainen [Tue, 23 Sep 2014 13:58:59 +0000 (16:58 +0300)]
imap: Don't send MODSEQ in untagged FETCH reply if IMAP client didn't enable CONDSTORE/QRESYNC.
We should have been checking client->enabled_features, not
mailbox_get_enabled_features(). The former contains the features enabled by
the IMAP client, while the latter contains also some automatically added
features.
Timo Sirainen [Mon, 22 Sep 2014 13:08:25 +0000 (16:08 +0300)]
lib-master: Increased instances file's dotlock timeout to 2 seconds.
The 1 second would have been enough, except the current dotlocking code
uses second-level precision in checking timeouts, so it could end up trying
the lock only once.
A better fix would be to fix the dotlocking code to use millisecond-level
precision (internally), but since this is the only user so far where it
would have mattered, it's not really worth the effort (yet).
Phil Carmody [Mon, 22 Sep 2014 12:56:31 +0000 (15:56 +0300)]
lib: bsearch - make BINARY_NUMBER_SEARCH more widely usable
This template is more widely usable if we do not hard-code into it the
method of accessing the value being compared. For the default case
we already use, this accessor is just a simple array dereferencing
macro.
As rewriting with the array access happens in the preprocessor, the
code generated is completely unchanged.
Timo Sirainen [Tue, 16 Sep 2014 20:22:59 +0000 (23:22 +0300)]
virtual: Using modseq-based syncing while mailbox was open didn't handle expunges correctly.
The expunges were handled only after EXPUNGE command was given, which should
have been done only for mails that no longer matched the search query but
still existed.
Timo Sirainen [Tue, 16 Sep 2014 17:59:48 +0000 (20:59 +0300)]
quota: Quota recalculation didn't include INBOX in some configurations.
If one inbox=yes and another inbox=no namespace shared the same mail
location, and the inbox=no namespace was first, only it was used to list all
mailboxes.
Timo Sirainen [Tue, 16 Sep 2014 12:43:42 +0000 (15:43 +0300)]
lib-storage: SEARCH_MAILBOX* value is now also compared to to the (virtual) mailbox name.
This fixes for example "doveadm fetch uid mailbox virtual/all"
Phil Carmody [Tue, 16 Sep 2014 10:38:30 +0000 (13:38 +0300)]
lib: test-strnum - add size-oblivious str_to/parse_uintmax tests
Test a value of every bit-length. Also test the 10/9*MAX corner case.
And due to crappy helper functions, test lots of leading zeroes too!
Stephan Bosch [Mon, 15 Sep 2014 08:19:50 +0000 (11:19 +0300)]
lib-http: server: Fixed connection reference counting.
Connection often still got destroyed too early. Particularly submitting
responses would potentially destroy the connection, which is often
unexpected. Sending responses is now postponed until handled by the stream
output handler, which is explicitly triggered when necessary.