Stephan Bosch [Sat, 12 Oct 2013 07:57:05 +0000 (10:57 +0300)]
lib-http: http-client: Added request error code for broken payload input stream.
This error is triggered when reading from the provided payload input stream
fails while sending the request. Previously this would yield the same error
code as for a failure to write to the connection output.
Stephan Bosch [Sat, 12 Oct 2013 07:54:50 +0000 (10:54 +0300)]
lib-http: http-client: Made requests release payload input stream as early as possible.
This prevents deadlock conditions when used for the HTTP proxy.
Stephan Bosch [Sat, 12 Oct 2013 07:54:10 +0000 (10:54 +0300)]
lib-http: http-client: When client request is retried based on a response received from server, return full response to caller if retry is not possible.
Before, it would construct a dummy-response that basically retains only the
status and reason elements. This is currently only relevant for the way a
417 Expectation Failed response from the server is handled.
Timo Sirainen [Fri, 11 Oct 2013 16:17:10 +0000 (19:17 +0300)]
liblib: If parent ostream closes itself on error, close our ostream as well.
This avoids a situation where ostream is basically unusable with
last_failed_errno set, but it's not marked as closed. The current code
often checks ostream->closed but doesn't check last_failed_errno.
ostream-file also autocloses the stream, but filter ostreams without this
patch don't autoclose, so this caused problems with e.g. IMAP COMPRESSION
extension where the zlib-ostream didn't get marked as closed, although the
problem was only logging "BUG: Unknown internal error" instead of
"Disconnected" as the client's disconnect reason.
Timo Sirainen [Fri, 11 Oct 2013 09:22:56 +0000 (12:22 +0300)]
lib-storage: Header+body searches might not have searched the body in some cases.
Only the header was requested for the search stream, which with imapc and
pop3c could have caused the body not to be in the stream, although it
usually was because of the "fetch body" hint.
Timo Sirainen [Thu, 10 Oct 2013 17:50:10 +0000 (20:50 +0300)]
master: host.domain lookups weren't cached, they were done at the worst possible time.
This fixes "net_connect_unix(imap) failed: Resource temporarily unavailable"
and various other issues where processes weren't being created fast enough
if the host.domain lookup was slow (e.g. done via external DNS).
Timo Sirainen [Thu, 3 Oct 2013 08:20:09 +0000 (11:20 +0300)]
dsync: Removed periodic commits while importing.
The problem is that the current algorithm doesn't handle it correctly. If
there already are some mails that exist locally, or remote has duplicate
mails, the messages may not be saved in the UID order, and if there's a
commit between such wrong ordering, the UIDs get renumbered.
Timo Sirainen [Mon, 23 Sep 2013 01:25:16 +0000 (04:25 +0300)]
master: Added reuse_port setting to inet_listeners, which enables SO_REUSEPORT if available.
After forking a new service process, a new listener socket is created for
each such inet_listener. Linux v3.9+ added SO_REUSEPORT feature, which
should distribute clients more uniformly to the processes. I'm not sure if
this makes any difference in BSDs.
At least in Linux v3.9 there was still a bug that if the number of listening
processes changed, some TCP handshakes might not finish. I don't see if this
has already been fixed, so this is probably safe to use only for services
whose process count doesn't change (e.g. process_min_avail is set high
enough).
Timo Sirainen [Sun, 22 Sep 2013 04:40:01 +0000 (07:40 +0300)]
maildir: Autocreate missing cur/ new/ tmp/ directories only with Maildir++ and imapdir.
\Noselect mailboxes aren't possible with those layouts, but with other
layouts they are and they shouldn't get automatically created just by
selecting them.
Timo Sirainen [Sun, 22 Sep 2013 03:30:47 +0000 (06:30 +0300)]
mbox: Fixed assert-crash due to wrong transaction_count handling.
This happened only when messages had been expunged by another session just
before saving a new message.
Timo Sirainen [Sun, 22 Sep 2013 01:14:23 +0000 (04:14 +0300)]
Fixes and improvements to istream-attachment-extractor error handling.
If an attachment saving failed, the mail was still saved to disk, just
without the attachments.
Timo Sirainen [Sat, 21 Sep 2013 22:40:11 +0000 (01:40 +0300)]
*-login: Added %{orig_user}, %{orig_username} and %{orig_domain} variables.
The original username is what the client sent to server before any
translations.
Timo Sirainen [Sat, 21 Sep 2013 02:05:22 +0000 (05:05 +0300)]
lib-storage: Don't create a settings cache for initial global settings read.
This fixes at least doveadm -A so that it doesn't connect to config process
for each user.
Timo Sirainen [Sat, 21 Sep 2013 00:49:22 +0000 (03:49 +0300)]
doveadm sync: When -1 parameter is used, ignore missing mailboxes in source.
Previously the syncs finished with "Mailbox changes caused a desync." and
exit code 2. This was especially common when the destination server had
new autocreated mailboxes and user logged in after the first dsync.
Timo Sirainen [Fri, 20 Sep 2013 23:55:27 +0000 (02:55 +0300)]
imapc: Don't log unnecessary errors at deinit about aborted hiearchy separator lookup.
The lookup is done asynchronously at startup. It doesn't matter if we never
get around to finishing it.
Timo Sirainen [Fri, 20 Sep 2013 00:54:31 +0000 (03:54 +0300)]
dbox: Fixed "UIDVALIDITY=0" error race condition.
If session 1 had mkdir()ed but not yet created the initial index, while
session 2 attempted to open the mailbox, it would create an empty index and
log the error.
Timo Sirainen [Thu, 19 Sep 2013 21:14:11 +0000 (00:14 +0300)]
istream-file: Assert-crash if read() fails with EBADF.
Something's already wrong at that point and it may not be safe to continue.
Also crashing makes it easier to debug such situation.
Stephan Bosch [Wed, 18 Sep 2013 20:24:11 +0000 (23:24 +0300)]
lib-http: http-url: Fixed return of proper error message in case of a failure to parse request target Host header.
Assigned the error to the parser object rather than returning it directly.