]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Marco Bettini [Thu, 1 Jun 2023 08:37:56 +0000 (08:37 +0000)]
auth: db_oauth2_user_is_enabled() - Flatten the code
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.
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.
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
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.
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
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.
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.
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.
Timo Sirainen [Sun, 18 Jun 2023 09:46:00 +0000 (12:46 +0300)]
sdbox: Split off sdbox_sync_file_fix()
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.
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.
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.
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()
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.
Timo Sirainen [Tue, 20 Jun 2023 15:54:49 +0000 (18:54 +0300)]
dbox: Split off dbox_mailbox_list_cleanup()
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.
Timo Sirainen [Mon, 19 Jun 2023 21:11:17 +0000 (00:11 +0300)]
dbox: Avoid opening mail file when getting mail's saved timestamp
Just stat() the file, no open() necessary.
Timo Sirainen [Mon, 19 Jun 2023 21:10:53 +0000 (00:10 +0300)]
dbox: Add dbox_storage_vfuncs.mail_file_set() vfunc
Timo Sirainen [Mon, 19 Jun 2023 21:09:40 +0000 (00:09 +0300)]
mdbox: Split off mdbox_mail_file_set()
mdbox_mail_lookup() has to be done again for handling mails that were
deleted, but that shouldn't be a problem.
Timo Sirainen [Tue, 20 Jun 2023 21:19:10 +0000 (00:19 +0300)]
sdbox: Rebuild index if mail saving finds that parent directory is missing
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.
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.
Timo Sirainen [Sat, 17 Jun 2023 20:57:18 +0000 (23:57 +0300)]
lib-ssl-iostream: Fix memory leak when storing JA3 string
Broken by
3ca8852ec531b83c86c30b890b7f0200cf86105a
Marco Bettini [Mon, 12 Jun 2023 10:01:36 +0000 (10:01 +0000)]
login-common: sasl authenticate_callback() - Fix null pointer dereferencing
Broken by
e9c008893f963248d522173180734f0e8a4cced8
Found by coverity
The checking for "resp" in AUTH_REQUEST_STATUS_OK has been currently removed,
since we have no SASL mechanisms requiring it. Besides, it was only partially
implemented and didn't actually work.
Karl Fleischmann [Thu, 15 Jun 2023 11:32:11 +0000 (13:32 +0200)]
stats: Allow empty event exporters when registering metrics
Timo Sirainen [Mon, 12 Jun 2023 14:34:47 +0000 (17:34 +0300)]
lib-storage: string sort - Write sort extensions in message sequence order
This optimizes CPU usage by changing inserting into the middle of an array
into an append-only operation.
Timo Sirainen [Mon, 12 Jun 2023 14:33:08 +0000 (17:33 +0300)]
lib-storage: string sort - Replace array_get_modifiable() with array_get() where possible
Timo Sirainen [Mon, 12 Jun 2023 14:33:59 +0000 (17:33 +0300)]
lib-index: mail_index_seq_array_lookup() - Optimize append code path
Marco Bettini [Mon, 5 Jun 2023 15:41:13 +0000 (15:41 +0000)]
lib-storage: mailbox_search_notify() - Ensure that ioloop_time stays sufficiently up to date
This caters for the cases where the ioloop times is not actively refreshed
inside the processing loops (sort command, index search_next())
Marco Bettini [Mon, 5 Jun 2023 15:43:42 +0000 (15:43 +0000)]
lib-storage: search_more() - Ensure mailbox_search_notify() is invoked
Aki Tuomi [Mon, 15 May 2023 10:49:58 +0000 (13:49 +0300)]
auth: mech-oauth2 - Always fail with protocol specific error
Aki Tuomi [Mon, 15 May 2023 08:51:19 +0000 (11:51 +0300)]
auth: mech-oauth2 - Look for openid configuration URL if missing
Aki Tuomi [Thu, 4 May 2023 12:44:15 +0000 (15:44 +0300)]
lib-oauth2: Return failure instead of crash with invalid or missing token
Aki Tuomi [Wed, 14 Dec 2022 08:10:12 +0000 (10:10 +0200)]
auth: db-oauth2 - Add accessor for OpenID configuration URL
Aki Tuomi [Fri, 2 Jun 2023 11:20:08 +0000 (14:20 +0300)]
auth: db-oauth2 - Store request username
Aki Tuomi [Mon, 15 May 2023 09:41:39 +0000 (12:41 +0300)]
auth: Add auth_request_fail_with_reply()
Aki Tuomi [Mon, 15 May 2023 10:49:41 +0000 (13:49 +0300)]
auth: Pass along final response with failure
Aki Tuomi [Mon, 15 May 2023 09:28:53 +0000 (12:28 +0300)]
lib-auth: Move auth_client_request_continue() lower
Simplifies next commit
Aki Tuomi [Mon, 15 May 2023 11:27:55 +0000 (14:27 +0300)]
login-common: Serve final response for client on failure
Aki Tuomi [Mon, 15 May 2023 10:49:51 +0000 (13:49 +0300)]
login-common: Ignore resp when present
sergey.kitov [Thu, 8 Jun 2023 11:10:34 +0000 (14:10 +0300)]
imap: NOTIFY - Perform MessageNew and MessageExpunge events related checks for all mailbox filters.
sergey.kitov [Thu, 8 Jun 2023 10:56:52 +0000 (13:56 +0300)]
imap: Introduce cmd_notify_parse_event_list() function.
Timo Sirainen [Thu, 8 Jun 2023 13:16:06 +0000 (16:16 +0300)]
lib-master: Log more details if stats connection handshake times out
Aki Tuomi [Thu, 1 Jun 2023 11:13:29 +0000 (14:13 +0300)]
auth: Only test ldap when it's built in
Timo Sirainen [Thu, 1 Jun 2023 08:39:26 +0000 (11:39 +0300)]
virtual: Switch to VIRTUAL_LIST_CONTEXT_REQUIRE()
Timo Sirainen [Thu, 1 Jun 2023 08:38:05 +0000 (11:38 +0300)]
fts-solr: Use FTS_SOLR_USER_CONTEXT_REQUIRE() where possible
Timo Sirainen [Thu, 1 Jun 2023 08:36:46 +0000 (11:36 +0300)]
fts: Use FTS_USER_CONTEXT_REQUIRE() where possible
Aki Tuomi [Wed, 31 May 2023 07:12:00 +0000 (10:12 +0300)]
auth: db-lua - Ensure fn gets set in auth_lua_script_init()
Satisfies static analysers
Timo Sirainen [Tue, 30 May 2023 10:36:47 +0000 (13:36 +0300)]
doveadm stop: Try to wait shorter time between master process checks
Start from 1 ms timeout, but double it until 256 ms.
Timo Sirainen [Tue, 30 May 2023 10:36:08 +0000 (13:36 +0300)]
doveadm: Don't connect to stats process for "fast" commands
This especially caused "doveadm stop" to unnecessarily connect to stats
process, which prevented master process from immediately shutting down
without 1 second delay.
Marco Bettini [Wed, 10 May 2023 15:54:32 +0000 (15:54 +0000)]
auth: db-ldap - Add %{ldap_multi}
Marco Bettini [Thu, 11 May 2023 09:24:37 +0000 (09:24 +0000)]
auth: db_ldap_set_attrs() - Handle braces nesting while splitting on commas
Stephan Bosch [Tue, 7 Feb 2023 20:18:35 +0000 (21:18 +0100)]
submission: submission-client - Prevent NULL memory access upon early connection abort.
When the SMTP server connection is aborted early in client_create(), the
smtp_server_connection_abort() function clears client->conn immediately, causing
a later nested call to client_stats() from disconnect callback to access
client->conn == NULL. Early abort currently only happens when an anonymous login
is rejected.
Marco Bettini [Fri, 19 May 2023 08:42:39 +0000 (08:42 +0000)]
submission: Drop unused anonymous_allowed fields
Marco Bettini [Fri, 19 May 2023 09:50:45 +0000 (09:50 +0000)]
auth: user_callback() - Check if the user is anonymous
Timo Sirainen [Tue, 30 May 2023 20:17:21 +0000 (23:17 +0300)]
lib: Fix MODULE_CONTEXT_REQUIRE() to always panic if context is unset
Previously panic happened only if the module_contexts array was too small,
not when the element inside the array was NULL.
This required rewriting the macros partially as inline functions, which also
simplifies how they work.
Timo Sirainen [Tue, 30 May 2023 08:12:18 +0000 (11:12 +0300)]
imap: Don't try to hibernate when COMPRESS is enabled
It doesn't work properly. Broken by
5f27e25c64555dcaae6cb00c479cd05bc2638081
Timo Sirainen [Tue, 30 May 2023 08:10:39 +0000 (11:10 +0300)]
imap: Fix crash when trying to use COMPRESS multiple times
Broken by
5f27e25c64555dcaae6cb00c479cd05bc2638081
Fixes:
Panic: file cmd-compress.c: line 104 (cmd_compress): assertion failed: (client->input->v_offset == prev_in_offset)
Aki Tuomi [Fri, 12 May 2023 08:48:25 +0000 (11:48 +0300)]
lib-oauth2: Do not send empty client_id or client_secret
Aki Tuomi [Fri, 12 May 2023 08:47:41 +0000 (11:47 +0300)]
lib-oauth2: Do not send client_id and client_secret as parameters in POST queries
They need to be configured in the URL as Basic auth instead.
Aki Tuomi [Fri, 12 May 2023 05:59:50 +0000 (08:59 +0300)]
lib-oauth2: Do not send client_id & client_secret as POST parameters when doing introspection
Marco Bettini [Mon, 3 Apr 2023 08:39:40 +0000 (08:39 +0000)]
global: Add INPROGRESS capability
Marco Bettini [Wed, 17 May 2023 12:33:16 +0000 (12:33 +0000)]
indexer: Provide progress updates in messages counts rather than just percentage (client side)
Marco Bettini [Wed, 17 May 2023 08:01:33 +0000 (08:01 +0000)]
indexer: Provide progress updates in messages counts rather than just percentage (indexer side)
Marco Bettini [Tue, 16 May 2023 15:12:03 +0000 (15:12 +0000)]
indexer: index_mailbox_precache() - Move progress variables definitions closer to their usage
Marco Bettini [Thu, 9 Feb 2023 11:20:02 +0000 (11:20 +0000)]
fts: fts_indexer_notify() - Retrofit notify_progress()
Also change the timeout from INDEXER_NOTIFY_INTERVAL_SECS to
MAIL_STORAGE_NOTIFY_INTERVAL_SECS
Marco Bettini [Mon, 6 Mar 2023 15:34:37 +0000 (15:34 +0000)]
indexer: index_mailbox_precache() - Ensure updates are sent even with few messages and very slow processing
With the former behavior, if we have 101 messages and they take 30 seconds,
the client sees the progress stuck at 0% for most the processign time, only
to see it jump to 99% a fraction of a second before the competion.
This change ensures that the client sees a timely update every time the
integer percentage actually changes.
Marco Bettini [Mon, 6 Mar 2023 15:34:03 +0000 (15:34 +0000)]
indexer: index_mailbox_precache() - Uncork the socket before starting to send progress updates to the client
Otherwise the client does not receive the updates timely and has
nothing to propagate to the notify_progress() even if progress happened.
Marco Bettini [Wed, 1 Mar 2023 14:18:34 +0000 (14:18 +0000)]
fts: fts_indexer_input_args() - Fix client-side timeout
Client side timeout now just triggers if there is period long enough
where the server doesn't send updates. This works just because the
server is not pushing the updates properly.
The client must timeout BOTH if the server is unresponsive AND if
the server sends updates but the overall elapsed time exceedes.
Marco Bettini [Thu, 2 Mar 2023 11:11:06 +0000 (11:11 +0000)]
imap: copy/move - Retrofit notify_progress()
The replacing code in mailbox-storage uses MAIL_STORAGE_NOTIFY_INTERVAL_SECS
instead of MAIL_STORAGE_STAYALIVE_SECS
Marco Bettini [Thu, 16 Feb 2023 10:26:14 +0000 (10:26 +0000)]
imap: cmd-copy() - Document why we stop iterating at first expunged message
Marco Bettini [Fri, 10 Mar 2023 14:20:10 +0000 (14:20 +0000)]
lib-storage: Add mailbox_search_reset_progress_start()
Marco Bettini [Wed, 1 Mar 2023 13:35:28 +0000 (13:35 +0000)]
lib-storage: Add mailbox_search_set_progress_hidden()
Marco Bettini [Thu, 9 Feb 2023 10:01:50 +0000 (10:01 +0000)]
lib-storage: maildir_sync_notify() - Retrofit notify_progress()
Also change the timeout from MAIL_STORAGE_STAYALIVE_SECS to
MAIL_STORAGE_NOTIFY_INTERVAL_SECS
Marco Bettini [Mon, 13 Feb 2023 17:25:46 +0000 (17:25 +0000)]
lib-storage: mailbox_search_notify() - Check also ctx->search_start_time
The original check caused the 1st deadline to miss being notified
Marco Bettini [Fri, 24 Feb 2023 09:33:54 +0000 (09:33 +0000)]
imap: Propagate cmd_tag to notify_progress()
Marco Bettini [Thu, 2 Mar 2023 11:04:57 +0000 (11:04 +0000)]
global: Add notify_progress() to struct mail_storage_callbacks
Marco Bettini [Wed, 8 Feb 2023 10:01:04 +0000 (10:01 +0000)]
lib-storage: Move progress notification from search_more_with_mail() to mailbox_search_next_nonblock()
This allows to cover more cases, notably also the search progress
in FILTER=SIEVE extension
Marco Bettini [Thu, 2 Mar 2023 10:22:17 +0000 (10:22 +0000)]
imap: Rename global var mail-storage-callbacks to imap-storage-callbacks
Marco Bettini [Thu, 2 Mar 2023 10:18:42 +0000 (10:18 +0000)]
imap: Rename mail-storage-callbacks.c to imap-storage-callbacks.c
Marco Bettini [Wed, 8 Feb 2023 10:42:53 +0000 (10:42 +0000)]
imap: SEARCH RELEVANCY - Add stack data frame
Timo Sirainen [Tue, 2 May 2023 13:08:13 +0000 (16:08 +0300)]
lib: event-filter - Support escaping wildcards in values
Timo Sirainen [Tue, 2 May 2023 11:47:23 +0000 (14:47 +0300)]
lib: Add wildcard_match_escaped*()
This allows using \* and \? to match wildcard characters as-is instead of
being wildcards.
Timo Sirainen [Wed, 26 Apr 2023 20:25:18 +0000 (23:25 +0300)]
lib: event_filter_parse() - Add data stack frame
Timo Sirainen [Thu, 4 May 2023 15:22:56 +0000 (18:22 +0300)]
lib: event filter - strlist comparisons should be case-insensitive
All the other string comparisons are case-insensitive as well.
Aki Tuomi [Tue, 16 May 2023 05:52:18 +0000 (08:52 +0300)]
auth: passdb/userdb-lua - Improve initialization errors
Aki Tuomi [Tue, 9 May 2023 07:57:08 +0000 (10:57 +0300)]
auth: passdb/userdb-lua - Pass arguments to init script
Aki Tuomi [Tue, 16 May 2023 06:06:01 +0000 (09:06 +0300)]
auth: passdb/userdb-lua - Refactor to use t_split_key_value_eq()
Aki Tuomi [Tue, 9 May 2023 09:00:48 +0000 (12:00 +0300)]
auth: db-lua - Allow nil response from Lua
Aki Tuomi [Tue, 9 May 2023 08:20:59 +0000 (11:20 +0300)]
auth: db-lua - Check for nil in auth_request_lua_password_verify()
Avoids crash if script calls the function with nil values.
Aki Tuomi [Tue, 9 May 2023 07:56:41 +0000 (10:56 +0300)]
auth: db-lua - Support passing arguments to auth_passdb/userdb_init()
Aki Tuomi [Tue, 9 May 2023 07:18:57 +0000 (10:18 +0300)]
auth: db-lua - Call auth_passdb/userdb_init() on the lua script
This allows the script to prepare itself for these roles.
Aki Tuomi [Tue, 9 May 2023 07:05:01 +0000 (10:05 +0300)]
auth: db-lua - Move auth_lua_script_init() later
Simplifies next change.
Aki Tuomi [Tue, 9 May 2023 07:01:53 +0000 (10:01 +0300)]
auth: db-lua - Use parameters structure to initialize script
Simplifies next commit.
Aki Tuomi [Mon, 15 May 2023 06:23:31 +0000 (09:23 +0300)]
lib-lua: Do not expect return value from script_init()
This is not really needed. Script can call error() if
they need to fail.
Marco Bettini [Tue, 16 May 2023 09:40:55 +0000 (09:40 +0000)]
lib-dict: redis_reply_callback() - Don't crash if there is no callback
Timo Sirainen [Mon, 17 Apr 2023 21:08:40 +0000 (00:08 +0300)]
lib-index: Delete dovecot.index.cache during purging if it becomes too large
This only happens if the file was already too large before the purging
happens. This mainly fixes assert-crashes caused by old huge >1GB cache
files.
Fixes:
Panic: file mail-index-util.c: line 10 (mail_index_uint32_to_offset): assertion failed: (offset < 0x40000000)
Timo Sirainen [Sun, 14 May 2023 21:17:28 +0000 (00:17 +0300)]
dict-sql: Fix dict iteration with uuid type
dict_iterate_next() is run in its own data stack frame, so the returned
values must not be allocated from data stack.
Broken by
9e46d634d493e9539b4da635138e7b3670b625f2
Timo Sirainen [Fri, 12 May 2023 14:45:32 +0000 (17:45 +0300)]
master: service_anvil_send_log_fd() - Avoid using global services variable
This just makes the code clearer and less likely to break in the future.