]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
2 years agodbox: mail_temp_scan_interval - Fix deleted temp file prefix
Timo Sirainen [Tue, 20 Jun 2023 19:28:35 +0000 (22:28 +0300)] 
dbox: mail_temp_scan_interval - Fix deleted temp file prefix

dbox files are always created with DBOX_TEMP_FILE_PREFIX, not the mailbox
list-specific prefix. This was a problem only if dbox was used with
LAYOUT=Maildir++, which nobody was likely to do. Other layouts had
identical temp file prefixes to DBOX_TEMP_FILE_PREFIX.

2 years agodbox: Split off dbox_mailbox_list_cleanup()
Timo Sirainen [Tue, 20 Jun 2023 15:54:49 +0000 (18:54 +0300)] 
dbox: Split off dbox_mailbox_list_cleanup()

2 years agomdbox: Don't do temp file scanning for mailbox directories
Timo Sirainen [Tue, 20 Jun 2023 15:44:52 +0000 (18:44 +0300)] 
mdbox: Don't do temp file scanning for mailbox directories

The intention was to delete any temporary mail files that have been left
behind by crashed processes, but mail files are written to storage/
directory.

2 years agomdbox: Fix fdatasync() path when saving mails
Timo Sirainen [Tue, 20 Jun 2023 15:24:34 +0000 (18:24 +0300)] 
mdbox: Fix fdatasync() path when saving mails

It was supposed to be called on the parent directory of where mails were
written, i.e. storage/ directory. The previous code was instead calling it
on the mailbox-specific directory (similarly to sdbox) where nothing was
written.

2 years agomdbox: Fix crash if fdatasync_path() fails
Timo Sirainen [Tue, 20 Jun 2023 15:21:38 +0000 (18:21 +0300)] 
mdbox: Fix crash if fdatasync_path() fails

There is no dest_mail anymore at this stage of transaction.

2 years agolib-storage: Rollback save transaction when transaction commit fails.
sergey.kitov [Wed, 12 Apr 2023 09:06:52 +0000 (12:06 +0300)] 
lib-storage: Rollback save transaction when transaction commit fails.

2 years agosdbox: Fix panic due to leaked mail_index_view if sync fails
Timo Sirainen [Sun, 5 Feb 2023 18:51:12 +0000 (20:51 +0200)] 
sdbox: Fix panic due to leaked mail_index_view if sync fails

Fixes:
Panic: Leaked view for index .../dbox-Mails/dovecot.index: Opened in mail-index-sync.c:445

2 years agolib-index: Don't update log_file_tail_offset on sync if reading dovecot.index.log...
Timo Sirainen [Sun, 5 Feb 2023 18:50:06 +0000 (20:50 +0200)] 
lib-index: Don't update log_file_tail_offset on sync if reading dovecot.index.log failed

This is more of a theoretical issue, since dovecot.index.log read failure is
very unlikely.

2 years agolib-index: Don't update max_tail_offset if write to dovecot.index.log fails
Timo Sirainen [Sun, 5 Feb 2023 18:47:08 +0000 (20:47 +0200)] 
lib-index: Don't update max_tail_offset if write to dovecot.index.log fails

The max_tail_offset didn't actually increase in that situation.
This fixes wrongly updating mail_index_header.log_file_tail_offset after
write to dovecot.index.log failed (due to out of disk space), which in
turn can cause some unexpected errors.

2 years agolib-index: Fix event leak if purging dovecot.index.cache fails
Timo Sirainen [Sun, 5 Feb 2023 18:46:34 +0000 (20:46 +0200)] 
lib-index: Fix event leak if purging dovecot.index.cache fails

2 years agolib-oauth2: jwt - Allow missing 'typ' field
Aki Tuomi [Wed, 2 Nov 2022 13:56:54 +0000 (15:56 +0200)] 
lib-oauth2: jwt - Allow missing 'typ' field

2 years agolib-oauth2: test-oauth2-jwt - Ensure we ignore 'none' algorithm
Aki Tuomi [Thu, 28 May 2020 12:05:08 +0000 (15:05 +0300)] 
lib-oauth2: test-oauth2-jwt - Ensure we ignore 'none' algorithm

2 years agolib-login: Don't update process title if verbose_proctitle=no
Timo Sirainen [Fri, 14 Apr 2023 08:35:30 +0000 (11:35 +0300)] 
lib-login: Don't update process title if verbose_proctitle=no

Broken by 4fcd7f497577af361fc3313fbc07a61c14e17715

2 years agoglobal: Enable login_server_settings.update_proctitle
Timo Sirainen [Fri, 24 Mar 2023 01:26:33 +0000 (03:26 +0200)] 
global: Enable login_server_settings.update_proctitle

2 years agolib-login: Add login_server_settings.update_proctitle
Timo Sirainen [Fri, 24 Mar 2023 01:26:11 +0000 (03:26 +0200)] 
lib-login: Add login_server_settings.update_proctitle

Update the current login state in process title when enabled.

2 years agolib-login: Keep connection in server's linked list until it's fully freed
Timo Sirainen [Fri, 24 Mar 2023 02:02:28 +0000 (04:02 +0200)] 
lib-login: Keep connection in server's linked list until it's fully freed

Otherwise the connection isn't accessible from any global variables.

2 years agoimap: Update process title while unhibernating
Timo Sirainen [Fri, 24 Mar 2023 00:29:39 +0000 (02:29 +0200)] 
imap: Update process title while unhibernating

Previously the process title stayed as [idling] even though the process was
busy waiting on the imap-hibernate process to finish sending the
unhibernation request.

2 years agolib-master: Set process title to [initializing] until master_service_init_finish()
Timo Sirainen [Fri, 24 Mar 2023 00:00:37 +0000 (02:00 +0200)] 
lib-master: Set process title to [initializing] until master_service_init_finish()

2 years agolib: Add process_title_get_counter()
Timo Sirainen [Fri, 24 Mar 2023 00:02:58 +0000 (02:02 +0200)] 
lib: Add process_title_get_counter()

2 years agomaster: Set VERBOSE_PROCTITLE environment to child processes
Timo Sirainen [Thu, 23 Mar 2023 23:53:43 +0000 (01:53 +0200)] 
master: Set VERBOSE_PROCTITLE environment to child processes

This is needed for updating process title during initialization before
settings are read.

2 years agoimap: Disconnect imap-master client if it's not sending anything for 25 seconds
Timo Sirainen [Thu, 23 Mar 2023 23:15:21 +0000 (01:15 +0200)] 
imap: Disconnect imap-master client if it's not sending anything for 25 seconds

2 years agoimap: Improve disconnection log message if it happens immediately after unhibernation
Timo Sirainen [Thu, 23 Mar 2023 23:45:34 +0000 (01:45 +0200)] 
imap: Improve disconnection log message if it happens immediately after unhibernation

The "No commands sent after unhibernation" can mean that imap-hibernate
process saw a timeout while unhibernating and shutdown the connection.
Or it can also mean just that the client itself disconnected.

2 years agoimap-hibernate: If unhibernation fails, make sure imap process won't finish it later on
Timo Sirainen [Thu, 23 Mar 2023 23:41:37 +0000 (01:41 +0200)] 
imap-hibernate: If unhibernation fails, make sure imap process won't finish it later on

Especially if unhibernation fails due to a connection timeout to imap
process due to high load, it's possible that the imap process will
eventually finish the unhibernation and continue with the client. This is
rather confusing, since imap-hibernate process already logged that the
client got disconnected.

2 years agoimap: Add client.unhibernated boolean
Timo Sirainen [Thu, 13 Jan 2022 14:54:18 +0000 (16:54 +0200)] 
imap: Add client.unhibernated boolean

2 years agoauth: mech_gssapi_unwrap() - Release gss_release_buffe(outbuf) before returning
Marco Bettini [Fri, 5 May 2023 15:20:34 +0000 (15:20 +0000)] 
auth: mech_gssapi_unwrap() - Release gss_release_buffe(outbuf) before returning

2 years agomaster: Fix service { idle_kill } to work better on busy servers
Timo Sirainen [Thu, 23 Mar 2023 20:23:39 +0000 (22:23 +0200)] 
master: Fix service { idle_kill } to work better on busy servers

The previous behavior was to kill a process once it had idled for idle_kill
seconds. However, on a busy server the new connections are picked up somewhat
randomly by all the idling processes, so there's never any single process
idling for a long time. This effectively prevents the idle_kill from killing
any processes, even if there are unnecessarily many of them.

The new behavior here tracks the lowest number of idling processes during
idle_kill time interval. Then it kills that many processes. If the load
stays the same, this should shrink the number of processes to the number
that is needed to handle the load, but no more.

2 years agomaster: Replace per-process idle_kill timeout with per-service
Timo Sirainen [Thu, 23 Mar 2023 14:07:26 +0000 (16:07 +0200)] 
master: Replace per-process idle_kill timeout with per-service

This is much more efficient, since it doesn't have to keep updating the
timeout constantly for busy processes.

This change still preserves the original way the idle_kill setting behaves.

2 years agomaster: Add asserts to make sure counters don't wrap
Timo Sirainen [Thu, 23 Mar 2023 14:37:08 +0000 (16:37 +0200)] 
master: Add asserts to make sure counters don't wrap

2 years agomaster: Add service.process_idling to count number of idling processes
Timo Sirainen [Thu, 23 Mar 2023 14:36:10 +0000 (16:36 +0200)] 
master: Add service.process_idling to count number of idling processes

2 years agomaster: Split processes list to busy and idling processes
Timo Sirainen [Thu, 23 Mar 2023 13:09:43 +0000 (15:09 +0200)] 
master: Split processes list to busy and idling processes

Keep the idling processes sorted by idle_start time. This will be needed
by the next commit.

2 years agodbox: dbox_cleanup_temp_files() - Fuzz scan interval adding 0..+30% based on username...
Marco Bettini [Tue, 28 Feb 2023 12:05:44 +0000 (12:05 +0000)] 
dbox: dbox_cleanup_temp_files() - Fuzz scan interval adding 0..+30% based on username hash

2 years agodbox: dbox_cleanup_temp_files() - Reformat code
Marco Bettini [Tue, 28 Feb 2023 11:45:43 +0000 (11:45 +0000)] 
dbox: dbox_cleanup_temp_files() - Reformat code

2 years agodbox: dbox_cleanup_temp_files() - Remove unnecessary else/else if after returns
Marco Bettini [Tue, 28 Feb 2023 11:44:48 +0000 (11:44 +0000)] 
dbox: dbox_cleanup_temp_files() - Remove unnecessary else/else if after returns

2 years agodbox: dbox_mailbox_open() - Drop unused ctime
Marco Bettini [Tue, 28 Feb 2023 11:30:22 +0000 (11:30 +0000)] 
dbox: dbox_mailbox_open() - Drop unused ctime

2 years agodbox: dbox_mailbox_open() - Move dbox_cleanup_temp_files() to dbox_mailbox_close()
Marco Bettini [Tue, 28 Feb 2023 11:21:10 +0000 (11:21 +0000)] 
dbox: dbox_mailbox_open() - Move dbox_cleanup_temp_files() to dbox_mailbox_close()

2 years agodbox: dbox_mailbox_open() - Infer last_temp_file_scan from dir's atime if 0
Marco Bettini [Tue, 28 Feb 2023 10:15:50 +0000 (10:15 +0000)] 
dbox: dbox_mailbox_open() - Infer last_temp_file_scan from dir's atime if 0

2 years agodbox: dbox_mailbox_create() - Update last_temp_file_scan
Marco Bettini [Tue, 28 Feb 2023 10:14:26 +0000 (10:14 +0000)] 
dbox: dbox_mailbox_create() - Update last_temp_file_scan

2 years agolib-storage: dbox_cleanup_temp_files() - Fix inverted check for ENOENT
Marco Bettini [Fri, 3 Mar 2023 16:15:17 +0000 (16:15 +0000)] 
lib-storage: dbox_cleanup_temp_files() - Fix inverted check for ENOENT

2 years agostats: openmetrics - Set field always when used
Aki Tuomi [Fri, 24 Mar 2023 06:53:27 +0000 (08:53 +0200)] 
stats: openmetrics - Set field always when used

Satisfied static analysers.

Broken in ba19a18d54cb7cf7de93d6a235862a408cfe5828

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.