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.
Timo Sirainen [Mon, 4 Sep 2017 16:37:12 +0000 (19:37 +0300)]
pop3-migration: Fail if all IMAP mails were matched by size, but POP3 had extra mails
This makes the handling same as what happens when the same situation happens
and the last mails were matched by headers. That's an error, unless
pop3_migration_ignore_*_uidls=yes.
Timo Sirainen [Fri, 18 Aug 2017 08:51:36 +0000 (11:51 +0300)]
director: Run director/host changing doveadm commands only after ring is synced
If the ring sync is still pending, the doveadm command may become reverted.
This doesn't fully prevent problems caused by sending doveadm commands
simultaneously to multiple directors, but it should prevent issues when
only a single director is used for doveadm commands.
It would have been nice to enable this also for HOST/DIRECTOR-LIST commands,
but they don't support returning a ring timeout error without changing the
protocol. It's a bit too much effort to change that for now.
Timo Sirainen [Mon, 21 Aug 2017 12:11:30 +0000 (15:11 +0300)]
lib-storage: Fix error logging after mail_storage_set_internal_error()
The function doesn't actually set the last_internal_error and it also
doesn't update last_error_is_internal, so calling
mail_storage_get_last_internal_error() afterwards could be returning an
error for some different older error.
Since there's no parameter to set the internal error string, just reset
last_error_is_internal=FALSE.
Timo Sirainen [Fri, 25 Aug 2017 12:12:06 +0000 (15:12 +0300)]
lib-index: Avoid opening .log.2 file if .log was reset
After a reset there's no point in trying to read the older log files.
This avoids trying to open .log.2 at least for newly created mailboxes
when trying to lookup log file sequence 1 (since due to some bug/feature
the log files start from sequence 2).
Timo Sirainen [Thu, 24 Aug 2017 13:31:40 +0000 (16:31 +0300)]
master: Log "Processes aren't dying after reload" only when signals are sent
This required moving the warning after the "Sent SIG.. to .. processes"
warnings, which is a little bit annoying. However, now it's at least not
unnecessarily logging the warning when it's not doing anything about the
processes.
Timo Sirainen [Thu, 24 Aug 2017 13:24:21 +0000 (16:24 +0300)]
master: Improve killing processes when they don't die after reload
The old behavior was:
1. Send SIGTERM to all processes, except log
2. Send SIGTERM to all processes, including log
3. Send SIGKILL to all processes, including log
The new behavior is now:
1. Send SIGTERM to all processes, except log
2. Send SIGKILL to all processes, except log
Only after there aren't any processes left except log, send SIGTERM to it.
If that doesn't work, send SIGKILL.
Timo Sirainen [Fri, 18 Aug 2017 14:34:14 +0000 (17:34 +0300)]
lib-index: Add mail_cache_close_mail() to smartly drop cached data with INDEX=MEMORY
Instead of reseting the entire transaction buffer when 256 kB is reached,
just drop mails have have been marked closed with mail_cache_close_mail().
If that's not enough, continue deleting forcibly until the buffer is below
256 kB.
This is especially important when mail_prefetch_count>0 and INDEX=MEMORY.
In that case there can be multiple mails that are being added to cache
and used later on. If they were dropped from cache too early, the work
would have to be done all over again.
Timo Sirainen [Fri, 18 Aug 2017 08:09:41 +0000 (11:09 +0300)]
director: Fix rapid reconnection on failed outgoing connections
last_network_failure wasn't set, which caused a failed outgoing connection
to immediately reconnect to it. This resulted in rapid logging of
connect() errors.
Timo Sirainen [Thu, 10 Aug 2017 14:50:04 +0000 (17:50 +0300)]
director: Make sure users gets expired even on an idle director
Normally expiring gets done while looking up users, but if nothing is doing
that on an idle director the users won't get expired. This can cause confusion
in "doveadm director status" output.
Without this fix, if the new message does not contain a from, a subject, and
a snippet the generated JSON will be malformed (the status check at the end
appended a '"' when it shouldn't have).
Sergey Kitov [Tue, 15 Aug 2017 08:09:07 +0000 (11:09 +0300)]
auth: auth_request_log_unknown_user() to call common auth_request_log_login_failure()
Separate implementation of auth_request_log_unknown_user() is
replaced with call to auth_request_log_login_failure()
NOTE: behavior of the auth_request_log_unknown_user() is changed and
is in line with auth_request_log_password_mismatch()
Timo Sirainen [Mon, 14 Aug 2017 12:44:24 +0000 (15:44 +0300)]
cassandra: Fix confusing debug logging for paged query results.
Even when caller supported paged queries, the debug output contained
"Paged query has more results, but not supported by the caller".
Clear out the error after sql_result_more() is called, so it won't be
logged.
Timo Sirainen [Sat, 5 Aug 2017 05:33:12 +0000 (14:33 +0900)]
lib-index: Fix setting highest_modseq correctly in mail_index_modseq_header
The internally counted ctx->highest_modseq wasn't correct if all of the
records weren't synced. This could have happened for various reasons.
Since the view's current log seq/offset is used for the header, we can
also use the current highest_modseq from the view as well and it's
guaranteed to be correct.
This fixes various potential problems with using QRESYNC and CONDSTORE
extensions. It also fixes potential errors with unhibernating imap
clients, including:
Error: .../dovecot.index.log: Transaction log changed unexpectedly, can't get modseq
Timo Sirainen [Sat, 5 Aug 2017 05:29:12 +0000 (14:29 +0900)]
lib-index: Update per-flag modseq value a bit more correctly.
This changes the code to be similar to the per-mail modseq updating in
mail_index_modseq_update(). It probably wasn't exactly wrong previously
either, but this change is required for the following commits.