Timo Sirainen [Thu, 14 Sep 2017 14:57:29 +0000 (17:57 +0300)]
director: After CONNECT was received, make sure we disconnect
The remote side won't be reading anything after the CONNECT, so we have to
disconnect anyway. If we decide that the CONNECT request is wrong, reconnect
after a short delay and hope that the remote agrees with us the next time.
Timo Sirainen [Thu, 14 Sep 2017 14:38:24 +0000 (17:38 +0300)]
director: Don't reset directors' last_network_failure while handshaking
The reset is done mainly to make it faster for a director that has been down
to connect back to the ring, without other directors still thinking that
it's down. But DIRECTOR that is sent during handshake says nothing about
whether the director is up at the moment or not.
Timo Sirainen [Wed, 13 Sep 2017 12:16:59 +0000 (15:16 +0300)]
cassandra: Fix paged queries to work again
When continuing the result, consistency was reset to 0 (=ANY), which caused
the queries to fail. There's no need to initialize the statement again when
continuing it. Also set result->consistency to be correct mainly for
debugging purposes.
Timo Sirainen [Mon, 11 Sep 2017 09:27:17 +0000 (12:27 +0300)]
lib-storage: Fix mailbox list notification assert-crash when mailbox is deleted
Reproduced with if IMAP NOTIFY is used for non-selected mailboxes without
MailboxName being specified. Another session then does changes to a
mailbox and immediately deletes it, which causes the crash.
Fixes:
Panic: file mailbox-list-index-notify.c: line 751: unreached
Timo Sirainen [Mon, 11 Sep 2017 10:54:12 +0000 (13:54 +0300)]
lib-storage: Avoid unnecessary stat()s in mailbox list index notifications
If mailbox list gets a notification there's no need to stat() the INBOX, and
vice versa. Also if the notification was already seen and a callback timeout
set, there's no need to keep stat()ing.
Timo Sirainen [Mon, 11 Sep 2017 10:48:17 +0000 (13:48 +0300)]
lib-storage: Make sure mailbox list notification flush sees latest changes.
This is mainly useful with imaptest test scripts to make sure they're seeing
the changes done by the other session, without assuming that inotify will
always notify about the change before NOOP is run (it doesn't).
Do this only if mailbox_idle_check_interval>0, so it's not run when periodic
stat()s are wanted to be avoided.
Timo Sirainen [Fri, 8 Sep 2017 09:20:21 +0000 (12:20 +0300)]
lib-storage: Preserve messages' vsize record when rebuilding index
Since vsize is often used by quota, losing this can be very expensive.
If the vsize is wrong, it gets fixed automatically when fetching the
message body.
Timo Sirainen [Thu, 24 Aug 2017 08:13:32 +0000 (11:13 +0300)]
cassandra: sql_transaction_commit_s() - Set query_type correctly
The queries were all sent with READ type instead of WRITE/DELETE. This
meant they were using potentially wrong consistency values. Although
synchronous commits aren't actually used anywhere, so this practically
this doesn't fix anything right now.
Timo Sirainen [Thu, 7 Sep 2017 12:40:16 +0000 (15:40 +0300)]
dict-sql: Use prepared statements
Create a hash table of query template -> prepared statement and fill it out
as needed. This could have been done some alternative ways that wouldn't
require building the string first, but this should still be fast enough and
much easier to implement.
Timo Sirainen [Tue, 15 Aug 2017 13:50:16 +0000 (16:50 +0300)]
dict-sql: Cleanup - Remove unnecessary code
The values are explicitly added to params. sql_dict_update_query() doesn't
add them again. Since the "diff" parameter is already a long long type,
this avoids unnecessary conversion to string and back.
Timo Sirainen [Tue, 15 Aug 2017 11:27:40 +0000 (14:27 +0300)]
dict-sql: Change "uint" type to mean 64bit instead of 32bit integer.
This is likely what is usually wanted (especially in e.g. quotas).
If someone actually wants it to be restricted to 32bit, we could add
uint32 later on.
Timo Sirainen [Tue, 5 Sep 2017 17:42:31 +0000 (20:42 +0300)]
master: Write all the early warnings to log file after logging is initialized
Any warnings (or errors) logged before settings were read and logging was
initialized caused them to be only written to stderr. This caused them to
be lost too easily. Now they are also buffered in memory and then flushed
to log files once logging is initialized.
Stephan Bosch [Thu, 2 Mar 2017 22:13:48 +0000 (23:13 +0100)]
lib: lib-signals: Removed explicit notification of ioloop change through lib_signals_reset_ioloop() in favor of implicit method.
Before, if the ioloop changed, the application had to explicitly notify lib-signals using lib_signals_reset_ioloop().
This is error-prone and requires doing this all over the Dovecot code base.
Now, lib-signals registers an ioloop switch callback that deals with this implicitly.
The application can detach lib-signals from the ioloop explicitly if delayed signal handling is not required/desired in the new ioloop.
Specific delayed signal handlers can be exempt from this automated behavior using a flag, meaning that such signal handlers need to be moved between ioloops explicitly.
Aki Tuomi [Sun, 27 Aug 2017 10:55:52 +0000 (13:55 +0300)]
doveadm-fs: Fix argument handling
If argument contains - and needs to be passed to doveadm-fs
then it needs -- to make sure getopt won't choke on it, and
due to this, we need to use getopt in doveadm-fs too, to make
sure -- gets removed.
manuel [Mon, 4 Sep 2017 15:43:31 +0000 (17:43 +0200)]
auth: cache: don't log password mismatch twice
If auth cache is enabled and the last auth was successful dovecot assumes the
password has been changed and invalidates the cache which results in
double logging of the same password mismatch.
This also applies to expired negative cache entries.