]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
2 years agostats: openmetrics - Create metrics for all specified fields
Aki Tuomi [Thu, 26 Jan 2023 06:15:29 +0000 (08:15 +0200)] 
stats: openmetrics - Create metrics for all specified fields

2 years agodsync: Fix handling mailboxes with % character when BROKENCHAR isn't explicitly set...
Timo Sirainen [Mon, 3 Apr 2023 21:43:55 +0000 (00:43 +0300)] 
dsync: Fix handling mailboxes with % character when BROKENCHAR isn't explicitly set in config

When vname_escape_char (= BROKENCHAR) isn't explicitly set in configuration,
'%' character (or if it was hierarchy separator, '~') was used as the default
internal escape character. However, this was used inconsistently between local
and remote mailbox trees. The remote tree stored the mailbox names unescaped,
while the local mailbox names were escaped. This inconsistency caused dsync
to do unnecessary mailbox renames, which might have ended up failing.

This especially fixes dsync failures when mailbox name ended with the '%'
character.

2 years agodsync: Refactor dsync_brain_mailbox_to_parts() into dsync_mailbox_name_to_parts()
Timo Sirainen [Mon, 3 Apr 2023 21:43:04 +0000 (00:43 +0300)] 
dsync: Refactor dsync_brain_mailbox_to_parts() into dsync_mailbox_name_to_parts()

2 years agovirtual: virtual_backend_box_lookup() - Enforce callers to check if the call succeeded
Marco Bettini [Mon, 20 Mar 2023 14:00:48 +0000 (14:00 +0000)] 
virtual: virtual_backend_box_lookup() - Enforce callers to check if the call succeeded

2 years agovirtual: virtual_sync_apply_existing_expunges() - Don't crash if the backend mailbox...
Marco Bettini [Fri, 24 Mar 2023 13:50:29 +0000 (13:50 +0000)] 
virtual: virtual_sync_apply_existing_expunges() - Don't crash if the backend mailbox has been removed

2 years agolib-index: Fix assert-crash when header's log_file_seq/offset shrinks
Timo Sirainen [Mon, 2 Jan 2023 08:23:43 +0000 (10:23 +0200)] 
lib-index: Fix assert-crash when header's log_file_seq/offset shrinks

mail_index_sync_set_log_view() is also missing this check, but it doesn't
seem to actually happen. It's likely handled by mail_index_map() already.

Fixes:
Panic: file mail-transaction-log-view.c: line 165 (mail_transaction_log_view_set): assertion failed: (min_file_seq <= max_file_seq)

2 years agolib-http: http-server-connection - Fix segfault occurring when output is resumed...
Stephan Bosch [Mon, 21 Mar 2022 11:22:38 +0000 (12:22 +0100)] 
lib-http: http-server-connection - Fix segfault occurring when output is resumed on closed connection.

2 years agoman: Add doveadm fts check fast/full
Timo Sirainen [Tue, 7 Mar 2023 13:53:06 +0000 (15:53 +0200)] 
man: Add doveadm fts check fast/full

2 years agolib-imap-client: Fix/clarify selection state handling
Timo Sirainen [Thu, 9 Feb 2023 15:04:22 +0000 (17:04 +0200)] 
lib-imap-client: Fix/clarify selection state handling

The old code assumed that selected_box would be non-NULL while a new mailbox
is being selected. That's not true though, the imapc-storage code closes the
old mailbox before selecting the next one. So the QRESYNC-specific code for
tracking selected-state was never being used. Fixed this, and clarified in
general how the selected-state is supposed to work.

2 years agolib-imap-client: Rename imapc_connection.selecting_box to qresync_selecting_box
Timo Sirainen [Thu, 9 Feb 2023 15:03:00 +0000 (17:03 +0200)] 
lib-imap-client: Rename imapc_connection.selecting_box to qresync_selecting_box

It's only used when QRESYNC extension is enabled.

2 years agoimapc: Fix handling EXISTS reply to previous mailbox while selecting new mailbox
Timo Sirainen [Thu, 9 Feb 2023 14:21:24 +0000 (16:21 +0200)] 
imapc: Fix handling EXISTS reply to previous mailbox while selecting new mailbox

For example if the communication was:

C: a SELECT box1
...
C: b SELECT box2
S: * 10 EXISTS
S: * 1 EXISTS
S: * OK [UIDVALIDITY 1675948459] UIDs valid
S: ...
S: b OK

The first EXISTS is meant for box1, not box2. Fixed by not starting a FETCH
(FLAGS) for the mailbox being selected until the tagged reply is received.

2 years agoimapc: Don't process untagged replies in mailbox that isn't fully selected yet
Timo Sirainen [Thu, 9 Feb 2023 14:12:35 +0000 (16:12 +0200)] 
imapc: Don't process untagged replies in mailbox that isn't fully selected yet

For example if the communication was:

C: a SELECT box1
...
C: b SELECT box2
S: * 1 EXPUNGE
S: * 1 EXISTS
S: * OK [UIDVALIDITY 1675948459] UIDs valid
S: ...
S: b OK

The expunge was intended for box1, not box2. This caused:
Warning: imapc(...): Mailbox '...' state corrupted: EXPUNGE received for empty mailbox - reconnecting

Fixed this by ignoring untagged EXPUNGE, FETCH, SEARCH and ESEARCH replies
when the UIDVALIDITY reply hasn't been yet received for a mailbox.

2 years agoauth: test-lua - Check that password is returned in lookup
Aki Tuomi [Wed, 8 Feb 2023 18:40:41 +0000 (20:40 +0200)] 
auth: test-lua - Check that password is returned in lookup

2 years agoauth: test-lua - Test bad keynames end up ignored
Aki Tuomi [Wed, 8 Feb 2023 18:32:57 +0000 (20:32 +0200)] 
auth: test-lua - Test bad keynames end up ignored

2 years agolib-storage: mail-user - Add event_ prefixed values from userdb as event fields
Aki Tuomi [Wed, 1 Feb 2023 11:58:42 +0000 (13:58 +0200)] 
lib-storage: mail-user - Add event_ prefixed values from userdb as event fields

2 years agologin-common: Add event_ prefixed values from auth as event fields
Aki Tuomi [Wed, 1 Feb 2023 11:53:42 +0000 (13:53 +0200)] 
login-common: Add event_ prefixed values from auth as event fields

2 years agoauth: db-lua - Skip invalid keys and values on field export
Aki Tuomi [Mon, 6 Feb 2023 19:23:48 +0000 (21:23 +0200)] 
auth: db-lua - Skip invalid keys and values on field export

2 years agomaildir: maildir_mailbox_open() - Split off maildir_is_selectable()
Markus Valentin [Fri, 20 Jan 2023 15:41:47 +0000 (16:41 +0100)] 
maildir: maildir_mailbox_open() - Split off maildir_is_selectable()

2 years agomaildir: maildir_mailbox_open() - If the namespace root or INBOX has any subdir creat...
Markus Valentin [Fri, 20 Jan 2023 15:40:22 +0000 (16:40 +0100)] 
maildir: maildir_mailbox_open() - If the namespace root or INBOX has any subdir create others as well

2 years agomaildir: maildir_mailbox_open() - Disable maildir subdirectory creation for INBOX
Markus Valentin [Fri, 20 Jan 2023 07:50:48 +0000 (08:50 +0100)] 
maildir: maildir_mailbox_open() - Disable maildir subdirectory creation for INBOX

This was added in 522925f6e9ff8fe9592511c2221b3d6526d4cbf4. In the
meantime autocreate code changed so this is no longer valid.

2 years agowelcome-plugin: Remove welcome_open_box()
Markus Valentin [Mon, 9 Jan 2023 14:10:47 +0000 (15:10 +0100)] 
welcome-plugin: Remove welcome_open_box()

2 years agowelcome-plugin: Move script_execute() to welcome_create_box()
Markus Valentin [Mon, 9 Jan 2023 14:06:54 +0000 (15:06 +0100)] 
welcome-plugin: Move script_execute() to welcome_create_box()

The welcome script was executed while opening the INBOX only when
the same session had created it. This could have led to unexpectedly not
executing welcome when not opening the mailbox right after it was created.

The original code delayed the welcome script run because mailbox creation
wasn't finished until the mailbox was opened. This seems to have become
fixed at some point.

2 years agolib-http: server - Fix potential crash with previous change on client disconnect
Timo Sirainen [Tue, 17 Jan 2023 06:44:55 +0000 (08:44 +0200)] 
lib-http: server - Fix potential crash with previous change on client disconnect

Broken by 1418d1e9018fc34287722467c6ee506f3e378e1a

2 years agolib-http: test-http-payload - Use ostream-final-trickle for server connections
Timo Sirainen [Wed, 11 Jan 2023 12:32:20 +0000 (14:32 +0200)] 
lib-http: test-http-payload - Use ostream-final-trickle for server connections

2 years agolib-http: test-http-payload - Add filenames to data mismatch error messages
Timo Sirainen [Wed, 11 Jan 2023 12:31:55 +0000 (14:31 +0200)] 
lib-http: test-http-payload - Add filenames to data mismatch error messages

2 years agolib-test: Add ostream-final-trickle
Timo Sirainen [Wed, 11 Jan 2023 12:26:53 +0000 (14:26 +0200)] 
lib-test: Add ostream-final-trickle

2 years agolib: Add connection_vfuncs.init()
Timo Sirainen [Wed, 11 Jan 2023 14:02:38 +0000 (16:02 +0200)] 
lib: Add connection_vfuncs.init()

2 years agolib-http: server - Don't disconnect client before response is fully sent
Timo Sirainen [Thu, 12 Jan 2023 10:23:31 +0000 (12:23 +0200)] 
lib-http: server - Don't disconnect client before response is fully sent

This could happen at least when the payload is empty and the final LF was
buffered.

2 years agolib-http: server - Don't disconnect client before payload is fully sent
Timo Sirainen [Tue, 10 Jan 2023 22:44:40 +0000 (00:44 +0200)] 
lib-http: server - Don't disconnect client before payload is fully sent

2 years agolib-storage: Add mail_storage_service_input.unexpanded_set_parser
Timo Sirainen [Thu, 12 Jan 2023 15:17:29 +0000 (17:17 +0200)] 
lib-storage: Add mail_storage_service_input.unexpanded_set_parser

2 years agoNEWS: Update news
Aki Tuomi [Wed, 23 Nov 2022 07:21:10 +0000 (09:21 +0200)] 
NEWS: Update news

2 years agoauth: Fix auth_request_password_verify() result handling
Aki Tuomi [Wed, 28 Dec 2022 10:19:11 +0000 (12:19 +0200)] 
auth: Fix auth_request_password_verify() result handling

Pass the result directly to caller, as auth_request_password_verify()
returns passdb result already.

2 years agoauth: Change auth_request_password_verify() to return enum passdb_result
Aki Tuomi [Wed, 28 Dec 2022 10:05:39 +0000 (12:05 +0200)] 
auth: Change auth_request_password_verify() to return enum passdb_result

This does not break anything, because PASSDB_RESULT_OK is 1 and mismatch
is 0.

2 years agolib-storage: Fix unnecessary data stack growth when iterating mailboxes
Timo Sirainen [Mon, 26 Dec 2022 21:48:27 +0000 (23:48 +0200)] 
lib-storage: Fix unnecessary data stack growth when iterating mailboxes

When listing mailbox list indexes, it was possible that each iteration
increased the data stack memory usage. It was all freed at the end though,
so this didn't cause any permanent leaks.

Broken by 4fdb040d2471c6e5006579bef1dd0586f89c8570

2 years agolib-lua: http - Use correct dns-client path
Aki Tuomi [Wed, 14 Dec 2022 13:07:38 +0000 (15:07 +0200)] 
lib-lua: http - Use correct dns-client path

The current code tries to look it up from user homedir sometimes.

Broken in 5b56debd31800ec45fc0c6529b138d1ce943b0aa

2 years agolib-sql: Add sql_statement_set_no_log_expanded_values()
Markus Valentin [Thu, 1 Dec 2022 09:54:38 +0000 (10:54 +0100)] 
lib-sql: Add sql_statement_set_no_log_expanded_values()

This allows to store no_log_expanded_values to sql_statement.

2 years agodict: Implement DICT_PROTOCOL_CMD_HIDE_LOG_VALUES for dict and dict-proxy
Markus Valentin [Thu, 1 Dec 2022 10:13:16 +0000 (11:13 +0100)] 
dict: Implement DICT_PROTOCOL_CMD_HIDE_LOG_VALUES for dict and dict-proxy

2 years agolib-dict: Add .set_hide_log_values() to dict vfuncs
Markus Valentin [Thu, 1 Dec 2022 10:03:26 +0000 (11:03 +0100)] 
lib-dict: Add .set_hide_log_values() to dict vfuncs

This is used to set hide_log_values in dict op settings.

2 years agocassandra: Rename query to log_query and initialize it with sql_statement_get_log_query()
Markus Valentin [Mon, 5 Dec 2022 10:58:31 +0000 (11:58 +0100)] 
cassandra: Rename query to log_query and initialize it with sql_statement_get_log_query()

Also add sql_statement_get_log_query() to sql-api.

2 years agolib-event: Add event_unset_log_message_callback()
Markus Valentin [Mon, 5 Dec 2022 10:50:30 +0000 (11:50 +0100)] 
lib-event: Add event_unset_log_message_callback()

2 years agofs-api: Add fs_get_event()
Markus Valentin [Mon, 28 Nov 2022 10:17:11 +0000 (11:17 +0100)] 
fs-api: Add fs_get_event()

2 years agopop3: Fix assert-crash when POP3 command name contained ':'
Timo Sirainen [Thu, 1 Dec 2022 10:37:17 +0000 (12:37 +0200)] 
pop3: Fix assert-crash when POP3 command name contained ':'

The cmd_<name> reason code now only uses valid command names.

Broken by d2ab26be6038bd53b13a3ff18c403d6c192c1d91 with incomplete fix in
1309137812424c80e63d3c1052795b43d6e19803.

Fixes:
Panic: event_reason_code_prefix(): name has ':'

2 years agopop3: Move pop3 commands to array and add pop3_command_find()
Timo Sirainen [Thu, 1 Dec 2022 10:32:28 +0000 (12:32 +0200)] 
pop3: Move pop3 commands to array and add pop3_command_find()

2 years agoNEWS: Update news
Aki Tuomi [Wed, 23 Nov 2022 07:21:10 +0000 (09:21 +0200)] 
NEWS: Update news

2 years agolmtp: Fix restoring global log prefix after session is finished
Timo Sirainen [Mon, 14 Nov 2022 21:27:33 +0000 (23:27 +0200)] 
lmtp: Fix restoring global log prefix after session is finished

Broken by 069dfd657fd91a0e2a3a9307a0cf499d795f27f2

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.

2 years agofts: struct fts_user - Drop data_languages
Marco Bettini [Fri, 21 Oct 2022 13:32:48 +0000 (13:32 +0000)] 
fts: struct fts_user - Drop data_languages

2 years agofts: fts-search-args - Fix stopwords expansion (only on multiple languges and with...
Marco Bettini [Fri, 21 Oct 2022 09:15:04 +0000 (09:15 +0000)] 
fts: fts-search-args - Fix stopwords expansion (only on multiple languges and with stopword filter enabled)

2 years agolib-storage: enum mail_search_arg_type - Add SEARCH_NIL
Marco Bettini [Thu, 20 Oct 2022 14:07:23 +0000 (14:07 +0000)] 
lib-storage: enum mail_search_arg_type - Add SEARCH_NIL

2 years agolib-storage: mail_search_args_simplify_drop_redundant_args() - Apply Absorptive law...
Marco Bettini [Wed, 9 Nov 2022 15:29:39 +0000 (15:29 +0000)] 
lib-storage: mail_search_args_simplify_drop_redundant_args() - Apply Absorptive law versus all terms, not just the 1st

2 years agodsync: Skip autocreated mailboxes that haven't been created yet
Timo Sirainen [Thu, 3 Nov 2022 15:40:28 +0000 (17:40 +0200)] 
dsync: Skip autocreated mailboxes that haven't been created yet

2 years agoimapc: Fix listing INBOX when INBOX is already the namespace prefix
Timo Sirainen [Fri, 4 Nov 2022 12:01:14 +0000 (14:01 +0200)] 
imapc: Fix listing INBOX when INBOX is already the namespace prefix

This especially caused problems when using dsync with imapc, resulting in
"Remote lost mailbox GUID" errors.

2 years agoreplicator: Fix crash when importing user not listed by userdb iteration
Timo Sirainen [Tue, 1 Nov 2022 09:21:34 +0000 (11:21 +0200)] 
replicator: Fix crash when importing user not listed by userdb iteration

Broken by 31545b4f38ea85615f0111a33d630a03d92d22ab

2 years agoreplicator: Add unit test to replicator-queue
Timo Sirainen [Tue, 16 Aug 2022 20:42:51 +0000 (23:42 +0300)] 
replicator: Add unit test to replicator-queue

2 years agoreplicator: Add replicator_queue_count() and replicator_queue_peek()
Timo Sirainen [Fri, 28 Oct 2022 14:57:03 +0000 (17:57 +0300)] 
replicator: Add replicator_queue_count() and replicator_queue_peek()

These will be useful for the following unit test.

2 years agoreplicator: Add "next sync secs" field to doveadm replicator status
Timo Sirainen [Tue, 25 Oct 2022 12:39:39 +0000 (15:39 +0300)] 
replicator: Add "next sync secs" field to doveadm replicator status

2 years agoreplicator: Make sure to prevent request starvation
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.

2 years agoreplicator: Don't update user's last_update if priority doesn't change
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.

2 years agoreplicator: Change replicator_queue_add_sync_callback() to take user struct
Timo Sirainen [Tue, 25 Oct 2022 10:08:36 +0000 (13:08 +0300)] 
replicator: Change replicator_queue_add_sync_callback() to take user struct

This is just to clean up the API to match the previous change.

2 years agoreplicator: Fix user placement in replication queue
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.

2 years agomaildir: If mailbox create fails, don't try to apply mailbox_update changes
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?)

2 years agolib-storage: mailbox_attribute_get*() - Fail early on with empty key lookup
Timo Sirainen [Wed, 26 Oct 2022 23:56:45 +0000 (02:56 +0300)] 
lib-storage: mailbox_attribute_get*() - Fail early on with empty key lookup

This fixes using mail_attribute_dict with dict-sql.

2 years agoimapc: imapc_connection_disconnect_full() - Only conditionally abort
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.

Broken by 6d16e82fa2c352974558e1415d06f07d8962fe09

2 years agoimapc: imapc_connection_disconnect_full() - Prevent leaking cmd->pool
Markus Valentin [Mon, 28 Feb 2022 14:50:05 +0000 (15:50 +0100)] 
imapc: imapc_connection_disconnect_full() - Prevent leaking cmd->pool

If the imapc connection was already disconnected when calling
imapc_connection_disconnect() it didn't clean up the commands and
especially the command pools.

2 years agoimapc: imapc_mailbox_get_status() - Implement STATUS_UNSEEN with INDEXPVT
Markus Valentin [Wed, 12 Oct 2022 11:26:03 +0000 (13:26 +0200)] 
imapc: imapc_mailbox_get_status() - Implement STATUS_UNSEEN with INDEXPVT

2 years agolib-storage: mail-storage-list-index-rebuild - Don't use continue inside T_BEGIN...
Martti Rannanjärvi [Wed, 19 Oct 2022 06:26:55 +0000 (09:26 +0300)] 
lib-storage: mail-storage-list-index-rebuild - Don't use continue inside T_BEGIN..T_END

Coverity doesn't like using continue there.

2 years agolib-storage: LAYOUT=index rebuild - Fix detecting duplicate mailbox GUIDs in index
Aki Tuomi [Wed, 5 Oct 2022 12:42:25 +0000 (15:42 +0300)] 
lib-storage: LAYOUT=index rebuild - Fix detecting duplicate mailbox GUIDs in index

Otherwise duplicate folders are not properly cleared out.

Broken in 2fc8d7024bb161aab08031b8212a736301844858

2 years agolib-storage: LAYOUT=index rebuild - Remove existence check
Aki Tuomi [Wed, 5 Oct 2022 12:27:31 +0000 (15:27 +0300)] 
lib-storage: LAYOUT=index rebuild - Remove existence check

It's not needed.

2 years agolib-storage: LAYOUT=index rebuild - Sort mailbox tree before creating
Aki Tuomi [Tue, 27 Sep 2022 12:03:37 +0000 (15:03 +0300)] 
lib-storage: LAYOUT=index rebuild - Sort mailbox tree before creating

Try to load the mailbox original name already from storage
so we can sort & create the mailbox tree in correct order.

2 years agolib-storage: LAYOUT=index rebuild - Remove first_list usage
Aki Tuomi [Tue, 27 Sep 2022 10:01:29 +0000 (13:01 +0300)] 
lib-storage: LAYOUT=index rebuild - Remove first_list usage

Instead, keep track of the list where box was found.

2 years agolib-storage: LAYOUT=index rebuild - Remove useless check for LAYOUT=index
Aki Tuomi [Wed, 5 Oct 2022 12:15:17 +0000 (15:15 +0300)] 
lib-storage: LAYOUT=index rebuild - Remove useless check for LAYOUT=index

This is already done when collecting namespaces.

Simplifies next change.

2 years agolib-storage: LAYOUT=index rebuild - Fix rebuilds when using multiple namespaces
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.

This applies for LAYOUT=index only.

Broken in 2fc8d7024bb161aab08031b8212a736301844858

2 years agolib-storage: list - Add separators to mailbox names when decoding from index
Aki Tuomi [Tue, 18 Oct 2022 08:35:22 +0000 (11:35 +0300)] 
lib-storage: list - Add separators to mailbox names when decoding from index

Mailbox name header decode did not add separators to name,
producing only FooBarBar, when it was supposed to give
Foo/Bar/Baz.

Broken in 8216a079d8aac93e2537ed79485e301350ff3887

2 years agolib-storage: Store mailbox names unescaped in box-name header
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.

2 years agodict-redis: Fix crash when using synchronous commit
Timo Sirainen [Wed, 15 Jun 2022 09:19:55 +0000 (12:19 +0300)] 
dict-redis: Fix crash when using synchronous commit

Redis is usually used via dict proxy process, which always uses async
commit, so this didn't matter so much.

3 years agodirector: Fix handling auth_master_user_separator setting
Timo Sirainen [Thu, 10 Feb 2022 15:12:09 +0000 (17:12 +0200)] 
director: Fix handling auth_master_user_separator setting

It was actually using a separate master_user_separator setting, causing
logins based on auth_master_user_separator to be hashed to wrong backends.

3 years agodoveadm: Fix assert-crash on secondary service_user failures
Timo Sirainen [Tue, 27 Sep 2022 11:28:38 +0000 (14:28 +0300)] 
doveadm: Fix assert-crash on secondary service_user failures

This mainly affected dsync when imapc authentication failed, but could have
also happened with copy and import commands.

Fixes:
Panic: file lib-event.c: line 506 (event_pop_global): assertion failed: (event == current_global_event)

3 years agolib-storage: Fix MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT to not change log prefix in...
Timo Sirainen [Wed, 28 Sep 2022 13:21:26 +0000 (16:21 +0300)] 
lib-storage: Fix MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT to not change log prefix in ioloop context changes

This didn't appear to cause any visible bugs with the current code, but is
required by the next commit.

Broken by ad13ab0702141065b79a1b7e8f2833e5b93871a4

3 years ago doc/example-config: Document submissions/465 for submission-login
Aki Tuomi [Thu, 25 Aug 2022 06:20:40 +0000 (09:20 +0300)] 
 doc/example-config: Document submissions/465 for submission-login

3 years agolib-storage: Avoid calling mail_set_attachment_keywords() recursively
Timo Sirainen [Tue, 22 Feb 2022 16:47:55 +0000 (17:47 +0100)] 
lib-storage: Avoid calling mail_set_attachment_keywords() recursively

It doesn't break, but it's unnecessary work.

3 years agolib-imap: imap_bodystructure_parse*() - Reset parts.data on failure
Timo Sirainen [Tue, 22 Feb 2022 16:44:02 +0000 (17:44 +0100)] 
lib-imap: imap_bodystructure_parse*() - Reset parts.data on failure

Having the data filled only to some message_parts can confuse the callers,
thinking that all the parts were successfully filled.

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

3 years agodsync: Add more debug logging
Timo Sirainen [Thu, 16 Jun 2022 07:57:15 +0000 (10:57 +0300)] 
dsync: Add more debug logging

3 years agodsync: Fix dsync_features=no-header-hashes to match UIDs
Timo Sirainen [Thu, 16 Jun 2022 07:55:42 +0000 (10:55 +0300)] 
dsync: Fix dsync_features=no-header-hashes to match UIDs

Mails were previously assumed to be the same, even if their UIDs didn't
match. This caused the sync to misbehave in some situations.

3 years agolib: ioloop-kqueue - Include time-util.h
Aki Tuomi [Fri, 4 Feb 2022 07:33:34 +0000 (09:33 +0200)] 
lib: ioloop-kqueue - Include time-util.h

Needed to compile on MacOS

3 years agoutil: dovecot-sysreport - Add timestamps before/after "ps" output
Timo Sirainen [Mon, 16 May 2022 09:04:10 +0000 (11:04 +0200)] 
util: dovecot-sysreport - Add timestamps before/after "ps" output

Sometimes running "ps" can take a while, so make it clear in the output if
this has happened.

3 years agoutil: dovecot-sysreport - Wait 3 seconds between "ps" outputs
Timo Sirainen [Mon, 16 May 2022 08:52:54 +0000 (10:52 +0200)] 
util: dovecot-sysreport - Wait 3 seconds between "ps" outputs

This allows showing more clearly in ps_output file whether a process is
using 100% CPU.

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 agoauth: db_oauth2_have_all_fields() - Fix auth field existence check
Martti Rannanjärvi [Tue, 7 Jun 2022 06:40:10 +0000 (09:40 +0300)] 
auth: db_oauth2_have_all_fields() - Fix auth field existence check

The correct pointer to pass on there is field, since ptr is the original
which still includes the ending }.

Broken in 9b670175445a75987a713ff899d1a945255b0b5b and incorrectly fixed
in 5c2f3d0b85830d18dbb8b45b348da091e24d1b3b.

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 agostats: stats-service-openmetrics - Always clear the stack before next metric body
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.

3 years agodoveadm: Add dsync_features=no-header-hashes
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.

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 agolib: Fix for clang Wstrict-bool pragma failing on unpatched clang
Marco Bettini [Mon, 2 May 2022 13:12:26 +0000 (13:12 +0000)] 
lib: Fix for clang Wstrict-bool pragma failing on unpatched clang

Note that clang recognises GCC diagnostic pragmas too,
so there is no need for distinct pragmas in this case

3 years agoquota: Fix for clang -Wstrict-bool clashing with #include <rpc/rpc.h>
Marco Bettini [Mon, 2 May 2022 11:14:10 +0000 (11:14 +0000)] 
quota: Fix for clang -Wstrict-bool clashing with #include <rpc/rpc.h>

3 years agom4: adding check for clang -Wstrict-bool availability
Marco Bettini [Mon, 2 May 2022 11:13:41 +0000 (11:13 +0000)] 
m4: adding check for clang -Wstrict-bool availability

3 years agosubmission: Don't log write() errors that fail due to ECONNRESET
Timo Sirainen [Tue, 17 May 2022 07:05:20 +0000 (09:05 +0200)] 
submission: Don't log write() errors that fail due to ECONNRESET

These happen only if client initialization fails.

3 years agoimap: Don't log write() errors that fail due to ECONNRESET
Timo Sirainen [Tue, 17 May 2022 07:03:47 +0000 (09:03 +0200)] 
imap: Don't log write() errors that fail due to ECONNRESET

These happen only before the client is fully initialized.

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 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 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.