Timo Sirainen [Wed, 2 Sep 2015 14:36:47 +0000 (17:36 +0300)]
dict: Use the new async APIs for everything.
If the dict backend supports async operations, this means that dict service
can now be configured with client_count>1.
Timo Sirainen [Wed, 2 Sep 2015 14:20:02 +0000 (17:20 +0300)]
lib-sql: Mark Cassandra driver as pooled.
Otherwise all the asynchronous operations will assert-crash, since all the
auto-connecting code is in the sqlpool code.
Timo Sirainen [Wed, 2 Sep 2015 14:19:08 +0000 (17:19 +0300)]
lib-sql: Debugging help - Added assert before clearing sql_result.callback.
If result is unrefed too many times, this still allows accessing the
callback from a debugger.
Timo Sirainen [Tue, 1 Sep 2015 13:25:11 +0000 (16:25 +0300)]
lib-imap-client: If connect() fails immediately, log an error and retry the next IP.
Only if all IPs fail return a full failure. This is mainly intended to skip
IPv6 addresses when IPv6 connectivity doesn't work.
Timo Sirainen [Mon, 31 Aug 2015 21:11:37 +0000 (00:11 +0300)]
auth: Added ":protected" suffix to passdb and userdb field names.
This means that if the field is set only if it hasn't already been set.
Usually an earlier passdb/userdb would have set the field and this is
setting a default (e.g. per-user settings override per-domain settings).
Teemu Huovila [Mon, 31 Aug 2015 10:33:26 +0000 (13:33 +0300)]
lib-fts: Add prefixing contraction filter.
Filters away prefixing contracted words, e.g. "l'homme" -> "homme".
Tokens to be filtered must be lower case. Only supports French in
this initial version.
Stephan Bosch [Sat, 29 Aug 2015 11:26:30 +0000 (14:26 +0300)]
Changed type of internet port values to in_port_t everywhere.
Created special SET_IN_PORT setting type for internet port values.
Created net_str2port() for parsing internet port values.
Removed several atoi() invocations in the process.
Stephan Bosch [Sat, 29 Aug 2015 11:20:57 +0000 (14:20 +0300)]
lib-http: client: Added proper handling of 408 response status.
This is treated as a special server connection close event, rather than a
response to the last issued request.
Timo Sirainen [Fri, 28 Aug 2015 13:07:35 +0000 (15:07 +0200)]
lib: If var_expand_with_funcs() function returns NULL, it should be treated the same as ""
The previous behavior was to return "%{foo:bar}" as "foo:bar}".
Timo Sirainen [Thu, 27 Aug 2015 15:34:52 +0000 (17:34 +0200)]
lib: Try fixing ec6e672a6e32 (ioloop timeout fixing)
Previous code was broken at least when moving a timeout between ioloops.
This is now tested and works.
Timo Sirainen [Thu, 27 Aug 2015 11:38:44 +0000 (13:38 +0200)]
dsync: Added -D parameter to disable mailbox renaming.
The renaming logic is annoyingly complex and there are some bugs left in it.
With this parameter renames are never even attempted, but instead a rename
would be done (slowly) with mailbox delete + create + fill.
Although with imapc protocol mailbox renames are rarely detected anyway.
Timo Sirainen [Thu, 27 Aug 2015 10:33:47 +0000 (12:33 +0200)]
dsync: Fixed again waiting for remote process wait to die.
We can't rely on stderr getting closed. It doesn't happen if the remote
process crashes. Now waiting for SIGCHLD in ioloop should solve this and
still log all the error messages at exit.
Stephan Bosch [Thu, 27 Aug 2015 08:39:26 +0000 (10:39 +0200)]
ioloop: Delay actual start of a new normal timeout until the next io_loop_run() cycle.
This makes sure that timeouts will not expire before they get a chance to
run.
Timo Sirainen [Wed, 26 Aug 2015 13:44:45 +0000 (15:44 +0200)]
dsync: Make sure we print all the stderr output from remote processes at deinit.
Earlier the final messages may have been lost, especially if debug logging
was enabled.
Timo Sirainen [Wed, 26 Aug 2015 13:05:06 +0000 (15:05 +0200)]
dsync: If mailbox export deinit failed, the failure state may not have reached mailbox importer.
The "end of list" was sent to the importer side dsync before export noticed
the failure. This could have caused import to complain about missing mails.
Timo Sirainen [Tue, 25 Aug 2015 15:27:44 +0000 (18:27 +0300)]
imap: Fixed hibernation to work with non-TCP connections.
Mainly meaning UNIX socket connections from login processes, which are
proxying TLS connections.
Timo Sirainen [Tue, 25 Aug 2015 13:50:17 +0000 (16:50 +0300)]
imapc: If FETCH commands fail, have imapc_mail_fetch() always return failure.
Earlier it may have returned success and imapc would later complain about a
missing FETCH field.
Timo Sirainen [Mon, 24 Aug 2015 15:06:42 +0000 (18:06 +0300)]
lib-master: struct master_service_connection.name must never be NULL, use "" instead.
Fixes crash at least in auth process when there are inet_listeners without
names.
Timo Sirainen [Mon, 24 Aug 2015 11:13:02 +0000 (14:13 +0300)]
Added imap-hibernate process for gathering IDLEing imap processes.
imap_hibernate_timeout setting controls how quickly the connection is moved
from imap process to imap-hibernate process.
Some IMAP extensions like NOTIFY, SEARCH=CONTEXT and COMPRESS aren't
supported yet.
There's also a new X-STATE command, which can be used to export the current
IMAP connection state to a string and later on imported to get back to the
original state (a quick resync feature for IMAP clients). However, this
command is disabled for now due to the current code being unoptimized for
untrusted input.
Timo Sirainen [Wed, 19 Aug 2015 18:41:55 +0000 (21:41 +0300)]
imap: Code cleanup
Keep client_add_input() functionality separate from
client_create_from_input(). Also this way temporary buffer doesn't need to
be created to add the input in login_client_connected().
Timo Sirainen [Wed, 19 Aug 2015 17:49:12 +0000 (20:49 +0300)]
imap: If command has no imap_parser, don't crash when freeing the command.
All the current commands have a parser though, so this doesn't actually fix
anything.
Timo Sirainen [Wed, 19 Aug 2015 13:50:10 +0000 (16:50 +0300)]
lib: inotify doesn't need to watch for IN_CLOSE
This doesn't indicate that the file was modified. We don't care if some
reader accessed a watched file.
Timo Sirainen [Wed, 19 Aug 2015 10:41:54 +0000 (13:41 +0300)]
lib: kqueue notification should trigger also on file renames.
For example if dovecot.index.log is renamed to dovecot.index.log.2, we
should notice that since there's now a new dovecot.index.log containing new
changes.
Timo Sirainen [Wed, 19 Aug 2015 09:56:55 +0000 (12:56 +0300)]
lib-storage: Moved most of the \Recent flag handling code to mailbox-recent-flags.c
There are also some API changes, because functions were renamed and the
recent_* fields were moved to struct mailbox. I'm not aware of any plugins
using these though, except for index_mailbox_set_recent_seq() which for now
is kept as a backwards compatibility macro.
Stephan Bosch [Tue, 18 Aug 2015 20:02:01 +0000 (23:02 +0300)]
lib-http: client: Fixed handling of request timeout.
It was inappropriately active when the client needed to take action.
This showed particularly with large payloads sent using
http_client_request_send_payload().
Timo Sirainen [Tue, 18 Aug 2015 18:10:41 +0000 (21:10 +0300)]
lib-http: Previous test-http-client safe_memset() change broke in some systems.
Since there's no easy way to fix this in Makefile.am, just do it by actually
using safe_memset()..
Timo Sirainen [Tue, 18 Aug 2015 17:59:25 +0000 (20:59 +0300)]
lib-http: test-http-client may have failed to load SSL library plugin.
safe_memset() wasn't necessarily compiled into test-http-client. This is a
bit kludgy way of just adding it. Another possibility could have been to use
-Wl,--whole-archive with GNU ld, but it's a bit tricky here.