This change also slightly changes the lmtp log prefixes in some places.
It removes "conn $ip:$port [$idx]: rcpt $user:" from some of the log
messages (but that wasn't in all of the log messages anyway), but it now
always includes mail_log_prefix in these log messages, which previously
wasn't always set at that point yet.
Timo Sirainen [Tue, 25 Oct 2022 10:27:23 +0000 (13:27 +0300)]
replicator: Make sure to prevent request starvation
This synchronizes how priority queue is ordered vs what
replicator_queue_want_sync_now() returns. The mismatch might have caused
request starvation in some situations because they behaved differently.
Also this change makes sure that higher priority requests don't infinitely
block lower priority requests. Instead, they get a temporary boost time
(hardcoded 15-45 minutes). Afterwards lower priority requests are started
to be handled as well.
Timo Sirainen [Tue, 25 Oct 2022 10:11:37 +0000 (13:11 +0300)]
replicator: Don't update user's last_update if priority doesn't change
This didn't actually matter, since it was only used to check if importing
should update an existing user. However, importing is only run at startup
when all users have last_update=0 anyway.
The following changes bring new use cases for last_update.
Timo Sirainen [Tue, 25 Oct 2022 09:49:03 +0000 (12:49 +0300)]
replicator: Fix user placement in replication queue
Especially replicator queue importing and NOTIFY command could have
placed the user to wrong place in the queue, because they modified the
last sync timestamps afterwards.
Fixed by splitting replicator_queue_add() into get/update/add(), so all
the necessary changes can be done before replicator_queue_add() is used
to place the user into the queue.
Timo Sirainen [Thu, 27 Oct 2022 21:56:29 +0000 (00:56 +0300)]
maildir: If mailbox create fails, don't try to apply mailbox_update changes
This was especially causing problems with mailbox GUID mismatches in dsync.
The mismatch wasn't automatically fixed, because mailbox_create() incorrectly
kept updating the mailbox GUID for the already existing mailbox.
Fixes errors such as:
Remote lost mailbox GUID ... (maybe it was just deleted?)
Markus Valentin [Thu, 3 Mar 2022 13:21:00 +0000 (14:21 +0100)]
imapc: imapc_connection_disconnect_full() - Only conditionally abort
Only abort commands if there are no reconnect commands. Otherwise these
still will be handled and the commands memory will be freed after handling
them.
If the imapc connection was already disconnected when calling
imapc_connection_disconnect() it didn't clean up the commands and
especially the command pools.
Aki Tuomi [Wed, 21 Sep 2022 08:14:40 +0000 (11:14 +0300)]
lib-storage: LAYOUT=index rebuild - Fix rebuilds when using multiple namespaces
The old code did not properly populate the mailbox list for each
namespace, but only for the first namespace. This caused mailbox
storage existence checks to always fail.
Timo Sirainen [Tue, 11 Oct 2022 08:17:11 +0000 (11:17 +0300)]
lib-storage: Store mailbox names unescaped in box-name header
This header is used when rebuilding mailbox list indexes with LAYOUT=index.
The escape character is currently hardcoded for LAYOUT=index, so this
couldn't have broken anything unless the hardcoded separator was changed.
Still, this was wrong/confusing behavior.
Aki Tuomi [Thu, 19 May 2022 09:39:55 +0000 (12:39 +0300)]
stats: stats-service-openmetrics - Always clear the stack before next metric body
If the attempt of generating output for the previous metric doesn’t completely
consume the stack, the next metric will start with a non-empty stack, which breaks
the metrics output.
Timo Sirainen [Thu, 19 May 2022 09:24:23 +0000 (11:24 +0200)]
doveadm: Add dsync_features=no-header-hashes
When this setting is enabled and one dsync side doesn't support mail GUIDs,
there is no fallback to using header hashes. Instead, dsync assumes that
all mails with identical IMAP UIDs contains the same mail contents. This
can significantly improve dsync performance with some IMAP servers that
don't support caching Date/Message-ID headers.
Timo Sirainen [Fri, 8 Apr 2022 12:59:59 +0000 (15:59 +0300)]
lib-index: Always write tail offset the same as head offset
The mail_index_write() must not be called unless this is safe to do.
This prevents unnecessarily reading through dovecot.index.log between
tail..head offsets, which can be expensive due to modseq calculation.
Timo Sirainen [Fri, 8 Apr 2022 12:10:53 +0000 (15:10 +0300)]
lib-index: Optimize modseq scanning by using the modseq header in index
View is very commonly set to start reading new changes since dovecot.index
was last written. When reading the newer records in dovecot.index.log, the
modseq of each change is needed to be known. However, the initial modseq
calculation was usually done inefficiently by reading the whole
dovecot.index.log from the beginning of the file. This change prevents
that by using instead the "modseq" header in dovecot.index to get the
initial modseq.
Timo Sirainen [Fri, 8 Apr 2022 10:42:55 +0000 (13:42 +0300)]
lib-index: Handle 0-sized dovecot.index.log record properly
The previous behavior was to just silently ignore it and have the next write
to the transaction log silently truncate away the trailing garbage.
Now if the log file isn't locked the issue is still ignored, since it's
possible that this is just a race condition. But if the log is locked,
it's handled as corruption.
Timo Sirainen [Wed, 2 Mar 2022 14:39:30 +0000 (09:39 -0500)]
dsync: Fix hierarchical mailbox name parts individually
For example with filesystem-based mailbox formats it's not allowed to create
"box/../child" mailbox. With previous code dsync just gave up and created
the mailbox name based on its GUID. This is now improved to instead try to
insert '_' character after each hierarchy separator so the newly fixed
mailbox name is "box/_../child".
Siavash Tavakoli [Mon, 25 Oct 2021 11:23:56 +0000 (12:23 +0100)]
lib-lua: Add a minimal interface to lib-http
Adds the ability to
- Creating http clients
- Creating http requests
- Adding arbitrary headers and payload to the http request
- Submitting the request to remote server and getting the response