Timo Sirainen [Mon, 9 Jan 2017 21:13:03 +0000 (23:13 +0200)]
lib-storage: When logging corrupted mail size, disable logging Message-ID for now
This was causing crashes in some situations. It was originally added to
figure out if there were problems with dovecot.index.cache containing
data for wrong messages. This was never found to happen, although now
thinking about it, the problem may have been 741287129c22cadc14c05584704685b31169dbce. So perhaps this code could be
removed permanently as well.
6b44fc75c0039d1006ce4d543544552449b8e229 also attempted to fix this, but it
wasn't enough. There was still some code path that lead to recursive header
parsing.
Timo Sirainen [Sat, 28 Jan 2017 23:06:55 +0000 (01:06 +0200)]
lib-storage: Add struct mailbox_status.flags
This is similar to permanent_flags, except it tells which flags can be
changed at all in the session. Mainly it allows plugins to make changes to
IMAP's untagged FLAGS reply.
Stephan Bosch [Sun, 22 Jan 2017 22:55:24 +0000 (23:55 +0100)]
lib-http: client: Fixed handling of errors occurring for unsubmitted requests during http_client_request_send_payload().
When http_client_request_send_payload() is executed for the first time, the request is submitted.
Errors occurring during submission don't trigger a callback immediately.
Instead, these are queued in the client and will trigger a callback when an ioloop is run with the client.
However, in http_client_request_send_payload() the ioloop is never executed when the request fails that way, meaning that
the callback was never called. Since for example SOLR assumes the callback is always called for an error in
http_client_request_send_payload(), this causes all kinds of problems.
Fixed by manually handling the delayed request errors in http_client_request_send_payload() explicitly.
Timo Sirainen [Fri, 20 Jan 2017 13:54:27 +0000 (15:54 +0200)]
director: Make sure USER-KILLED isn't sent before USER-MOVE
If USER-MOVE was for a user that didn't exist, killing sent USER-KILLED
immediately before the forwarding USER-MOVE. This caused the move to get
stuck, giving errors like:
director: Error: Finishing user 3224731354 move timed out, its state may now be inconsistent (state=waiting-for-everyone)
Timo Sirainen [Fri, 20 Jan 2017 12:46:30 +0000 (14:46 +0200)]
lib-storage: Fix mailbox's vsize header check for mailboxes not in dovecot.list.index
If mailbox wasn't yet in the dovecot.list.index, mailbox_list_index_status()
for it returns FALSE and doesn't initialize the status. In some situations this
may have caused a non-empty mailbox's vsize to be returned as 0.
Stephan Bosch [Tue, 10 Jan 2017 01:12:25 +0000 (02:12 +0100)]
lib-http: client: Make sure req->conn is only not NULL when that connection holds a reference to that request.
This consolidates the management of req->conn to one place, thereby preventing mishaps.
It makes sure req->conn is always properly assigned, making it more reliable.
This fixes a problem that emerged in the http-proxy.
Timo Sirainen [Tue, 17 Jan 2017 17:49:39 +0000 (19:49 +0200)]
master: Remove unnecessary service listener start
The listening was already started later on in the same function. Also
in some cases it would have been started unnecessarily, like when service
was stopped or more processes were created immediately.
Aki Tuomi [Tue, 3 Jan 2017 15:21:33 +0000 (17:21 +0200)]
lib-storage: Add vsize extension to index
Keep virtual size in index, instead of cache
when it's less than 2^32-1. This helps when
cache becomes corrupted, and goes away, we
still have virtual sizes for quota calculations.
Timo Sirainen [Sat, 14 Jan 2017 13:10:17 +0000 (15:10 +0200)]
lib-storage: Fix accessing the same "raw" mailbox multiple times in process.
If the same file was opened as the raw mailbox multiple times, the previous
mail_index was cached by mail-index-alloc-cache. Opening it the second time
already contained a mail in the index, so trying to add another one logged
an error:
Error: Log synchronization error at seq=1,offset=256 for (in-memory index): Append with UID 1, but next_uid = 2
Aki Tuomi [Thu, 5 Jan 2017 08:50:55 +0000 (10:50 +0200)]
lib-storage: Prevent recursion in header parsing
If header parsing error occurs and error handling tries
to get fields, such as Message-ID, it will cause
crash. This fixes problem by preventing reading from
non-cached headers while they are being parsed.
Timo Sirainen [Mon, 9 Jan 2017 20:39:09 +0000 (22:39 +0200)]
dict-client: When failing to resend commands after reconnect, their success is uncertain.
It's possible that the writes before the disconnection did actually finish
successfully. If any of them were commits, we need to return
DICT_COMMIT_RET_WRITE_UNCERTAIN.
Stephan Bosch [Fri, 30 Dec 2016 15:20:12 +0000 (16:20 +0100)]
lib-lda: Moved LMTP client to lib-smtp.
This makes the LMTP client available without dependency on lib-storage.
For Dovecot v2.3, the newly created lib-smtp will evolve into a full client/server SMTP implementation.
That will then remove the remaining SMTP code from lib-lda.
lib-mail: header filter should call callback for added EOH
If we add a EOH because there wasn't one and
HEADER_FILTER_ADD_MISSING_EOH was specified, we should invoke the
callback for it. Otherwise, it is unnecessarily difficult for consumers
to add a header since there is no way to know if EOH will be present
ahead of time.