Timo Sirainen [Sat, 2 Nov 2013 19:29:39 +0000 (21:29 +0200)]
imap: Added initial support for METADATA extension.
For now this is enabled only when imap_metadata=yes setting is used. The
setting will go away once the feature is complete. Also mail_attribute_dict
must be set.
TODO:
- Metadata doesn't work for public namespaces. There should probably be a
mail_attribute_public_dict setting for that.
- There isn't any kind of quota or other limits
- After ENABLE METADATA start sending untagged METADATA entries to clients
- /shared/admin should probably return postmaster_address URL
- Check if we handle ACLs correctly
- RFC says that it SHOULD be possible to set METADATA entries to \NoSelect
mailboxes. We probably will never allow this though.
Timo Sirainen [Sat, 2 Nov 2013 13:27:28 +0000 (15:27 +0200)]
ssl-params: Added ssl_dh_parameters_length & removed ssl_parameters_regenerate setting.
ssl_parameters_regenerate was based on some text from GNUTLS documentation a
long time ago, but there's really not much point in doing it.
Ideally we should also support "openssl dhparam" input files, but for now
there's the ssl_dh_parameters_length setting that can be used to specify the
wanted DH parameters length. If the current ssl-parameters.dat has a
different length, it's regenerated.
We should probably at some point support also built-in DH parameters which
are returned while the ssl-params runs.
Timo Sirainen [Sat, 2 Nov 2013 12:19:23 +0000 (14:19 +0200)]
dsync: Don't track too new changes from transaction log.
This mattered only during race conditions while there were changes being
done to the mailbox during syncing.
Timo Sirainen [Sat, 2 Nov 2013 11:52:30 +0000 (13:52 +0200)]
auth: Added %{session_pid} variable for userdb lookups in login requests.
session_pid is now always sent to auth process. A new request_auth_token
parameter was added to specify if auth_token should be returned or not.
Timo Sirainen [Fri, 1 Nov 2013 14:43:53 +0000 (16:43 +0200)]
lib-storage: Hooks weren't called exactly in the order they were intended.
The comparison didn't skip the paths, so the "lib" prefix skipping didn't
work.
Timo Sirainen [Tue, 29 Oct 2013 19:08:07 +0000 (21:08 +0200)]
mdbox: Added "mdbox_deleted" storage, which can be used to access messages with refcount=0
For example:
doveadm import mdbox_deleted:~/mdbox "" mailbox inbox subject oops
Timo Sirainen [Tue, 29 Oct 2013 16:59:20 +0000 (18:59 +0200)]
virtual: If virtual mailbox has no config file, assume it's just nonexistent.
Most importantly if the virtual namespace root doesn't have the config, it
should fail with MAIL_ERROR_NOTFOUND rather than MAIL_ERROR_NOTPOSSIBLE.
Timo Sirainen [Sat, 26 Oct 2013 15:59:52 +0000 (18:59 +0300)]
fts-solr: Fixed support for multiple Solr hosts when same process handles multiple users.
E.g. indexer-worker was always using only the first user's Solr host.
Timo Sirainen [Wed, 23 Oct 2013 13:10:30 +0000 (16:10 +0300)]
lib-master: If service_count=1, close the listener before starting to handle the connection.
This way if the connection handling takes a long time and the service
doesn't notice that master dies, it can keep running without keeping the
listener fds open and preventing a restart.
Timo Sirainen [Wed, 23 Oct 2013 11:34:35 +0000 (14:34 +0300)]
doveadm-server: Don't call io_loop_run() recursively for the same ioloop.
This breaks things more or less badly, especially ioloop-kqueue really
didn't like it.
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.