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
Markus Valentin [Wed, 2 Feb 2022 15:58:24 +0000 (16:58 +0100)]
imapc: imapc_sync_handle_untagged_fetches() - Commit after adding the untagged fetch messages
The absence of the commit could have caused issues when
imapc_sync_finish() was not called as it left mbox->delayed_sync_trans
initialized but mbox->delayed_sync_view was NULL.
Markus Valentin [Mon, 17 Jan 2022 14:41:25 +0000 (15:41 +0100)]
imapc: imapc_untagged_fetch_handle() - Change return type to bool
When calling imapc_untagged_fetch_handle() also retrieve new_message_r
from it which allows imapc_mailbox_msgmap_update() to determine if the
message just handled was already in index or not.
Timo Sirainen [Mon, 21 Feb 2022 22:07:11 +0000 (23:07 +0100)]
dsync: If modseqs aren't permanent, assume HIGHESTMODSEQ=0
Otherwise the HIGHESTMODSEQ is just whatever happens to be in the in-memory
view of the index, which most likely isn't the true HIGHESTMODSEQ. Using 0
makes it clear that the HIGHESTMODSEQ isn't valid and can't be used.
Timo Sirainen [Mon, 21 Feb 2022 11:39:02 +0000 (12:39 +0100)]
lib: Fix losing log prefix or IP change when log process is busy
The fd for writing to log process is non-blocking. When sending options
to log process, it was done with write_full(), which stopped whenever
EAGAIN was returned. This error was simply ignored, and the logging code
thought that the prefix was successfully changed (or the IP was sent).
This mainly caused a problem when processes were reused and log process
was busy. The prefix update could have failed, and the following logging
would be using the previous session's log prefix, i.e. log lines could have
been logged for the wrong user/session.
Timo Sirainen [Mon, 25 Oct 2021 12:43:00 +0000 (15:43 +0300)]
lib-storage: Don't use cached message_parts while message is being parsed
Finish the parsing instead. Otherwise there can be some confusion about
parsed_bodystructure* fields, which indicate that data->parts have the
bodystructure info while in reality data->parts came from cached fields
and they have no bodystructure info.
Marco Bettini [Tue, 1 Feb 2022 13:22:31 +0000 (14:22 +0100)]
mail-crypt: Fix for mail being wrongly storing encrypted via LMTP
If 1st recipient has mail_crypt_save_version=2,
and 2nd recipient has mail_crypt_save_version=0,
the mail for 2nd recipient is wrongly stored encrypted.
Same happens if 2nd recipient has mail_crypt disabled