]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
3 years agoNEWS: Add news for 2.3.19.1 release-2.3.19 2.3.19.1
Aki Tuomi [Mon, 13 Jun 2022 10:28:22 +0000 (13:28 +0300)] 
NEWS: Add news for 2.3.19.1

3 years agodoveadm deduplicate: Allocate memory properly for keys in hash table
Timo Sirainen [Mon, 13 Jun 2022 06:56:13 +0000 (09:56 +0300)] 
doveadm deduplicate: Allocate memory properly for keys in hash table

This caused wrong mails to be deleted somewhat randomly.
Broken by 320844f50cd669b602d30210e2e5216f65d2050f

3 years agolib-compression: istream-decompress - Copy parent stream name
Timo Sirainen [Tue, 24 May 2022 12:52:26 +0000 (15:52 +0300)] 
lib-compression: istream-decompress - Copy parent stream name

This is needed, because istream-decompress doesn't actually use the parent
stream as the istream parent.

3 years agoauth: Fix assert-crash in iterating multiple userdbs
Timo Sirainen [Wed, 18 May 2022 08:31:44 +0000 (11:31 +0300)] 
auth: Fix assert-crash in iterating multiple userdbs

Broken by 501e17ba6b448ba3c88338596e0e8f99f0693f79

Fixes:
Panic: file userdb-blocking.c: line 125 (userdb_blocking_iter_next): assertion failed: (ctx->conn != NULL)

3 years agoNEWS: Update date for 2.3.19 news 2.3.19
Aki Tuomi [Wed, 4 May 2022 12:47:03 +0000 (15:47 +0300)] 
NEWS: Update date for 2.3.19 news

3 years agofts: Fix optimizing searches in virtual mailboxes without up-to-date indexes
Timo Sirainen [Mon, 2 May 2022 21:27:47 +0000 (00:27 +0300)] 
fts: Fix optimizing searches in virtual mailboxes without up-to-date indexes

This could have caused header searches in virtual mailboxes to not return
all results when fts_enforced!=yes

Broken by 9705b81fb51b5bdeaba12932a390ced2cc9dcad7

3 years agoNEWS: Add news for 2.3.19
Aki Tuomi [Tue, 26 Apr 2022 06:30:10 +0000 (09:30 +0300)] 
NEWS: Add news for 2.3.19

3 years agoNEWS: Update news for 2.3.18 - final fixups
Timo Sirainen [Tue, 1 Feb 2022 18:29:46 +0000 (19:29 +0100)] 
NEWS: Update news for 2.3.18 - final fixups

3 years agoNEWS: Update news for 2.3.18
Aki Tuomi [Wed, 12 Jan 2022 09:34:02 +0000 (11:34 +0200)] 
NEWS: Update news for 2.3.18

3 years agolib-lua: dlua-dovecot-http - Support more settings with HTTP client
Aki Tuomi [Mon, 25 Apr 2022 07:43:45 +0000 (10:43 +0300)] 
lib-lua: dlua-dovecot-http - Support more settings with HTTP client

3 years agolib-http: Rename max_auto_retry_delay to max_auto_retry_delay_secs
Aki Tuomi [Mon, 25 Apr 2022 11:27:12 +0000 (14:27 +0300)] 
lib-http: Rename max_auto_retry_delay to max_auto_retry_delay_secs

3 years agoconfigure: Update version
Aki Tuomi [Tue, 26 Apr 2022 06:35:15 +0000 (09:35 +0300)] 
configure: Update version

3 years agoauth: auth_worker_call() - Return void instead of the connection
Timo Sirainen [Tue, 19 Apr 2022 08:42:05 +0000 (11:42 +0300)] 
auth: auth_worker_call() - Return void instead of the connection

The return value is no longer necessary, and it most likely would just be
used wrong.

3 years agoauth: Fix crash when user iteration request is queued
Timo Sirainen [Tue, 19 Apr 2022 08:40:52 +0000 (11:40 +0300)] 
auth: Fix crash when user iteration request is queued

auth_worker_call() returns NULL when the request couldn't be handled
immediately, which would result in NULL pointer dereference later on.

3 years agoauth: Add connection parameter to auth_worker_callback_t
Timo Sirainen [Tue, 19 Apr 2022 08:39:35 +0000 (11:39 +0300)] 
auth: Add connection parameter to auth_worker_callback_t

3 years agodoveadm: Fix hang when flushing a corked print-ostream
Timo Sirainen [Thu, 14 Apr 2022 11:46:59 +0000 (13:46 +0200)] 
doveadm: Fix hang when flushing a corked print-ostream

This could have happened at least with doveadm sync/backup command,
i.e. causing replication to hang until timeout is reached:

Error: write(<local>) failed: Timed out after 60 seconds

3 years agolib-index: Always write tail offset the same as head offset
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.

3 years agolib-index: Optimize modseq scanning by using the modseq header in index
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.

3 years agolib-index: Handle 0-sized dovecot.index.log record properly
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.

3 years agolib: test-event-flatten - Use __FILE__ to get correct expected filename
Aki Tuomi [Tue, 12 Apr 2022 07:12:11 +0000 (10:12 +0300)] 
lib: test-event-flatten - Use __FILE__ to get correct expected filename

Fixes out of tree buids

Broken in 4f752d381c8e19dd07d1e593996d02294668c8b6

3 years agoauth: db-oauth2 - Fix off by one in oauth2 variable handling
Aki Tuomi [Tue, 1 Mar 2022 08:01:06 +0000 (10:01 +0200)] 
auth: db-oauth2 - Fix off by one in oauth2 variable handling

Broken in 9b670175445a75987a713ff899d1a945255b0b5b

3 years agodsync: Properly terminate escape_chars when escaping mailbox names
Timo Sirainen [Mon, 21 Mar 2022 09:03:03 +0000 (11:03 +0200)] 
dsync: Properly terminate escape_chars when escaping mailbox names

Broken by 596c5a52e7e554571285e90063712cb0d37b34eb

3 years agodsync: Fix hierarchical mailbox name parts individually
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".

3 years agodsync: Escape and unescape mailbox names as needed
Timo Sirainen [Tue, 1 Mar 2022 13:37:57 +0000 (08:37 -0500)] 
dsync: Escape and unescape mailbox names as needed

This should fix various issues with syncing local and remote mailbox names.
It especially avoids changing the escape character to alt_char.

3 years agodsync: Track whether escape character was added just for dsync
Timo Sirainen [Tue, 1 Mar 2022 16:51:04 +0000 (11:51 -0500)] 
dsync: Track whether escape character was added just for dsync

Will be used by the following commit

3 years agodsync: Add clarifying comment about mailbox_log_record.maibox_guid contents
Timo Sirainen [Tue, 1 Mar 2022 13:36:55 +0000 (08:36 -0500)] 
dsync: Add clarifying comment about mailbox_log_record.maibox_guid contents

3 years agodsync: Add escape_char to dsync-mailbox-tree
Timo Sirainen [Tue, 1 Mar 2022 13:06:14 +0000 (08:06 -0500)] 
dsync: Add escape_char to dsync-mailbox-tree

This will be used by the following changes.

3 years agolib-test: test-subprocess - Free subprocess before forking
Aki Tuomi [Fri, 18 Mar 2022 07:41:37 +0000 (09:41 +0200)] 
lib-test: test-subprocess - Free subprocess before forking

Otherwise it'll leak memory.

Broken in 34bdfdcbc7e3b374a219732329b6ce6d84a7666e

3 years agolib-lua: Add a minimal interface to lib-http
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

3 years agodoveadm-who: Do not parse numbers as IP addresses
Aki Tuomi [Mon, 14 Mar 2022 08:18:58 +0000 (10:18 +0200)] 
doveadm-who: Do not parse numbers as IP addresses

Fixes doveadm kick as well.

Broken in 381daab1e3b56a0bc94d2191cf62beba0df51af9

3 years agolib: test-seqset-builder - Add missing seqset_builder_deinit()
Markus Valentin [Tue, 1 Mar 2022 11:06:20 +0000 (12:06 +0100)] 
lib: test-seqset-builder - Add missing seqset_builder_deinit()

Fixes leaking memory when running tests.

3 years agoimapc: imapc_transaction_save_rollback() - Fix NULL-check for ctx->src_mbox
Markus Valentin [Tue, 1 Mar 2022 12:49:39 +0000 (13:49 +0100)] 
imapc: imapc_transaction_save_rollback() - Fix NULL-check for ctx->src_mbox

Assert that unfinished context implies that ctx->src_mbox is non-NULL.
Also check for ctx->src_mbox being non-NULL before deinitializing it.

3 years agoimapc: imapc_mailbox_msgmap_update() - Set new_message_r
Markus Valentin [Mon, 28 Feb 2022 12:15:06 +0000 (13:15 +0100)] 
imapc: imapc_mailbox_msgmap_update() - Set new_message_r

In case a message has not yet been keep the reply till syncing and do
not discard it right away.

3 years agoimapc: Delay fetching state after untagged exists reply
Markus Valentin [Thu, 24 Feb 2022 14:31:39 +0000 (15:31 +0100)] 
imapc: Delay fetching state after untagged exists reply

3 years agoimapc: imapc_copy() - Make sure capabilities are known before copying
Markus Valentin [Thu, 16 Dec 2021 08:11:55 +0000 (09:11 +0100)] 
imapc: imapc_copy() - Make sure capabilities are known before copying

3 years agoimapc: Implement rollback for failed copies
Markus Valentin [Thu, 11 Nov 2021 15:17:35 +0000 (16:17 +0100)] 
imapc: Implement rollback for failed copies

3 years agoimapc: imapc_save_copyuid() deduplicate code
Markus Valentin [Thu, 11 Nov 2021 17:31:54 +0000 (18:31 +0100)] 
imapc: imapc_save_copyuid() deduplicate code

3 years agoimapc: Enable bulk copying if remote backend has UIDPLUS capability
Markus Valentin [Thu, 11 Nov 2021 15:18:09 +0000 (16:18 +0100)] 
imapc: Enable bulk copying if remote backend has UIDPLUS capability

3 years agoimapc: Implement bulk copying for imapc
Markus Valentin [Thu, 11 Nov 2021 13:52:54 +0000 (14:52 +0100)] 
imapc: Implement bulk copying for imapc

3 years agoimapc: Extract imapc_copy_simple() from imapc_copy()
Markus Valentin [Thu, 11 Nov 2021 15:10:53 +0000 (16:10 +0100)] 
imapc: Extract imapc_copy_simple() from imapc_copy()

Keep the old one by one copying functionality as simple call. This will
be used if the remote backend does not have the UIDPLUS capability.

3 years agolib-storage: index_save_context_free() - Add assertion on non-NULL ctx->dest_mail
Markus Valentin [Wed, 12 Jan 2022 14:09:16 +0000 (15:09 +0100)] 
lib-storage: index_save_context_free() - Add assertion on non-NULL ctx->dest_mail

3 years agolib: Add seq-set-builder and tests for it
Markus Valentin [Wed, 8 Dec 2021 16:17:56 +0000 (17:17 +0100)] 
lib: Add seq-set-builder and tests for it

3 years agolib-storage: imapc_mailbox_close() - Remove unprocessed untagged_fetch_contexts
Marco Bettini [Thu, 10 Feb 2022 16:37:59 +0000 (17:37 +0100)] 
lib-storage: imapc_mailbox_close() - Remove unprocessed untagged_fetch_contexts

3 years agolib-storage: Remove trainling spaces
Marco Bettini [Thu, 10 Feb 2022 15:26:10 +0000 (16:26 +0100)] 
lib-storage: Remove trainling spaces

3 years agoimapc: imapc_sync_handle_untagged_fetches() - Commit after adding the untagged fetch...
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.

Broken by 55a8c2d294bb2f764209c7ce455d258b2b7506f5

3 years agoimapc: Start to handle new untagged fetch messages in imapc_sync()
Markus Valentin [Tue, 18 Jan 2022 08:46:32 +0000 (09:46 +0100)] 
imapc: Start to handle new untagged fetch messages in imapc_sync()

3 years agoimapc: Add imapc_sync_handle_untagged_fetches()
Markus Valentin [Tue, 18 Jan 2022 08:22:24 +0000 (09:22 +0100)] 
imapc: Add imapc_sync_handle_untagged_fetches()

3 years agoimapc: imapc_untagged_fetch_handle() - Change return type to bool
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.

3 years agoimapc: imapc_untagged_fetch_update_flags() - Reduce indentation
Markus Valentin [Thu, 27 Jan 2022 07:06:16 +0000 (08:06 +0100)] 
imapc: imapc_untagged_fetch_update_flags() - Reduce indentation

3 years agoimapc: Split off imapc_untagged_fetch_update_flags() for handling flag updates
Markus Valentin [Thu, 27 Jan 2022 06:56:32 +0000 (07:56 +0100)] 
imapc: Split off imapc_untagged_fetch_update_flags() for handling flag updates

3 years agoimapc: Introduce imapc_untagged_fetch_ctx
Markus Valentin [Mon, 17 Jan 2022 14:00:41 +0000 (15:00 +0100)] 
imapc: Introduce imapc_untagged_fetch_ctx

3 years agoimapc: Decouple imapc_untagged_fetch parsing and handling
Markus Valentin [Mon, 17 Jan 2022 12:57:56 +0000 (13:57 +0100)] 
imapc: Decouple imapc_untagged_fetch parsing and handling

3 years agosubmission-login: Add workaround for SMTP backend that is not Dovecot.
Stephan Bosch [Wed, 9 Mar 2022 01:30:12 +0000 (02:30 +0100)] 
submission-login: Add workaround for SMTP backend that is not Dovecot.

Adds workaround called "exotic-backend".

3 years agoauth: auth-cache - Always use translated_username as cache key
Aki Tuomi [Wed, 2 Mar 2022 13:40:16 +0000 (15:40 +0200)] 
auth: auth-cache - Always use translated_username as cache key

This fixes auth cache when passdb/userdb changes the user field.

3 years agoauth: Set translated_user to requested_login_user in master login
Aki Tuomi [Wed, 2 Mar 2022 12:57:20 +0000 (14:57 +0200)] 
auth: Set translated_user to requested_login_user in master login

Fixes caching issues with master logins.

3 years agoauth: Include cache hit/miss information in passdb/userdb lookup end events
Aki Tuomi [Tue, 6 Jul 2021 11:02:41 +0000 (14:02 +0300)] 
auth: Include cache hit/miss information in passdb/userdb lookup end events

3 years agofts: Parse mail header before checking whether to index it
Marco Bettini [Mon, 28 Feb 2022 16:12:32 +0000 (17:12 +0100)] 
fts: Parse mail header before checking whether to index it

Fixes an issue where mime parts Content-type wasn't properly set,
causing binary mime parts to be fed to the indexes.

Broken in ddb85f3533842aa7c4e943c10bbd3dcb745c2eae

3 years agodsync: Log reason why mailbox is synced with debug logging
Timo Sirainen [Fri, 18 Feb 2022 16:31:43 +0000 (18:31 +0200)] 
dsync: Log reason why mailbox is synced with debug logging

3 years agodsync: If modseqs aren't permanent, assume HIGHESTMODSEQ=0
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.

3 years agosubmission-login: submission-proxy - Do not include initial response in AUTH command...
Stephan Bosch [Sat, 12 Feb 2022 14:07:39 +0000 (15:07 +0100)] 
submission-login: submission-proxy - Do not include initial response in AUTH command if it is too long.

3 years agosubmission-login: submission-proxy - Rename local variable in proxy_send_login().
Stephan Bosch [Mon, 21 Feb 2022 20:36:55 +0000 (21:36 +0100)] 
submission-login: submission-proxy - Rename local variable in proxy_send_login().

3 years agolib-smtp: smtp-client - Move SMTP_BASE_LINE_LENGTH_LIMIT definition to smtp-common.h.
Stephan Bosch [Mon, 21 Feb 2022 20:32:45 +0000 (21:32 +0100)] 
lib-smtp: smtp-client - Move SMTP_BASE_LINE_LENGTH_LIMIT definition to smtp-common.h.

3 years agolib-smtp: smtp-client-connection - Rename SMTP_CLIENT_BASE_LINE_LENGTH_LIMIT to SMTP_...
Stephan Bosch [Mon, 21 Feb 2022 20:29:23 +0000 (21:29 +0100)] 
lib-smtp: smtp-client-connection - Rename SMTP_CLIENT_BASE_LINE_LENGTH_LIMIT to SMTP_BASE_LINE_LENGTH_LIMIT.

3 years agolib-smtp: smtp-client-connection - Fix typo in comment.
Stephan Bosch [Wed, 23 Feb 2022 13:21:02 +0000 (14:21 +0100)] 
lib-smtp: smtp-client-connection - Fix typo in comment.

3 years agodirector: Fix crashes caused by changing host tag
Timo Sirainen [Tue, 22 Feb 2022 13:14:20 +0000 (14:14 +0100)] 
director: Fix crashes caused by changing host tag

Fixes:
Panic: file director.c: line 1175 (director_move_user): assertion failed: (user->host->tag == host->tag)
Panic: file director-request.c: line 303 (director_request_continue_real): assertion failed: (user->host->tag == mail_tag)

3 years agodirector: Prevent loops where directors keep changing host tags
Timo Sirainen [Tue, 22 Feb 2022 13:10:02 +0000 (14:10 +0100)] 
director: Prevent loops where directors keep changing host tags

3 years agolib: If log prefix update can't be sent to log, exit with FATAL_LOGERROR
Timo Sirainen [Mon, 21 Feb 2022 11:47:29 +0000 (12:47 +0100)] 
lib: If log prefix update can't be sent to log, exit with FATAL_LOGERROR

3 years agolib: Fix losing log prefix or IP change when log process is busy
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.

Broken by 9372e48b702a3af5705785e08fbf47b0e37f2047

3 years agodict: Fix potential timeout leak at deinit
Timo Sirainen [Sun, 6 Feb 2022 13:20:08 +0000 (14:20 +0100)] 
dict: Fix potential timeout leak at deinit

The deinit code could still trigger proctitle refresh.

3 years agodict: Make sure proctitle refresh timeout goes to the main ioloop
Timo Sirainen [Tue, 22 Feb 2022 10:23:33 +0000 (11:23 +0100)] 
dict: Make sure proctitle refresh timeout goes to the main ioloop

In some situations it could have gone to dict_wait() ioloop, causing
timeout leaks or crashes.

3 years agolib-storage: Don't use cached message_parts while message is being parsed
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.

3 years agolib-storage: Reset bodystructure parsing state when reseting message_parts
Timo Sirainen [Mon, 25 Oct 2021 09:22:06 +0000 (12:22 +0300)] 
lib-storage: Reset bodystructure parsing state when reseting message_parts

Fixes:
Panic: file message-part-data.c: line 28 (message_part_data_is_plain_7bit): assertion failed: (data != NULL)

3 years agodict-sql: Fix assert-crash if trying to rollback an open set/inc transaction
Timo Sirainen [Wed, 9 Feb 2022 21:12:19 +0000 (23:12 +0200)] 
dict-sql: Fix assert-crash if trying to rollback an open set/inc transaction

Fixes:
Panic: file dict-sql.c: line 911 (sql_dict_transaction_free): assertion failed: (!array_is_created(&ctx->prev_set))

3 years agoanvil: connect_limit_deinit() - Free ident_pid_hash elements
Martti Rannanjärvi [Fri, 4 Feb 2022 02:30:48 +0000 (04:30 +0200)] 
anvil: connect_limit_deinit() - Free ident_pid_hash elements

3 years agoindexer: indexer_client_status_callback() - Fix accessing freed memory
Marco Bettini [Fri, 11 Feb 2022 08:17:58 +0000 (09:17 +0100)] 
indexer: indexer_client_status_callback() - Fix accessing freed memory

Broken by a9683d7b3

3 years agoindexer: Fix memory leak on indexer timeout
Marco Bettini [Mon, 7 Feb 2022 15:04:41 +0000 (16:04 +0100)] 
indexer: Fix memory leak on indexer timeout

3 years agostats: stats_metrics_remove_dynamic() - Free the removed metric
Martti Rannanjärvi [Thu, 3 Feb 2022 23:28:45 +0000 (01:28 +0200)] 
stats: stats_metrics_remove_dynamic() - Free the removed metric

3 years agostats: stats_metric_alloc() - Fix indentation on p_new() call
Martti Rannanjärvi [Thu, 3 Feb 2022 23:32:18 +0000 (01:32 +0200)] 
stats: stats_metric_alloc() - Fix indentation on p_new() call

3 years agoreplication: aggregator - Free replicator_connection content
Martti Rannanjärvi [Mon, 31 Jan 2022 10:42:46 +0000 (12:42 +0200)] 
replication: aggregator - Free replicator_connection content

3 years agomail-crypt: Fix for mail being wrongly storing encrypted via LMTP
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

3 years agomail-crypt: Remove "plugin disabled" texts from errors
Timo Sirainen [Tue, 31 Mar 2020 10:51:09 +0000 (13:51 +0300)] 
mail-crypt: Remove "plugin disabled" texts from errors

The plugin isn't just disabled, the user initialization fails entirely.

3 years agomail-crypt: Fix crash when plugin is already initialized, but not used for another...
Timo Sirainen [Tue, 31 Mar 2020 10:49:28 +0000 (13:49 +0300)] 
mail-crypt: Fix crash when plugin is already initialized, but not used for another user

Fixes:
Panic: Module context mail_crypt_user_module missing

3 years agodoveadm deduplicate: Simplify code by using doveadm_mail_iter_deinit_sync()
Timo Sirainen [Thu, 29 Apr 2021 18:09:01 +0000 (21:09 +0300)] 
doveadm deduplicate: Simplify code by using doveadm_mail_iter_deinit_sync()

3 years agodoveadm deduplicate: Optimize by deduplicating in a single transaction
Timo Sirainen [Thu, 29 Apr 2021 18:05:40 +0000 (21:05 +0300)] 
doveadm deduplicate: Optimize by deduplicating in a single transaction

3 years agopop3: Fix empty command handling
Aki Tuomi [Mon, 14 Feb 2022 11:50:02 +0000 (13:50 +0200)] 
pop3: Fix empty command handling

If empty command is given, error out instead of trying to create event.
This fixes a crash caused by d2ab26be6038bd53b13a3ff18c403d6c192c1d91.

3 years agolib-master: Fix deinit memory leak with process_shutdown_filter
sergey.kitov [Wed, 2 Feb 2022 15:01:49 +0000 (17:01 +0200)] 
lib-master: Fix deinit memory leak with process_shutdown_filter

3 years agoplugins/fts: Allow plugins to carry state across calls during search session
Marco Bettini [Fri, 17 Dec 2021 08:27:07 +0000 (09:27 +0100)] 
plugins/fts: Allow plugins to carry state across calls during search session

3 years agoauth: ldap: Drop partially saved results before retrying request
Timo Sirainen [Wed, 26 Jan 2022 14:09:29 +0000 (16:09 +0200)] 
auth: ldap: Drop partially saved results before retrying request

Fixes "LDAP search returned multiple entries" happening after reconnects.

3 years agoauth: ldap: If any requests were lost, reconnect to LDAP server
Timo Sirainen [Wed, 26 Jan 2022 14:03:27 +0000 (16:03 +0200)] 
auth: ldap: If any requests were lost, reconnect to LDAP server

3 years agoauth: ldap: If LDAP connection appears to be hanging, abort all old requests
Timo Sirainen [Wed, 26 Jan 2022 14:00:45 +0000 (16:00 +0200)] 
auth: ldap: If LDAP connection appears to be hanging, abort all old requests

Retrying the reconnect might fix them, but since this situation isn't
supposed to happen in the first place, it's safer to just remove them
entirely to guarantee that it's not trying to keep retrying them for
a long time.

3 years agoauth: ldap: Reconnect to server if receiving unknown msgid
Timo Sirainen [Wed, 26 Jan 2022 12:46:55 +0000 (14:46 +0200)] 
auth: ldap: Reconnect to server if receiving unknown msgid

It's unclear why this happens. Is it a bug on server or client side?
Either way, this situation doesn't now fix itself automatically, so
reconnecting should help.

3 years agoauth: ldap: Stop re-sending request after 3 disconnect+reconnects
Timo Sirainen [Wed, 26 Jan 2022 12:43:01 +0000 (14:43 +0200)] 
auth: ldap: Stop re-sending request after 3 disconnect+reconnects

This prevents retrying the same LDAP request forever in situations where the
request causes LDAP server to become disconnected. This might fix some real
issues, but it was mainly implemented because testing the following commit
caused infinite looping.

3 years agolmtp: proxy - Add per-connection counter to session_id
Timo Sirainen [Tue, 1 Feb 2022 13:57:16 +0000 (14:57 +0100)] 
lmtp: proxy - Add per-connection counter to session_id

This way connections to two different backends don't try to use the same
session_id. Add 'P' letter before the counter to clarify that it's the
proxy connection counter.

3 years agolmtp: Simplify/clarify per-recipient session ID
Timo Sirainen [Tue, 1 Feb 2022 13:40:48 +0000 (14:40 +0100)] 
lmtp: Simplify/clarify per-recipient session ID

The session ID is the transaction ID followed by an increasing recipient
count (number of RCPT commands) in the SMTP transaction. Clarify this by
adding 'R' letter before the counter. Also don't add the counter suffix at
all for the first recipient, since most transactions only have a single
recipient.

3 years agolib-smtp: server-transaction - Simplify/clarify transaction ID
Timo Sirainen [Tue, 1 Feb 2022 13:35:05 +0000 (14:35 +0100)] 
lib-smtp: server-transaction - Simplify/clarify transaction ID

The transaction ID is the session ID followed by an increasing transaction
count (number of MAIL commands) in the SMTP server connection. Clarify
this by adding 'T' letter before the counter. Also don't add the counter
suffix at all for the first session, since most sessions only have a
single transaction.

3 years agolib-smtp, lmtp: Add brackets to <session-id> in logging
Timo Sirainen [Tue, 1 Feb 2022 13:29:43 +0000 (14:29 +0100)] 
lib-smtp, lmtp: Add brackets to <session-id> in logging

This makes it clearer where the session-id stops. It's also similar to
how it is in mail_log_prefix.

3 years agolmtp: proxy - Use recipient-specific session-id when logging the result
Timo Sirainen [Tue, 1 Feb 2022 14:03:15 +0000 (15:03 +0100)] 
lmtp: proxy - Use recipient-specific session-id when logging the result

Instead of transaction ID, which is shared between recipients.

3 years agolmtp: struct lmtp_recipient - Change all strings to const
Timo Sirainen [Tue, 1 Feb 2022 15:00:36 +0000 (16:00 +0100)] 
lmtp: struct lmtp_recipient - Change all strings to const

3 years agolib-storage: LAYOUT=index: Fix accessing freed memory when deleting \Noselect parents
Markus Valentin [Thu, 27 Jan 2022 20:40:25 +0000 (21:40 +0100)] 
lib-storage: LAYOUT=index: Fix accessing freed memory when deleting \Noselect parents

Broken by f5328d6f7e4a8e460c736fa0336f5766aa58abda

3 years agolib-http: http_server_resource_create() - Remove unnecessary pool allocation
Markus Valentin [Fri, 28 Jan 2022 09:54:53 +0000 (10:54 +0100)] 
lib-http: http_server_resource_create() - Remove unnecessary pool allocation

Fixes leaking the memory pool created in stats_http_resource_add()