]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Wed, 2 Jul 2025 10:50:06 +0000 (13:50 +0300)]
login-common: Change login_socket_path setting to be hidden
Now that director is gone, there's no need to change it anymore in the
config.
Timo Sirainen [Wed, 2 Jul 2025 10:49:00 +0000 (13:49 +0300)]
lib-storage, doveadm: Change auth_socket_path setting to be hidden
Now that director is gone, there's no need to change it anymore in the
config.
Timo Sirainen [Tue, 1 Jul 2025 11:06:30 +0000 (14:06 +0300)]
global: Replace mail service binaries' -a parameter with auth_master_socket_path setting
Markus Valentin [Thu, 26 Jun 2025 08:42:39 +0000 (10:42 +0200)]
lib-lua: Add dlua_var_expand() allow var_expand() from lua
Timo Sirainen [Wed, 18 Jun 2025 07:29:55 +0000 (10:29 +0300)]
lib-dict-extra: dict-client - Fix crash if server sends invalid iteration reply
Timo Sirainen [Mon, 9 Jun 2025 08:41:36 +0000 (11:41 +0300)]
lib-dict-extra: Install dict-client.h
Timo Sirainen [Mon, 9 Jun 2025 08:20:42 +0000 (11:20 +0300)]
lib-dict: Remove unused enum dict_data_type
Timo Sirainen [Mon, 9 Jun 2025 08:20:13 +0000 (11:20 +0300)]
dict: Remove unnecessary parsing of value_type parameter in handshake
It's not actually used for anything
Timo Sirainen [Tue, 15 Jul 2025 09:32:23 +0000 (12:32 +0300)]
lib: Fix crash when config is reloaded and logging to syslog
openlog() was called with a string pointing to settings. When settings were
reloaded, the pointer became invalid, causing syslog() to crash.
Marco Bettini [Mon, 14 Jul 2025 10:04:07 +0000 (10:04 +0000)]
imapc: imapc_list_subscriptions_refresh() - Use LIST (SUBSCRIBED) when available rather than LSUB
Marco Bettini [Mon, 14 Jul 2025 10:02:53 +0000 (10:02 +0000)]
imapc: imapc_untagged_list() - Handle the \Subscribed flag
These are especially needed in the following change that uses LIST (SUBSCRIBED)
Marco Bettini [Mon, 14 Jul 2025 10:01:05 +0000 (10:01 +0000)]
imapc: imapc_untagged_lsub() - Extract tree variable
Marco Bettini [Mon, 14 Jul 2025 09:19:32 +0000 (09:19 +0000)]
imapc: imapc_list_update_tree() - Always get a node
These are especially needed in the following change that uses LIST (SUBSCRIBED),
as \Subscribed, but non-existent, mailboxes must still be returned.
Marco Bettini [Tue, 3 Jun 2025 12:22:54 +0000 (12:22 +0000)]
lib-imap-client: Add imapc_cmd_has_imap4rev2()
Timo Sirainen [Wed, 4 Jun 2025 14:05:36 +0000 (17:05 +0300)]
imap: Add imap_compress_on_proxy hidden setting
Keep it disabled by default for now. Once we're sure COMPRESS on proxy
works properly we'll enable it again.
Timo Sirainen [Tue, 3 Jun 2025 15:11:09 +0000 (18:11 +0300)]
lib-compression: Fix potential hangs writing to non-blocking ostreams
This especially fixes hangs with IMAP COMPRESS handling in proxies.
Timo Sirainen [Wed, 4 Jun 2025 06:56:26 +0000 (09:56 +0300)]
lib, lib-ssl-iostream: Split off o_stream_init_buffering_flush()
Timo Sirainen [Wed, 4 Jun 2025 10:15:57 +0000 (13:15 +0300)]
lib: Fix potential hangs when filter istream read doesn't read from its parent
More specifically, this fixes at least a hang where:
* SSL istream reads some data into buffer
* SSL iostream places input into internal BIO buffer, which doesn't yet
get copied to the SSL istream's buffer
* zlib_istream gets more data from parent SSL istream. Since there is already
some data buffered, it doesn't call the parent read(). At the end it checks
that parent SSL istream has 0 bytes in its buffer, so it doesn't se the
IO pending.
The problem is that SSL istream would buffer if its read() had been called.
Since there is no more IO pending, it causes a hang.
Alternative rejected ideas I thought of:
* Add some new i_stream_has_maybe_more_data() method that all istreams
need to implement and filter istreams need to call and use it to set IO
pending.
* Change SSL iostream to immediately place input into SSL istream.
However, this makes the following i_stream_read() behavior confusing,
since it won't return the newly added data, and might even return -2
as buffer full, which the caller might not handle properly. Or if
i_stream_read() did return the newly added data, it would be wrong for
i_stream_get_data*() to return the newly added data before, effectively
making the whole change pointless.
Timo Sirainen [Tue, 3 Jun 2025 12:36:00 +0000 (15:36 +0300)]
login-common: Write client rawlogs in plaintext
Timo Sirainen [Tue, 3 Jun 2025 12:35:01 +0000 (15:35 +0300)]
imap, imap-login: Fix libcompress dependency tracking
Timo Sirainen [Tue, 3 Jun 2025 09:23:17 +0000 (12:23 +0300)]
login-common: Change proxy_no_multiplex to bit field
Timo Sirainen [Wed, 4 Jun 2025 08:30:36 +0000 (11:30 +0300)]
lib-ssl-iostream: Remove unused OPENSSL_IOSTREAM_SYNC_TYPE_FIRST_READ
Timo Sirainen [Tue, 3 Jun 2025 15:13:56 +0000 (18:13 +0300)]
lib-ssl-iostream: Remove dead code
o_stream_ssl_buffer() was always called with bytes_sent=0 parameter.
Timo Sirainen [Fri, 11 Jul 2025 11:08:06 +0000 (14:08 +0300)]
lib-settings: Fix crash when using %variables in SET_FILE type settings
For example this prevented using:
crypt_global_public_key_file = %{userdb:public_file}
Alexandre Roux [Tue, 17 Jun 2025 06:41:06 +0000 (08:41 +0200)]
imap: Avoid logging an error if unhibernation fails due to mailbox being deleted
Alexandre Roux [Tue, 24 Jun 2025 08:13:16 +0000 (10:13 +0200)]
imap: Introduce enum imap_state_result for return state in imap import functions
Sam James [Mon, 30 Jun 2025 03:51:19 +0000 (04:51 +0100)]
lib-json: drop invalid ATTR_PURE
Several functions in json-types.h mutate one of their arguments (usually *size_r)
and hence aren't eligible for __attribute__((pure)) which promises that
the function has no side-effects.
This manifests as a test failure in test-json-istream.c when building
Dovecot with -ftrivial-auto-var-init=zero (or =pattern).
Stephan Bosch [Sat, 21 Jun 2025 14:31:13 +0000 (16:31 +0200)]
lib-smtp: test-smtp-client-errors - Add test for LMTP connection loss with two recipients
Stephan Bosch [Thu, 19 Jun 2025 23:48:48 +0000 (01:48 +0200)]
lib-smtp: smtp-client-command - Generate multiple callbacks when required in smtp_client_command_fail*()
This requirement applies to the LTMP DATA command when more than a single
recipient is approved.
This caused a crash in the LMTP service occurring when the proxy client
connection was lost during the DATA command while more than a single RCPT
command was expected earlier. This situation caused an early free/dangling
pointer for the DATA command struct, subsequently causing a crash at
deinitialization of the proxy.
Stephan Bosch [Sat, 21 Jun 2025 16:09:22 +0000 (18:09 +0200)]
lib-smtp: smtp-client-command - Always use smtp_client_command_drop_callback() to clear callback
For consistency.
Stephan Bosch [Sat, 21 Jun 2025 15:04:18 +0000 (17:04 +0200)]
lib-smtp: test-smtp-client-errors - Add LMTP support to test server
Stephan Bosch [Thu, 19 Jun 2025 10:02:03 +0000 (12:02 +0200)]
lib-smtp: smtp-client-command - Make smtp_client_command_drop_callback(NULL) a no-op
Stephan Bosch [Thu, 19 Jun 2025 09:59:02 +0000 (11:59 +0200)]
lib-smtp: smtp-client-transaction - Rely on smtp_client_command_abort(NULL) being a no-op
Stephan Bosch [Sat, 21 Jun 2025 14:34:03 +0000 (16:34 +0200)]
lib-smtp: smtp-client-transaction - Prevent logging a spurious abort event for an approved recipient
Stephan Bosch [Sat, 21 Jun 2025 14:53:17 +0000 (16:53 +0200)]
lib-smtp: smtp-client-command - Assert aborted command pointer is (still) valid
Stephan Bosch [Sat, 21 Jun 2025 16:04:29 +0000 (18:04 +0200)]
lib-smtp: Fix minor formatting issues in test-smtp-client-errors.c
Stephan Bosch [Fri, 2 May 2025 02:46:34 +0000 (04:46 +0200)]
auth: mech-gssapi - Fix handling of server sending empty initial response
This situation was erroneously interpreted as sending an out-of-band challenge
for the recently added channel binding feature, which causes GSSAPI
authentication to fail when the client does not send the intial response as part
of the AUTHENTICATION command.
Aki Tuomi [Fri, 16 May 2025 10:08:12 +0000 (13:08 +0300)]
luacheckrc: Add luacheck rules
Timo Sirainen [Fri, 27 Jun 2025 11:31:27 +0000 (14:31 +0300)]
auth: Fix crash when OAUTH token validation failed with oauth2_use_worker_with_mech=yes
auth_request had already been freed, and also mech_event is NULL in worker.
Broken by
76cc978202c4a53fb83eca84b647ed6e19af6308
Timo Sirainen [Fri, 27 Jun 2025 21:23:14 +0000 (00:23 +0300)]
login-common: Fix potential crash when login proxy is destroyed
iostream-proxy may have closed the proxy with istream first, which closed
the fd, followed by closing the ostream, which attempted to remove IO for
the already closed fd.
Use iostream_fd refcounting to make sure the fd isn't closed too early.
Fixes:
Panic: epoll_ctl(del, 22) failed: Bad file descriptor
Timo Sirainen [Fri, 27 Jun 2025 21:21:17 +0000 (00:21 +0300)]
lib: Add functions to reliably autoclose fd for i/ostream-file
These can be used to create iostreams where fd is autoclosed after
both istream and ostream are closed in either order.
Marco Bettini [Wed, 11 Jun 2025 14:57:03 +0000 (14:57 +0000)]
config: settings_export() - Fix for null dereference
Found by Coverity, 40224 Explicit null dereferenced
Marco Bettini [Thu, 12 Jun 2025 08:59:34 +0000 (08:59 +0000)]
config: config_dump_human_filter_path() - Fix for static checker false positive
Found by Coverity, 40024 Dereference after null check
Marco Bettini [Wed, 11 Jun 2025 15:09:55 +0000 (15:09 +0000)]
config: config_parse_finish_service_defaults() - Fix for null dereference
Found by Coverity, 40031 Dereference null return value
Marco Bettini [Tue, 10 Jun 2025 09:27:05 +0000 (09:27 +0000)]
imap-hibernate: imap_hibernate_client_parse_input() - Reduce allocation from global to temp for state_r->tag
Found by coverity, 40470 Resource leak
Marco Bettini [Wed, 11 Jun 2025 14:40:14 +0000 (14:40 +0000)]
lib-auth-client: auth_client_request_handle_input() - Coalesce duplicated switch (status) {}
Marco Bettini [Fri, 30 May 2025 09:46:46 +0000 (09:46 +0000)]
auth: auth_request_validate_client_fp() - Add missing (void) in front of auth_request_import()
Found by coverity, 40493 Unchecked return value
Marco Bettini [Fri, 30 May 2025 13:22:35 +0000 (13:22 +0000)]
lib-storage: maildir_open_mail() - Add i_assert(ctx.path == NULL) on error path
Found by coverity, 40460 Resource leak
Marco Bettini [Tue, 10 Jun 2025 09:34:33 +0000 (09:34 +0000)]
lib-storage: mail_storage_create_list() - Remove moot tests for storage_class == NULL
Found by coverity, 40008 Dereference before null check
Marco Bettini [Thu, 12 Jun 2025 07:45:29 +0000 (07:45 +0000)]
lib-dns-client: dns_client_cache_clean(), Fix for static checker failing to see that priorityq_peek() cannot return NULL
Found by Coverity, 40466 Dereference null return value
Marco Bettini [Fri, 30 May 2025 14:53:16 +0000 (14:53 +0000)]
lib-dcrypt: dcrypt_openssl_ctx_sym_init() SSL1 - Fix whitespace
Marco Bettini [Fri, 30 May 2025 14:52:55 +0000 (14:52 +0000)]
lib-dcrypt: dcrypt_openssl_ctx_sym_init() SSL3 - Add missing return on dcrypt_openssl_error()
Found by coverity, 40465 Dereference after null check
Marco Bettini [Thu, 29 May 2025 08:47:25 +0000 (08:47 +0000)]
imap: client_send_mailbox_flags() - Don't send PERMANENTFLAGS if not selecting and we have allow_new_keywords
Marco Bettini [Fri, 30 May 2025 17:05:02 +0000 (17:05 +0000)]
lib-lua: test_io_lua() - Test return code from lua_script_init()
Found by coverity, 40458 Unchecked return value
Marco Bettini [Mon, 9 Jun 2025 15:37:47 +0000 (15:37 +0000)]
lib-lua: dlua_dovecot_io_register() - Fix unbalanced stack at exit
Marco Bettini [Thu, 5 Jun 2025 09:10:18 +0000 (09:10 +0000)]
lib-lua: dlua_script_init() - Remove unused variable
Marco Bettini [Thu, 5 Jun 2025 15:19:03 +0000 (15:19 +0000)]
lib-lua: Add missing lua scripts location
without this make check fails when the build dir is different than the source dir
Timo Sirainen [Mon, 2 Jun 2025 15:19:10 +0000 (18:19 +0300)]
lib-compression: Add o_stream_create_deflate()
Helge Deller [Tue, 10 Jun 2025 17:42:05 +0000 (19:42 +0200)]
lib-index: Fix storing cache fields' last_used with 32bit big endian CPUs
Debian started in 2025 to build packages on 32-bit platforms with 64-bit
time_t support by default. With that change, dovecot suddenly fails to
build on 32-bit big endian architectures (e.g. hppa, powerpc) with those
testsuite errors:
test-mail-cache-fields.c:52: Assert failed: cache_field.last_used == priv->field.last_used && cache_field.decision == priv->field.decision
test-mail-cache-fields.c:67: Assert failed: cache_field.last_used == priv->field.last_used && cache_field.decision == priv->field.decision
test-mail-cache-fields.c:96: Assert failed: cache_field.last_used == priv->field.last_used && cache_field.decision == priv->field.decision
mail cache fields read-write ......................................... : FAILED
Change the existing code for big endian architectures to actually check
the size of time_t at compile time instead of hardcoding a check for
SIZEOF_VOID_P to fix the issue for 32- and 64-bit big endian
architectures.
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Timo Sirainen <timo.sirainen@open-xchange.com>
Fixes: 1ee84ba0659f ("lib-index: Fix storing cache fields' last_used with 64bit big endian CPUs")
Timo Sirainen [Mon, 2 Jun 2025 17:42:03 +0000 (20:42 +0300)]
auth: Fix LDAP SASL support
The settings code didn't see the necessary defines.
Based on patch by Jakob Haufe
Broken by
961275fdb54878fdfa4ee1b9f1a4f00e82bf4a83
Timo Sirainen [Tue, 27 May 2025 08:20:00 +0000 (11:20 +0300)]
lib-master: Don't use USER environment in log prefix
USER environment is not so generally supported anymore. The tools
supporting it should change the log prefix themselves if they want it.
Also this fixes inconsistency where some tools logged "tool(USER): "
or "tool: " log prefix depending on whether the configuration was read
by executing doveconf or not (because doveconf dropped the USER
environment).
Timo Sirainen [Tue, 27 May 2025 08:10:56 +0000 (11:10 +0300)]
lib-master: Always process import_environment for standalone programs
It wasn't processed if config was read via config socket or from config
cache.
Timo Sirainen [Tue, 27 May 2025 07:08:41 +0000 (10:08 +0300)]
lib-settings: Fix settings cache validity checks
inode and size checks were swapped, so settings caching didn't actually
work.
Timo Sirainen [Thu, 15 May 2025 10:26:30 +0000 (13:26 +0300)]
lib-settings, config: Panic if SETTING_DEFINE_LIST_END is missing from settings lists
Timo Sirainen [Thu, 15 May 2025 10:06:56 +0000 (13:06 +0300)]
auth: Terminate properly auth_oauth2_post_setting_defines list
Fixes:
Error: xoauth2: oauth2 failed: Local validation failed: auth_oauth2_fields settings: Failed to parse configuration: settings struct auth_oauth2_fields #1 key mismatch
Timo Sirainen [Mon, 2 Jun 2025 07:49:23 +0000 (10:49 +0300)]
auth: Fix empty certificate fingerprint error handling
Broken in
db01107763ff3ad6afbf91f965ee46d2e3412b05
Fabian Groffen [Sat, 31 May 2025 08:49:28 +0000 (10:49 +0200)]
lib: cpu-count - fix compilation using musl
The macros, types and symbols CPU_* and cpuset_t are not exposed in
musl's sched.h unless _GNU_SOURCE is set.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Markus Valentin [Tue, 13 May 2025 11:36:28 +0000 (13:36 +0200)]
imapc: Automatically enable IMAP4rev2 if server has the capability
Markus Valentin [Thu, 8 May 2025 13:25:31 +0000 (15:25 +0200)]
imapc: Ignore or disable RECENT if IMAP4rev2 is enabled
Stephan Bosch [Fri, 30 May 2025 11:39:37 +0000 (13:39 +0200)]
lib-http: test-http-client-errors - Increase client progress timeout
Accounts for timeouts sometimes occurring while running in Valgrind.
Timo Sirainen [Mon, 26 May 2025 07:19:38 +0000 (10:19 +0300)]
config: Add asserts to make static analyzer happy
Timo Sirainen [Mon, 26 May 2025 07:13:13 +0000 (10:13 +0300)]
imap: Remove dead assignment
Timo Sirainen [Wed, 28 May 2025 07:26:09 +0000 (10:26 +0300)]
lib-dict-backend: Fix building ldap as plugin
Broken by
49f2c4d3365de502d705db28376bf41927a1a900
Jan Engelhardt [Mon, 31 Mar 2025 17:10:34 +0000 (19:10 +0200)]
configure: Do not modify user-provided CFLAGS variable
As per
https://www.gnu.org/software/automake/manual/html_node/User-Variables.html
CFLAGS is reserved for the user and should not be changed.
AM_CFLAGS is the right variable to use here.
Jan Engelhardt [Mon, 26 May 2025 10:26:28 +0000 (12:26 +0200)]
global: Fix wrong inheritance of AM_CFLAGS/AM_CPPFLAGS in target_CFLAGS
target_CFLAGS overrides AM_CFLAGS, not AM_CPPFLAGS, thus $(AM_CFLAGS),
not $(AM_CPPFLAGS), is needed in target_CFLAGS.
Timo Sirainen [Mon, 26 May 2025 07:57:41 +0000 (10:57 +0300)]
m4/dovecot.m4: Use AM_CFLAGS instead of EXTRA_CFLAGS with --enable-ubsan
Mainly to make it consistent with how all other build options are used.
Aki Tuomi [Fri, 23 May 2025 18:09:02 +0000 (21:09 +0300)]
login-common: Copy haproxy fields to client pool
They are stack allocated in lib-master now.
Aki Tuomi [Fri, 23 May 2025 18:07:33 +0000 (21:07 +0300)]
lib-master: Copy haproxy provided fields before calling callback
Otherwise fields get lost, broken in
894610212596c35aade07a4d0af9d5e7fd6245c7
Aki Tuomi [Mon, 26 May 2025 08:44:40 +0000 (11:44 +0300)]
lib: strfuncs - Make t_memdup public
Timo Sirainen [Mon, 26 May 2025 06:45:56 +0000 (09:45 +0300)]
lda: Default mail_home=$HOME environment if not using userdb lookup
The previous code to do this was removed by
e57d5b9002f910c095ee5b55821395fcf1da016a
Timo Sirainen [Mon, 26 May 2025 06:37:35 +0000 (09:37 +0300)]
lda: Fix using USER environment if -d hasn't been specified
This became broken at some point.
Aki Tuomi [Fri, 14 Feb 2025 13:29:34 +0000 (15:29 +0200)]
auth: Allow ssl cert to be validated by fingerprint
Aki Tuomi [Fri, 14 Feb 2025 13:29:33 +0000 (15:29 +0200)]
login-common: Allow invalid client cert if ssl_server_request_client_cert=any-cert
Aki Tuomi [Fri, 17 Jan 2025 14:04:39 +0000 (16:04 +0200)]
auth: Support check_client_fp, check_client_cert_fp, check_client_pubkey_fp fields
When set, these are matched against provided fingerprints, and
must be present in the request.
Field check_client_fp matches either certificate or public key fingerprint.
Aki Tuomi [Tue, 31 Dec 2024 10:40:39 +0000 (12:40 +0200)]
lib-ssl-iostream: Change ssl_server_request_client_cert to enum
If set to no, client certificates are not asked or verified.
If set to yes, client certificates are asked and verified.
If set to any-cert, client certificates are asked but verified with
fingerprinting
Aki Tuomi [Tue, 31 Dec 2024 10:40:19 +0000 (12:40 +0200)]
lib-ssl-iostream: Allow missing ca if invalid certs are allowed
Aki Tuomi [Tue, 31 Dec 2024 10:21:59 +0000 (12:21 +0200)]
login-common: Add ssl_client_cert_fp and ssl_client_cert_pubkey_fp if configured
Aki Tuomi [Tue, 31 Dec 2024 10:21:32 +0000 (12:21 +0200)]
lib-auth-client: Add ssl_client_cert_fp and ssl_client_cert_pubkey_fp fields
Aki Tuomi [Tue, 31 Dec 2024 10:19:53 +0000 (12:19 +0200)]
lib-auth-client: Compare ssl_ja3_hash to NULL and not 0
ssl_ja3_hash is a pointer, not a number, so it's more correct
to compare it as pointer.
Aki Tuomi [Tue, 31 Dec 2024 10:17:54 +0000 (12:17 +0200)]
auth: Add ssl_client_cert_fp and ssl_client_cert_pubkey_fp fields
Aki Tuomi [Fri, 14 Feb 2025 12:54:31 +0000 (14:54 +0200)]
lib-ssl-iostream: Replace ssl_iostream_has_broken_client_cert() with ssl_iostream_has_client_cert()
Broken cert does not do anything different from valid cert, but we need
to know if there was cert in the first place.
Aki Tuomi [Tue, 31 Dec 2024 10:04:00 +0000 (12:04 +0200)]
lib-ssl-iostream: Add ssl_peer_certificate_fingerprint_hash setting
Aki Tuomi [Tue, 31 Dec 2024 09:57:04 +0000 (11:57 +0200)]
lib-ssl-iostream: Add ssl_iostream_get_peer_cert_fingerprint()
Provides fingerprint of peer certificate and it's public key
using the configured hash algorithm in context.
Aki Tuomi [Fri, 21 Feb 2025 07:22:25 +0000 (09:22 +0200)]
lib-ssl-iostream: Reformat iostream-openssl.c
Timo Sirainen [Fri, 23 May 2025 09:28:54 +0000 (12:28 +0300)]
lib-http: test-http-client-errors - Fix memory leak at sub-process deinit
Broken by
dd6f9b3a3fab7d1c4b93d4f65086e8f019338b83
Aki Tuomi [Fri, 23 May 2025 08:34:41 +0000 (11:34 +0300)]
configure: Fix building without LDAP
Aki Tuomi [Fri, 23 May 2025 09:30:45 +0000 (12:30 +0300)]
lib-dcrypt: test-crypto - Store comparison key in DOVECOT format
PEM format is not stable between openssl versions
Timo Sirainen [Thu, 15 May 2025 10:40:13 +0000 (13:40 +0300)]
global: Fix warnings about uninitialized variables when compiling with -flto
These were only false positives, except for the unit test ones, which don't
really matter.
Aki Tuomi [Thu, 22 May 2025 05:02:09 +0000 (08:02 +0300)]
lib-dcrypt: Increase salt to 16 bytes for dovecot v2 keys
This makes it FIPS compatible.
Aki Tuomi [Thu, 22 May 2025 05:24:31 +0000 (08:24 +0300)]
lib-crypt: test-crypto - Enable testing more keys in test_load_v2_public_key()