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 [Mon, 18 Sep 2017 20:04:55 +0000 (23:04 +0300)]
notify-status: Remove first_unseen_seq field
The sequence number keeps changing, so it's very unlikely to be useful.
It's also not always as efficiently available as the other fields, so
better to avoid having it.
Aki Tuomi [Tue, 4 Jul 2017 11:22:19 +0000 (14:22 +0300)]
notify-status: Add notify-status plugin
This enables updating a dictionary with mailbox
status information when the mailbox changes.
It requires notify_status_dict setting for specifying
the dict where the data is stored.
One can optionally use notify_status_mailbox patterns
for specifying which box(es) the status update is done.
Subsequent patterns are notify_status_mailbox2 and so forth.
One can also specify data format using notify_status_value
plugin setting.
Timo Sirainen [Fri, 14 Jul 2017 14:00:21 +0000 (17:00 +0300)]
master: Change service "connections are being dropped" warning interval to 1 second
When this is happening, it's often accompanied with all kinds of other errors and
these warnings drown in them. Make them easier to notice by reducing the interval
from 60 seconds to 1 second.
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.
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, 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, 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 [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).
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).
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: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 [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.
Aki Tuomi [Thu, 20 Jul 2017 05:49:25 +0000 (08:49 +0300)]
dict-ldap: Escape LDAP search filter properly
This is syntaxical escaping to make ldap servers accept queries
with escapable characters, instead of erroring out. It is possible
that the filter could have been modified in unexpected ways
if the input comes from untrusted sources.
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.
Timo Sirainen [Sat, 5 Aug 2017 05:11:17 +0000 (14:11 +0900)]
lib-index: Fix modseq tracking with multiple flag updates
The earlier code was checking only the first flag record update. If the
first one had only internal flag changes but (some of) the rest didn't,
the modseq wasn't counted correctly. This was probably pretty rare.
Timo Sirainen [Sat, 5 Aug 2017 05:07:58 +0000 (14:07 +0900)]
lib-index: Fix modseq tracking for MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ
This is used to increase modseq for mails when their private flags change.
Use an already existing MAIL_TRANSACTION_FLAG_UPDATE_IS_INTERNAL() that
does this properly.
(This change preserves another bug, which is fixed in the next commit.)
Timo Sirainen [Wed, 9 Aug 2017 10:23:36 +0000 (13:23 +0300)]
push-notification: Switch to main ioloop while calling drivers' deinit/cleanup callbacks
Continues a44595f7b1afc7ccbd8653598753b32899d01c76 to other functions.
For example the OX backend would call http_client_wait(), which would move
the I/Os and timeouts to the current ioloop, which might not be main_ioloop
always. When that ioloop gets destroyed, I/O and timeout leaks are logged
and eventually the process crashes when calling http_client_deinit() in
cleanup() (this would happen later for another mail_user).