]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
2 years agolib-fts: Remove stray .
Josh Soref [Tue, 11 Jul 2023 17:58:07 +0000 (13:58 -0400)] 
lib-fts: Remove stray .

2 years agoauth: Set correct passdb entry in auth_worker_handle_passw
PxPert [Wed, 8 Jun 2022 11:03:20 +0000 (13:03 +0200)] 
auth: Set correct passdb entry in auth_worker_handle_passw

2 years agomaster: Allow child processes to setgroups()
Steve Mokris [Thu, 12 May 2022 22:31:19 +0000 (18:31 -0400)] 
master: Allow child processes to setgroups()

Grant master process capabilities to children, so the children
can drop root privileges. This is enforced more strictly
by some kernels than others.

2 years agoquota: quota-status - Allow empty recipient in END-OF-MESSAGE state
Aki Tuomi [Tue, 19 Sep 2023 07:22:11 +0000 (10:22 +0300)] 
quota: quota-status - Allow empty recipient in END-OF-MESSAGE state

When a message has multiple recipients, a policy server server will receive an
empty "recipient=" list in the END-OF-MESSAGE state, which needs to be accepted
in quota-status server.

Adapted from patch made by Jesse Norell <jesse@kci.net>

2 years agolib-dict-extra: dict-fs - If iteration flag isn't supported, error out instead of...
Timo Sirainen [Tue, 21 Mar 2023 19:35:04 +0000 (21:35 +0200)] 
lib-dict-extra: dict-fs - If iteration flag isn't supported, error out instead of panic

2 years agolib-dict-extra: dict-fs - Implement DICT_ITERATE_FLAG_EXACT_KEY
Timo Sirainen [Tue, 21 Mar 2023 21:08:12 +0000 (23:08 +0200)] 
lib-dict-extra: dict-fs - Implement DICT_ITERATE_FLAG_EXACT_KEY

2 years agolib-dict-extra: dict-fs - Fix endless loop while iterating
Manuel Mausz [Tue, 26 Jul 2022 08:07:31 +0000 (10:07 +0200)] 
lib-dict-extra: dict-fs - Fix endless loop while iterating

Broken by 32e8bd5b5a9d5bc04e5ac6c65ac132ba5c386d64

2 years agolib-master: stats_category_registered() - Increase initial string_t size
Markus Valentin [Fri, 22 Sep 2023 08:33:44 +0000 (10:33 +0200)] 
lib-master: stats_category_registered() - Increase initial string_t size

2 years agolib-master,master: Use separate environment variable for config file socket
Aki Tuomi [Tue, 12 Sep 2023 11:59:30 +0000 (14:59 +0300)] 
lib-master,master: Use separate environment variable for config file socket

This allows retaining the CONFIG_FILE environment variable pointing
to file always.

2 years agolib-master: Clean environment after master service has initialized
Aki Tuomi [Tue, 5 Sep 2023 11:16:33 +0000 (14:16 +0300)] 
lib-master: Clean environment after master service has initialized

2 years agolib-master: Add macro for DOVECOT_LOG_STDERR_TIMESTAMP_ENV
Aki Tuomi [Tue, 5 Sep 2023 11:24:54 +0000 (14:24 +0300)] 
lib-master: Add macro for DOVECOT_LOG_STDERR_TIMESTAMP_ENV

2 years agolib-master: Add macro for MASTER_SERVICE_LOG_SERVICE_ENV
Aki Tuomi [Tue, 5 Sep 2023 11:21:22 +0000 (14:21 +0300)] 
lib-master: Add macro for MASTER_SERVICE_LOG_SERVICE_ENV

2 years agolib-master: Add macro for MASTER_SERVICE_SOCKET_COUNT_ENV
Aki Tuomi [Tue, 5 Sep 2023 11:17:24 +0000 (14:17 +0300)] 
lib-master: Add macro for MASTER_SERVICE_SOCKET_COUNT_ENV

2 years agoauth: ldap_request_send_subquery() - Add handler for ldap_multi
Marco Bettini [Fri, 15 Sep 2023 14:07:44 +0000 (14:07 +0000)] 
auth: ldap_request_send_subquery() - Add handler for ldap_multi

2 years agoauth: ldap_request_send_subquery() - Rename table to var_expand_table
Marco Bettini [Fri, 15 Sep 2023 13:58:59 +0000 (13:58 +0000)] 
auth: ldap_request_send_subquery() - Rename table to var_expand_table

2 years agolib-sql: driver-mysql - Use API state to check if there is connection
Aki Tuomi [Wed, 6 Sep 2023 05:34:51 +0000 (08:34 +0300)] 
lib-sql: driver-mysql - Use API state to check if there is connection

db->mysql cannot be NULL.

Broken in d0a2a8fd48a6c844a69381552db85fced0ae1d48

2 years agolib-storage: shared_mail_user_init() - Log the error when mail_namespaces_init_locati...
Marco Bettini [Mon, 4 Sep 2023 08:31:41 +0000 (08:31 +0000)] 
lib-storage: shared_mail_user_init() - Log the error when mail_namespaces_init_location() fails

2 years agodsync: Destroy name128_remotesep_hash in dsync_mailbox_tree_deinit()
Aki Tuomi [Tue, 5 Sep 2023 10:39:40 +0000 (13:39 +0300)] 
dsync: Destroy name128_remotesep_hash in dsync_mailbox_tree_deinit()

Forgotten in 678d0463849ba777106eb7875f27db07a5d8e3df

2 years agodsync: Fix an infinite loop
Ted Phelps [Sat, 2 Sep 2023 07:50:55 +0000 (17:50 +1000)] 
dsync: Fix an infinite loop

Be sure to update 'name' when traversing the components of a path
in convert_name_to_remote_sep.  Otherwise we end up allocating a
lot of memory and failing.

2 years agolib-sql: driver-mysql - Initialize MYSQL struct once
Aki Tuomi [Wed, 30 Aug 2023 10:19:47 +0000 (13:19 +0300)] 
lib-sql: driver-mysql - Initialize MYSQL struct once

Calling initialize more than once will leak memory.

2 years agolib-sql: driver-mysql - Use driver_mysql_disconnect() in deinit
Aki Tuomi [Wed, 30 Aug 2023 10:21:12 +0000 (13:21 +0300)] 
lib-sql: driver-mysql - Use driver_mysql_disconnect() in deinit

This ensures we call mysql_close() only in one place.

2 years agolib-sql: driver-mysql - Use container_of instead of blind cast
Aki Tuomi [Tue, 29 Aug 2023 12:04:04 +0000 (15:04 +0300)] 
lib-sql: driver-mysql - Use container_of instead of blind cast

2 years agomail-crypt: mail_crypt_mailbox_allocated() - Force cross-user copies to (de,re)encryp...
Marco Bettini [Mon, 28 Aug 2023 15:27:09 +0000 (15:27 +0000)] 
mail-crypt: mail_crypt_mailbox_allocated() - Force cross-user copies to (de,re)encrypt the contents

2 years agolib-smtp: smtp-server-reply - Fix smtp_server_reply_replace_path() to update last...
Stephan Bosch [Tue, 15 Aug 2023 22:59:21 +0000 (00:59 +0200)] 
lib-smtp: smtp-server-reply - Fix smtp_server_reply_replace_path() to update last line offset.

Before, the offset was not updated with the changes caused by replacing the
path, causing a panic once the reply was sent:

Panic: file smtp-server-reply.c: line 629 (smtp_server_reply_send_real): assertion failed: (text[0] == '-')

This occurs when multi-line replies that involve a <path> prefix before the
reply message are being forwarded in a SMTP proxy/relay scenario (e.g. RCPT
reply can have that).

2 years agolib-smtp: Reformat smtp-server-reply.c.
Stephan Bosch [Tue, 15 Aug 2023 23:14:29 +0000 (01:14 +0200)] 
lib-smtp: Reformat smtp-server-reply.c.

2 years agofts: doveadm - Add missing pool initialization in cmd_search_box()
Marco Bettini [Tue, 29 Aug 2023 10:13:34 +0000 (10:13 +0000)] 
fts: doveadm - Add missing pool initialization in cmd_search_box()

Broken by: 467a664b5fce33f3d47a3e1171ecacb508968d1a

2 years agolib: buffer - Ensure error is kept when istream read fails
Aki Tuomi [Mon, 28 Aug 2023 09:29:14 +0000 (12:29 +0300)] 
lib: buffer - Ensure error is kept when istream read fails

Broken in 0429b4aaf581494ea89e61fd249ddc919e4f88fc

2 years agoacl: Fix wrong \HasChildren flags for parent mailboxes containing '*' and '%'
sergey.kitov [Wed, 3 May 2023 11:35:54 +0000 (14:35 +0300)] 
acl: Fix wrong \HasChildren flags for parent mailboxes containing '*' and '%'

'*' in mailbox name is replaced with '%' while child mailboxes still
have '*' in their path, this results in wrong \HasNoChildren flag.

2 years agolib-storage: Whitespace cleanup.
sergey.kitov [Wed, 3 May 2023 11:35:18 +0000 (14:35 +0300)] 
lib-storage: Whitespace cleanup.

2 years agoauth: db-oauth2 - Set default value for active_attribute and active_value to empty...
Aki Tuomi [Thu, 24 Aug 2023 09:26:44 +0000 (12:26 +0300)] 
auth: db-oauth2 - Set default value for active_attribute and active_value to empty string

Otherwise it will always require this attribute to be present when not
configured.

2 years agologin-common: If authentication is aborted, clear out final response.
Aki Tuomi [Thu, 24 Aug 2023 19:16:36 +0000 (22:16 +0300)] 
login-common: If authentication is aborted, clear out final response.

2 years agodoveadm: Simplify writing out command usage output
Timo Sirainen [Thu, 24 Aug 2023 19:50:43 +0000 (15:50 -0400)] 
doveadm: Simplify writing out command usage output

This reduces data stack usage, which helps avoid unnecessary data stack
growth warnings in tests.

2 years agolib-dcrypt: Force compressed point format in ec_key_get_pub_point_hex
Aki Tuomi [Mon, 21 Aug 2023 20:27:30 +0000 (23:27 +0300)] 
lib-dcrypt: Force compressed point format in ec_key_get_pub_point_hex

2 years agolib-dcrypt: Ensure param is found in dcrypt_openssl_private_to_public_key
Aki Tuomi [Tue, 22 Aug 2023 05:59:20 +0000 (08:59 +0300)] 
lib-dcrypt: Ensure param is found in dcrypt_openssl_private_to_public_key

2 years agolib-dcrypt: Fix error handling in load_jwk_ec_key
Aki Tuomi [Mon, 21 Aug 2023 06:59:49 +0000 (09:59 +0300)] 
lib-dcrypt: Fix error handling in load_jwk_ec_key

Avoid clobbering error.

2 years agodoveadm log errors: Fix sorting output
Timo Sirainen [Thu, 10 Aug 2023 13:46:07 +0000 (16:46 +0300)] 
doveadm log errors: Fix sorting output

The log lines from master process weren't always correctly sorted among the
log lines from config process.

Broken by 1cac11c115383a00f54642ca9d9717f443daaccc

2 years agodoveadm log errors: Fix potential hang
Timo Sirainen [Thu, 10 Aug 2023 13:46:58 +0000 (16:46 +0300)] 
doveadm log errors: Fix potential hang

2 years agoauth: db-ldap - Fix deleting wrong LDAP request when ldap_search() or ldap_bind(...
Timo Sirainen [Thu, 3 Aug 2023 21:31:30 +0000 (00:31 +0300)] 
auth: db-ldap - Fix deleting wrong LDAP request when ldap_search() or ldap_bind() failed

This mainly means that if an invalid LDAP filter was used, wrong request
could have become deleted. Fixes:

Error: ldap(...): Reply with unknown msgid 2
Panic: file db-ldap.c: line 1343 (db_ldap_conn_close): assertion failed: (request->msgid != -1)

2 years agodoveadm: Fix enabling all debug logging with -D parameter
Timo Sirainen [Wed, 9 Aug 2023 09:13:08 +0000 (12:13 +0300)] 
doveadm: Fix enabling all debug logging with -D parameter

The event's debug logging was set before the -D parameter was parsed.
Also, -v parameter shouldn't enable debugging.

Broken by 03392bbff711f91b6f8c7f8582e213f76c1a009a

2 years agolib-sql: Fix duration logging in sql_query_finished_event() calls
Timo Sirainen [Wed, 26 Jul 2023 09:12:20 +0000 (12:12 +0300)] 
lib-sql: Fix duration logging in sql_query_finished_event() calls

C has no sequence point between function parameters, so the duration may
have been uninitialized when logging it.

Broken by 09cf741d6632f3f5a2be3eff95ce0de4c16c228e & f492f4a73172f1189c3121e87141582fec122fad

2 years ago.gitignore - Fix ignore for imap-urlauth-login binary.
Stephan Bosch [Wed, 28 Jun 2023 23:04:08 +0000 (01:04 +0200)] 
.gitignore - Fix ignore for imap-urlauth-login binary.

2 years agodict-redis: Fix error handling for failed synchronous commits
Timo Sirainen [Tue, 20 Jun 2023 12:35:34 +0000 (15:35 +0300)] 
dict-redis: Fix error handling for failed synchronous commits

An error was logged if a synchronous commit failed, but the commit callback
was called with success instead of failure.

2 years agodict-redis: Fix logging connect() failures for transactions
Timo Sirainen [Tue, 20 Jun 2023 12:33:09 +0000 (15:33 +0300)] 
dict-redis: Fix logging connect() failures for transactions

Immediate connect() failures were logged without details, followed by
"Disconnected during transaction". Delayed connect() failures logged only
"Disconnected during transaction".

2 years agodict-redis: Handle commit timeout without waiting for dict_wait()
Timo Sirainen [Tue, 20 Jun 2023 12:18:09 +0000 (15:18 +0300)] 
dict-redis: Handle commit timeout without waiting for dict_wait()

For example with last_login_dict this meant that the commit timeout wasn't
logged until dict_wait() was called when the session ended.

2 years agolib-dict: Fix corrupted error message when istream read fails
Timo Sirainen [Tue, 20 Jun 2023 12:03:46 +0000 (15:03 +0300)] 
lib-dict: Fix corrupted error message when istream read fails

i_stream_get_error() return value may point to memory allocated from
istream. redis_disconnected() calls connection_disconnect(), which frees
this memory. The error is still used, but now it's corrupted.

2 years agosdbox: sdbox_mailbox_open() - Force rebuild if index directory is not found but mailb...
Markus Valentin [Thu, 22 Jun 2023 08:01:39 +0000 (10:01 +0200)] 
sdbox: sdbox_mailbox_open() - Force rebuild if index directory is not found but mailbox appears to exist

This prevents losing mails if a separate index directory was configured
and the mail index has been lost.

2 years agodbox: dbox_mailbox_check_existence() - Return 1 if a separate INDEX dir has an existi...
Markus Valentin [Thu, 22 Jun 2023 08:00:12 +0000 (10:00 +0200)] 
dbox: dbox_mailbox_check_existence() - Return 1 if a separate INDEX dir has an existing index

This allows taking actions if the separate INDEX dir does not have an existing
index file for a mailbox.

2 years agodbox: dbox_mailbox_check_existence() - Do always check for index_path existence
Markus Valentin [Thu, 22 Jun 2023 07:58:08 +0000 (09:58 +0200)] 
dbox: dbox_mailbox_check_existence() - Do always check for index_path existence

2 years agofts-flatcurve: fts_flatcurve_build_query_arg_term() - Use move constructor when available
Marco Bettini [Tue, 18 Jul 2023 10:31:09 +0000 (10:31 +0000)] 
fts-flatcurve: fts_flatcurve_build_query_arg_term() - Use move constructor when available

Found by coverity

2 years agolib: test_istream_jsonstr_partial() - Rearrange code to prevent unspecified order...
Marco Bettini [Tue, 18 Jul 2023 08:35:12 +0000 (08:35 +0000)] 
lib: test_istream_jsonstr_partial() - Rearrange code to prevent unspecified order of evaluation

Found by Coverity

2 years agolib-sql: Disconnect SQL connection on error
Aki Tuomi [Mon, 17 Jul 2023 07:36:32 +0000 (10:36 +0300)] 
lib-sql: Disconnect SQL connection on error

2 years agodoc: Add Solr 9.x compatible config and schema
Aki Tuomi [Fri, 14 Jul 2023 10:10:37 +0000 (13:10 +0300)] 
doc: Add Solr 9.x compatible config and schema

2 years agolib-storage: maildir - Use mail_metadata_accessed_event()
Marco Bettini [Wed, 28 Jun 2023 14:12:55 +0000 (14:12 +0000)] 
lib-storage: maildir - Use mail_metadata_accessed_event()

2 years agolib-storage: dbox - Use mail_metadata_accessed_event()
Marco Bettini [Wed, 28 Jun 2023 14:12:46 +0000 (14:12 +0000)] 
lib-storage: dbox - Use mail_metadata_accessed_event()

2 years agolib-storage: Add mail_metadata_accessed_event()
Marco Bettini [Wed, 28 Jun 2023 14:11:39 +0000 (14:11 +0000)] 
lib-storage: Add mail_metadata_accessed_event()

2 years agostats: test-client-reader - Fix error in test
Aki Tuomi [Fri, 7 Jul 2023 11:20:16 +0000 (14:20 +0300)] 
stats: test-client-reader - Fix error in test

It has never worked right. Previously it would just stop at
'test' because it would stop processing at first unknown group_by field,
and alpha would never be reached.

2 years agostats: Do not break submetrics is field is missing
Aki Tuomi [Thu, 6 Jul 2023 07:49:48 +0000 (10:49 +0300)] 
stats: Do not break submetrics is field is missing

If the field does not exist, emulate it as empty field, and continue
submetrics.

2 years agostats: Allow total length of all sub-metrics to be 256 bytes
Aki Tuomi [Thu, 6 Jul 2023 06:54:16 +0000 (09:54 +0300)] 
stats: Allow total length of all sub-metrics to be 256 bytes

Previously, we only allowed 32 bytes per sub-metric name, so this
new code changes this to allow total length of all components
to be up to 256 bytes.

This change allow e.g. using full DNS names in sub-metric labels.

2 years agodoveadm: Explicitly handle invalid option
Karl Fleischmann [Mon, 10 Jul 2023 10:09:56 +0000 (12:09 +0200)] 
doveadm: Explicitly handle invalid option

2 years agodoveadm: Process subcommand "--help" options
Karl Fleischmann [Thu, 22 Jun 2023 10:18:07 +0000 (12:18 +0200)] 
doveadm: Process subcommand "--help" options

Arguments are handled individually in different situations when invoking
doveadm with or without subcommands (specifically
doveadm_cmdline_find_with_args() may fail if "help" is passed). To
handle all necessary situtations the command context needs to be
expanded with a variable to differentiate whether a help argument (i.e.
"--help") or a help option (i.e. "help") is given. This is used
subsequently to print the help/usage text to stdout with a successful
return code if requested.

2 years agodoveadm: Enable setting the output stream and return code to print usage
Karl Fleischmann [Thu, 22 Jun 2023 10:16:08 +0000 (12:16 +0200)] 
doveadm: Enable setting the output stream and return code to print usage

This commit prepares doveadm subcommands from printing the usage string
to stdout when requested with "--help".

2 years agolib-master, doveadm: Progress top level --help option
Karl Fleischmann [Thu, 22 Jun 2023 09:58:31 +0000 (11:58 +0200)] 
lib-master, doveadm: Progress top level --help option

Print usage to stdout and exit successfully if requested via "doveadm
help" or "doveadm --help".

2 years agolib-master: Ensure master_getopt*() functions do not return 0
Karl Fleischmann [Tue, 27 Jun 2023 11:42:24 +0000 (13:42 +0200)] 
lib-master: Ensure master_getopt*() functions do not return 0

2 years agolib-master: Extend master-service API to register and parse long options
Karl Fleischmann [Thu, 22 Jun 2023 09:57:32 +0000 (11:57 +0200)] 
lib-master: Extend master-service API to register and parse long options

2 years agodoveadm: Allow setting output stream and return code in usage_prefix()
Karl Fleischmann [Thu, 22 Jun 2023 09:50:09 +0000 (11:50 +0200)] 
doveadm: Allow setting output stream and return code in usage_prefix()

2 years agoglobal: Remove replicator
Aki Tuomi [Thu, 29 Jun 2023 15:11:26 +0000 (18:11 +0300)] 
global: Remove replicator

2 years agoimap-urlauth: clients_deinit(): Fix use after free
Marco Bettini [Thu, 6 Jul 2023 07:12:23 +0000 (07:12 +0000)] 
imap-urlauth: clients_deinit(): Fix use after free

Found by coverity.

2 years agolib-sql: sqlite - Emit sql_connection_log_finished event
Aki Tuomi [Thu, 29 Jun 2023 10:49:05 +0000 (13:49 +0300)] 
lib-sql: sqlite - Emit sql_connection_log_finished event

2 years agolib-sql: sqlite - Retain last connection error
Aki Tuomi [Thu, 29 Jun 2023 10:46:41 +0000 (13:46 +0300)] 
lib-sql: sqlite - Retain last connection error

2 years agolib-sql: sqlite - Always use driver_sqlite_disconnect()
Aki Tuomi [Thu, 29 Jun 2023 10:49:56 +0000 (13:49 +0300)] 
lib-sql: sqlite - Always use driver_sqlite_disconnect()

2 years agolib-sql: sqlite - Move driver_sqlite_disconnect()
Aki Tuomi [Thu, 29 Jun 2023 10:43:33 +0000 (13:43 +0300)] 
lib-sql: sqlite - Move driver_sqlite_disconnect()

Makes following commit easier.

2 years agolib-sql: pgsql - Use orig_ioloop instead of local variable
Aki Tuomi [Thu, 29 Jun 2023 10:40:24 +0000 (13:40 +0300)] 
lib-sql: pgsql - Use orig_ioloop instead of local variable

orig_ioloop is used later, leaving it NULL here causes
problems when timeout is added by sqlpool.

Broken in 8981a973987c237552e46b68075b64caa8c1f5bb

2 years agolib-sql: pgsql - Emit sql_connection_finished event
Aki Tuomi [Thu, 29 Jun 2023 10:39:46 +0000 (13:39 +0300)] 
lib-sql: pgsql - Emit sql_connection_finished event

2 years agolib-sql: pgsql - Retain last connection error
Aki Tuomi [Thu, 29 Jun 2023 10:38:22 +0000 (13:38 +0300)] 
lib-sql: pgsql - Retain last connection error

2 years agolib-sql: pgsql - Use FATAL_OUTOFMEM with out of memory
Aki Tuomi [Thu, 29 Jun 2023 10:37:28 +0000 (13:37 +0300)] 
lib-sql: pgsql - Use FATAL_OUTOFMEM with out of memory

2 years agolib-sql: pgsql - Return only last error
Aki Tuomi [Thu, 29 Jun 2023 10:36:36 +0000 (13:36 +0300)] 
lib-sql: pgsql - Return only last error

PQerrorMessage() can return multiple lines, make sure we only
return the very last one.

2 years agolib-sql: mysql - Retain last connection error
Aki Tuomi [Thu, 29 Jun 2023 10:35:04 +0000 (13:35 +0300)] 
lib-sql: mysql - Retain last connection error

2 years agolib-sql: cassandra - Retain last connection error
Aki Tuomi [Thu, 29 Jun 2023 10:34:42 +0000 (13:34 +0300)] 
lib-sql: cassandra - Retain last connection error

2 years agolib-sql: Add last connection error to sql_connection_finished event
Aki Tuomi [Thu, 29 Jun 2023 10:34:20 +0000 (13:34 +0300)] 
lib-sql: Add last connection error to sql_connection_finished event

2 years agodoveadm: doveadm auth - Allow interrupting auth lookups
Aki Tuomi [Thu, 29 Jun 2023 10:32:28 +0000 (13:32 +0300)] 
doveadm: doveadm auth - Allow interrupting auth lookups

2 years agoauth: Fix crash when auth worker has already exited when deinitializating connection
Aki Tuomi [Thu, 29 Jun 2023 10:31:09 +0000 (13:31 +0300)] 
auth: Fix crash when auth worker has already exited when deinitializating connection

Having no connections satisfies the original assertion.

2 years agoauth: db-ldap: Remove userdb_warning_disable
Marco Bettini [Mon, 3 Jul 2023 13:29:50 +0000 (13:29 +0000)] 
auth: db-ldap: Remove userdb_warning_disable

2 years agoauth: db-oauth2 - Handle the case for check on attribute presence only
Marco Bettini [Thu, 1 Jun 2023 10:47:50 +0000 (10:47 +0000)] 
auth: db-oauth2 - Handle the case for check on attribute presence only

2 years agoauth: db_oauth2_user_is_enabled() - Flatten the code
Marco Bettini [Thu, 1 Jun 2023 08:37:56 +0000 (08:37 +0000)] 
auth: db_oauth2_user_is_enabled() - Flatten the code

2 years agoauth: db-oauth2 - Fail login if active_attribute is missing
Steve Mokris [Tue, 17 May 2022 19:19:49 +0000 (15:19 -0400)] 
auth: db-oauth2 - Fail login if active_attribute is missing

If active_attribute is required by config, we should fail to
login when it's missing.

2 years agolib-smtp: Do not log AUTH input from client.
sergey.kitov [Thu, 15 Jun 2023 09:22:05 +0000 (12:22 +0300)] 
lib-smtp: Do not log AUTH input from client.

This could happen when debug logging is enabled.

2 years agodbox: Fix for dangling pointer being passed to cleanup_interval()
Marco Bettini [Mon, 26 Jun 2023 10:43:00 +0000 (10:43 +0000)] 
dbox: Fix for dangling pointer being passed to cleanup_interval()

Broken in 88eee28fd86d619b26ce6aebadca5b18e748dc6f

2 years agolib: Fix potential log corruption with event_set_log_message_callback()
Timo Sirainen [Tue, 20 Jun 2023 22:20:30 +0000 (01:20 +0300)] 
lib: Fix potential log corruption with event_set_log_message_callback()

If the callback returned the same input log_prefix pointer back, the message
became corrupted because the log_prefix was soon changed.

2 years agomdbox: Fix crash still if fdatasync_path() fails
Timo Sirainen [Thu, 22 Jun 2023 07:48:13 +0000 (10:48 +0300)] 
mdbox: Fix crash still if fdatasync_path() fails

Broken still in 8bffe291fe5142a2e385de8f4fc7b69caa816522

2 years agosdbox: Don't open are try to fix all mail files when rebuilding indexes
Timo Sirainen [Tue, 20 Jun 2023 20:13:40 +0000 (23:13 +0300)] 
sdbox: Don't open are try to fix all mail files when rebuilding indexes

It's very rare for the mail files to be corrupted, so opening the files for
fixing them is rather unnecessary. This made the index rebuilding an
unnecessarily inefficient operation. If there are any corrupted mail files,
they are fixed on-demand while the mail is opened for other reasons.

2 years agosdbox: Check for duplicate files in primary/alt storage via transaction
Timo Sirainen [Tue, 20 Jun 2023 20:11:36 +0000 (23:11 +0300)] 
sdbox: Check for duplicate files in primary/alt storage via transaction

The current method stops working in the next commit that removes opening the
mail files during rebuild.

2 years agosdbox: If mail file is found to be corrupted, fix the file immediately
Timo Sirainen [Tue, 20 Jun 2023 19:59:19 +0000 (22:59 +0300)] 
sdbox: If mail file is found to be corrupted, fix the file immediately

Don't mark the whole mailbox corrupted. The file fixing on sdbox rebuild
will be removed by a following commit.

2 years agosdbox: Split off sdbox_sync_file_fix()
Timo Sirainen [Sun, 18 Jun 2023 09:46:00 +0000 (12:46 +0300)] 
sdbox: Split off sdbox_sync_file_fix()

2 years agodbox: Avoid recursive loop while fixing dbox file
Timo Sirainen [Tue, 20 Jun 2023 20:39:44 +0000 (23:39 +0300)] 
dbox: Avoid recursive loop while fixing dbox file

The loop ended with a crash due to running out of stack.

2 years agodbox: Don't set dbox file corrupted twice
Timo Sirainen [Tue, 20 Jun 2023 20:34:14 +0000 (23:34 +0300)] 
dbox: Don't set dbox file corrupted twice

The file is set to be corrupted immediately when dbox file reading detects
corruption, which causes the code path to return 0. This can happen all over
the place.

2 years agomdbox: Optimize mail_temp_scan_interval storage/ scanning
Timo Sirainen [Tue, 20 Jun 2023 15:58:13 +0000 (18:58 +0300)] 
mdbox: Optimize mail_temp_scan_interval storage/ scanning

Use the generic dbox scanning code, which avoids stat()ing the directory by
keeping the timestamp in index header. Also do the scanning while at
session deinit instead of startup, so the latency isn't visible to clients.

2 years agolib-storage: Split off index_mailbox_view_update_last_temp_file_scan()
Timo Sirainen [Tue, 20 Jun 2023 15:58:00 +0000 (18:58 +0300)] 
lib-storage: Split off index_mailbox_view_update_last_temp_file_scan()

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.