Timo Sirainen [Fri, 16 Feb 2018 14:03:46 +0000 (16:03 +0200)]
doveadm sync/backup: Don't override BROKENCHAR if it's already set
This allows migrating invalid mailbox names by specifying BROKENCHAR.
Previously it would always try to use \003 control character, which isn't
valid character in mailbox names so the mailbox creation would fail.
lib-storage: move snippet generation to mail-save-finish
This is necessary because some storage backends (most notably sdbox) do
not allow getting the mail stream before the mail is fully written out.
(See written_to_disk in sdbox-file.h.)
If we could avoid getting the stream to generate a snippet we could
leave this where it is.
Timo Sirainen [Thu, 15 Feb 2018 16:16:15 +0000 (18:16 +0200)]
imap: Don't set storage callbacks before namespaces are created
This fixes sending untagged OK/NO notifications from storage (e.g. lock
waits/override notifications). It was broken by e031d9aaae59a9f79710dc1138b76b69272615a3
Aki Tuomi [Thu, 30 Nov 2017 13:47:25 +0000 (15:47 +0200)]
lib-master: Support validating config filters against requests
Validation will sanitize the input request and drop any fields
that have no filter in config. E.g. if you have a local block
with name, and nothing else, then lip/rip will be dropped
from the request.
charset-alias-plugin.c:113:27: error: comparison between pointer and zero
character constant [-Werror=pointer-compare]
for (i = 0; keyvalues[i] != '\0'; i++) {
^~
charset-alias-plugin.c:113:14: note: did you mean to dereference the pointer?
for (i = 0; keyvalues[i] != '\0'; i++) {
Stephan Bosch [Tue, 17 Oct 2017 01:19:19 +0000 (03:19 +0200)]
doveadm-server: http: Fixed lingering connections after the request is sent.
Turns out conn->http_client is already NULL while doveadm_http_server_connection_destroy() is called.
This is because http_server_connection_unref() sets it to NULL;
Fixed by removing useless HTTP connection reference.
Timo Sirainen [Tue, 9 Jan 2018 20:37:25 +0000 (15:37 -0500)]
lib-storage: Lock mailbox_list for mailbox create/delete/rename
This is only required for mailbox creation to fix a race condition with
LAYOUT=index: If INBOX doesn't exist it will rescan the mailboxes to
find out if there are any missing ones. If INBOX creation isn't locked,
it's possible that the first process hasn't finished creating INBOX
before the second process find it and attempts to open it.
The delete and rename locking are probably useful to guard against race
conditions when clients intentionally issues create/delete/rename commands
concurrently.
Timo Sirainen [Tue, 6 Feb 2018 15:35:18 +0000 (17:35 +0200)]
lib: Add file_lock_from_dotlock()
The dotlock creation requires various settings, so the file-lock.h API can't
easily be used to create it. But once created, it's simpler to keep all lock
types in the same struct file_lock, which can be unlocked/freed once
finished.
Timo Sirainen [Tue, 12 Dec 2017 16:10:40 +0000 (18:10 +0200)]
LAYOUT=index: Fix updating STATUS changes in mailbox list index
Mailbox list index backend code was overriding sync_init and sync_deinit
methods, which STATUS handling had already already overridden. They both
used the same super struct, so STATUS's sync_* were never called.
Timo Sirainen [Mon, 5 Feb 2018 20:21:13 +0000 (22:21 +0200)]
fts: Don't reindex FTS mails if .cache file is deleted
This means that if fts is enabled, "doveadm index" no longer adds mails
to dovecot.index.cache if it's deleted. However, it was rarely used for
that purpose. More likely due to a corrupted cache file all the mails were
unnecessarily being opened and reindexed.
Stephan Bosch [Mon, 29 Jan 2018 18:10:38 +0000 (19:10 +0100)]
doveadm: dsync: Switch ioloop for input/output streams while making TCP connection.
This task is performed in a sub-ioloop, and when returning from that ioloop, the
output stream would sometimes still have an object on the sub-ioloop that was
just destroyed.
Stephan Bosch [Mon, 29 Jan 2018 17:28:25 +0000 (18:28 +0100)]
lib-ssl-iostream: openssl: Make verbose logging robust against i_debug() writing to stream itself.
In dsync, i_debug() is overridden to write to the SSL stream itself through a
multiplexed data stream. So, during the i_debug() call all kinds of things can
happen to the persisted error string in the stream, which caused problems.
Timo Sirainen [Mon, 5 Feb 2018 21:54:33 +0000 (23:54 +0200)]
fts: Fix searching headers with TEXT/BODY
TEXT is searching headers and BODY is searching MIME headers. Those headers
were indexed with data language, so search must also include data language
when looking up words. We'll just include the data language for all
searches now, so it should always work correctly.
imap: Iterate over ns settings when deciding to add SPECIAL-USE capability
To determine whether we should add the SPECIAL-USE capability to the
OK response to LOGIN, we have to iterate over namespace and mailbox
*settings* since the namespaces haven't been set up yet.