]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
2 months agolib-ssl-iostream: Remove dead code
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.

2 months agolib-settings: Fix crash when using %variables in SET_FILE type settings
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}

3 months agoimap: Avoid logging an error if unhibernation fails due to mailbox being deleted
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

3 months agoimap: Introduce enum imap_state_result for return state in imap import functions
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

3 months agolib-json: drop invalid ATTR_PURE
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).

3 months agolib-smtp: test-smtp-client-errors - Add test for LMTP connection loss with two recipients
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

3 months agolib-smtp: smtp-client-command - Generate multiple callbacks when required in smtp_cli...
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.

3 months agolib-smtp: smtp-client-command - Always use smtp_client_command_drop_callback() to...
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.

3 months agolib-smtp: test-smtp-client-errors - Add LMTP support to test server
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

3 months agolib-smtp: smtp-client-command - Make smtp_client_command_drop_callback(NULL) a no-op
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

3 months agolib-smtp: smtp-client-transaction - Rely on smtp_client_command_abort(NULL) being...
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

3 months agolib-smtp: smtp-client-transaction - Prevent logging a spurious abort event for an...
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

3 months agolib-smtp: smtp-client-command - Assert aborted command pointer is (still) valid
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

3 months agolib-smtp: Fix minor formatting issues in test-smtp-client-errors.c
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

3 months agoauth: mech-gssapi - Fix handling of server sending empty initial response
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.

3 months agoluacheckrc: Add luacheck rules
Aki Tuomi [Fri, 16 May 2025 10:08:12 +0000 (13:08 +0300)] 
luacheckrc: Add luacheck rules

3 months agoauth: Fix crash when OAUTH token validation failed with oauth2_use_worker_with_mech=yes
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

3 months agologin-common: Fix potential crash when login proxy is destroyed
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

3 months agolib: Add functions to reliably autoclose fd for i/ostream-file
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.

3 months agoconfig: settings_export() - Fix for null dereference
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

3 months agoconfig: config_dump_human_filter_path() - Fix for static checker false positive
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

3 months agoconfig: config_parse_finish_service_defaults() - Fix for null dereference
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

3 months agoimap-hibernate: imap_hibernate_client_parse_input() - Reduce allocation from global...
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

3 months agolib-auth-client: auth_client_request_handle_input() - Coalesce duplicated switch...
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) {}

3 months agoauth: auth_request_validate_client_fp() - Add missing (void) in front of auth_request...
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

3 months agolib-storage: maildir_open_mail() - Add i_assert(ctx.path == NULL) on error path
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

3 months agolib-storage: mail_storage_create_list() - Remove moot tests for storage_class ==...
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

3 months agolib-dns-client: dns_client_cache_clean(), Fix for static checker failing to see that...
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

3 months agolib-dcrypt: dcrypt_openssl_ctx_sym_init() SSL1 - Fix whitespace
Marco Bettini [Fri, 30 May 2025 14:53:16 +0000 (14:53 +0000)] 
lib-dcrypt: dcrypt_openssl_ctx_sym_init() SSL1 - Fix whitespace

3 months agolib-dcrypt: dcrypt_openssl_ctx_sym_init() SSL3 - Add missing return on dcrypt_openssl...
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

3 months agoimap: client_send_mailbox_flags() - Don't send PERMANENTFLAGS if not selecting and...
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

3 months agolib-lua: test_io_lua() - Test return code from lua_script_init()
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

3 months agolib-lua: dlua_dovecot_io_register() - Fix unbalanced stack at exit
Marco Bettini [Mon, 9 Jun 2025 15:37:47 +0000 (15:37 +0000)] 
lib-lua: dlua_dovecot_io_register() - Fix unbalanced stack at exit

3 months agolib-lua: dlua_script_init() - Remove unused variable
Marco Bettini [Thu, 5 Jun 2025 09:10:18 +0000 (09:10 +0000)] 
lib-lua: dlua_script_init() - Remove unused variable

3 months agolib-lua: Add missing lua scripts location
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

3 months agolib-compression: Add o_stream_create_deflate()
Timo Sirainen [Mon, 2 Jun 2025 15:19:10 +0000 (18:19 +0300)] 
lib-compression: Add o_stream_create_deflate()

3 months agolib-index: Fix storing cache fields' last_used with 32bit big endian CPUs
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")
3 months agoauth: Fix LDAP SASL support
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

3 months agolib-master: Don't use USER environment in log prefix
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).

3 months agolib-master: Always process import_environment for standalone programs
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.

3 months agolib-settings: Fix settings cache validity checks
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.

3 months agolib-settings, config: Panic if SETTING_DEFINE_LIST_END is missing from settings lists
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

3 months agoauth: Terminate properly auth_oauth2_post_setting_defines list
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

3 months agoauth: Fix empty certificate fingerprint error handling
Timo Sirainen [Mon, 2 Jun 2025 07:49:23 +0000 (10:49 +0300)] 
auth: Fix empty certificate fingerprint error handling

Broken in db01107763ff3ad6afbf91f965ee46d2e3412b05

3 months agolib: cpu-count - fix compilation using musl
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>
4 months agoimapc: Automatically enable IMAP4rev2 if server has the capability
Markus Valentin [Tue, 13 May 2025 11:36:28 +0000 (13:36 +0200)] 
imapc: Automatically enable IMAP4rev2 if server has the capability

4 months agoimapc: Ignore or disable RECENT if IMAP4rev2 is enabled
Markus Valentin [Thu, 8 May 2025 13:25:31 +0000 (15:25 +0200)] 
imapc: Ignore or disable RECENT if IMAP4rev2 is enabled

4 months agolib-http: test-http-client-errors - Increase client progress timeout
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.

4 months agoconfig: Add asserts to make static analyzer happy
Timo Sirainen [Mon, 26 May 2025 07:19:38 +0000 (10:19 +0300)] 
config: Add asserts to make static analyzer happy

4 months agoimap: Remove dead assignment
Timo Sirainen [Mon, 26 May 2025 07:13:13 +0000 (10:13 +0300)] 
imap: Remove dead assignment

4 months agolib-dict-backend: Fix building ldap as plugin
Timo Sirainen [Wed, 28 May 2025 07:26:09 +0000 (10:26 +0300)] 
lib-dict-backend: Fix building ldap as plugin

Broken by 49f2c4d3365de502d705db28376bf41927a1a900

4 months agoconfigure: Do not modify user-provided CFLAGS variable
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.

4 months agoglobal: Fix wrong inheritance of AM_CFLAGS/AM_CPPFLAGS in target_CFLAGS
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.

4 months agom4/dovecot.m4: Use AM_CFLAGS instead of EXTRA_CFLAGS with --enable-ubsan
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.

4 months agologin-common: Copy haproxy fields to client pool
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.

4 months agolib-master: Copy haproxy provided fields before calling callback
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

4 months agolib: strfuncs - Make t_memdup public
Aki Tuomi [Mon, 26 May 2025 08:44:40 +0000 (11:44 +0300)] 
lib: strfuncs - Make t_memdup public

4 months agolda: Default mail_home=$HOME environment if not using userdb lookup
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

4 months agolda: Fix using USER environment if -d hasn't been specified
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.

4 months agoauth: Allow ssl cert to be validated by fingerprint
Aki Tuomi [Fri, 14 Feb 2025 13:29:34 +0000 (15:29 +0200)] 
auth: Allow ssl cert to be validated by fingerprint

4 months agologin-common: Allow invalid client cert if ssl_server_request_client_cert=any-cert
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

4 months agoauth: Support check_client_fp, check_client_cert_fp, check_client_pubkey_fp fields
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.

4 months agolib-ssl-iostream: Change ssl_server_request_client_cert to enum
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

4 months agolib-ssl-iostream: Allow missing ca if invalid certs are allowed
Aki Tuomi [Tue, 31 Dec 2024 10:40:19 +0000 (12:40 +0200)] 
lib-ssl-iostream: Allow missing ca if invalid certs are allowed

4 months agologin-common: Add ssl_client_cert_fp and ssl_client_cert_pubkey_fp if configured
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

4 months agolib-auth-client: Add ssl_client_cert_fp and ssl_client_cert_pubkey_fp fields
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

4 months agolib-auth-client: Compare ssl_ja3_hash to NULL and not 0
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.

4 months agoauth: Add ssl_client_cert_fp and ssl_client_cert_pubkey_fp fields
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

4 months agolib-ssl-iostream: Replace ssl_iostream_has_broken_client_cert() with ssl_iostream_has...
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.

4 months agolib-ssl-iostream: Add ssl_peer_certificate_fingerprint_hash setting
Aki Tuomi [Tue, 31 Dec 2024 10:04:00 +0000 (12:04 +0200)] 
lib-ssl-iostream: Add ssl_peer_certificate_fingerprint_hash setting

4 months agolib-ssl-iostream: Add ssl_iostream_get_peer_cert_fingerprint()
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.

4 months agolib-ssl-iostream: Reformat iostream-openssl.c
Aki Tuomi [Fri, 21 Feb 2025 07:22:25 +0000 (09:22 +0200)] 
lib-ssl-iostream: Reformat iostream-openssl.c

4 months agolib-http: test-http-client-errors - Fix memory leak at sub-process deinit
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

4 months agoconfigure: Fix building without LDAP
Aki Tuomi [Fri, 23 May 2025 08:34:41 +0000 (11:34 +0300)] 
configure: Fix building without LDAP

4 months agolib-dcrypt: test-crypto - Store comparison key in DOVECOT format
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

4 months agoglobal: Fix warnings about uninitialized variables when compiling with -flto
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.

4 months agolib-dcrypt: Increase salt to 16 bytes for dovecot v2 keys
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.

4 months agolib-crypt: test-crypto - Enable testing more keys in test_load_v2_public_key()
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()

4 months agofts-flatcurve: fts_flatcurve_xapian_db_populate() - Remove memory leak on returning...
Marco Bettini [Tue, 20 May 2025 15:53:28 +0000 (15:53 +0000)] 
fts-flatcurve: fts_flatcurve_xapian_db_populate() - Remove memory leak on returning error strings

Discovered on coverity

4 months agolib-lua/dlua-iostream: Remove unnecessary stream state assertion
Karl Fleischmann [Wed, 21 May 2025 10:09:29 +0000 (12:09 +0200)] 
lib-lua/dlua-iostream: Remove unnecessary stream state assertion

4 months agolib-lua: test_io_lua() - Ensure a read error is handled correctly
Karl Fleischmann [Wed, 21 May 2025 09:48:21 +0000 (11:48 +0200)] 
lib-lua: test_io_lua() - Ensure a read error is handled correctly

4 months agolib-lua/dlua-iostream: dlua_i_read_common() - Optimize error handling
Karl Fleischmann [Wed, 21 May 2025 09:42:16 +0000 (11:42 +0200)] 
lib-lua/dlua-iostream: dlua_i_read_common() - Optimize error handling

This also makes the error handling more explicit.

4 months agolib-lua/dlua-iostream: dlua_read_line() - Ignore result of i_stream_read()
Karl Fleischmann [Fri, 16 May 2025 14:48:20 +0000 (16:48 +0200)] 
lib-lua/dlua-iostream: dlua_read_line() - Ignore result of i_stream_read()

Issued by coverity unchecked return value.

4 months agoconfig: settings_add_include() - Close file descriptor if fstat() failed
Karl Fleischmann [Fri, 16 May 2025 14:37:31 +0000 (16:37 +0200)] 
config: settings_add_include() - Close file descriptor if fstat() failed

Issued by coverity resource leak error.

4 months agosubmission-login: cmd_helo_reply() - Only check against SMTP UTF8 if feature is enabled
Karl Fleischmann [Fri, 16 May 2025 13:23:27 +0000 (15:23 +0200)] 
submission-login: cmd_helo_reply() - Only check against SMTP UTF8 if feature is enabled

Issued by coverity deadcode error.

4 months agoimapc: Do not forward ALERT response codes from sources with insecure connections
Marco Bettini [Mon, 28 Apr 2025 13:55:38 +0000 (13:55 +0000)] 
imapc: Do not forward ALERT response codes from sources with insecure connections

4 months agolib: hostpid - Use getaddrinfo instead of gethostbyname
Arjen de Korte [Fri, 31 Jan 2025 12:38:55 +0000 (13:38 +0100)] 
lib: hostpid - Use getaddrinfo instead of gethostbyname

gethostbyname is obsolote, so we should stop using it.

4 months agoimap: imap-select: Disable SELECT UNSEEN response if IMAP4rev2 is enabled
Markus Valentin [Mon, 5 May 2025 07:38:33 +0000 (09:38 +0200)] 
imap: imap-select: Disable SELECT UNSEEN response if IMAP4rev2 is enabled

4 months agolib-dns-client: test-dns-lookup - Add DLLIB for dlopen()
Aki Tuomi [Tue, 20 May 2025 05:43:13 +0000 (08:43 +0300)] 
lib-dns-client: test-dns-lookup - Add DLLIB for dlopen()

4 months agolib-http: Use explicit numbers for HTTP_CLIENT_REQUEST_ERROR_* codes
Timo Sirainen [Thu, 15 May 2025 09:48:41 +0000 (12:48 +0300)] 
lib-http: Use explicit numbers for HTTP_CLIENT_REQUEST_ERROR_* codes

We're beginning on rely on these numbers not to change, so make the numbers
explicit to avoid accidental changes.

4 months agolib-dns src: Change dns_client_settings to config setting.
sergey.kitov [Tue, 6 May 2025 15:20:19 +0000 (18:20 +0300)] 
lib-dns src: Change dns_client_settings to config setting.

4 months agolib-http: Pass http_client_host to http_client_host_shared_lookup.
sergey.kitov [Tue, 13 May 2025 13:13:37 +0000 (16:13 +0300)] 
lib-http: Pass http_client_host to http_client_host_shared_lookup.

The following commit will make dns_lookup retrieving DNS settings from
event. http_client_host is need to pass http_client event to dns_lookup, the event
contains client-specific DNS settings.

4 months agolib-dns-client: Move struct dns_lookup initialization code into separate function.
sergey.kitov [Fri, 28 Mar 2025 09:33:03 +0000 (11:33 +0200)] 
lib-dns-client: Move struct dns_lookup initialization code into separate function.

Upcoming changes will add more usages of that.

4 months agolib-http: Set http_client_context.dns_lookup_timeout_msecs to default value unconditi...
sergey.kitov [Thu, 13 Feb 2025 15:21:38 +0000 (17:21 +0200)] 
lib-http: Set http_client_context.dns_lookup_timeout_msecs to default value unconditionally.

DNS lookup timeout will be made configurable in the following commit.

4 months agolib-smtp: Remove fallback to net_gethostbyname as not supported by upcoming changes.
sergey.kitov [Thu, 6 Feb 2025 12:26:10 +0000 (14:26 +0200)] 
lib-smtp: Remove fallback to net_gethostbyname as not supported by upcoming changes.

4 months agolib-http: Remove fallback to net_gethostbyname as not supported by upcoming changes.
sergey.kitov [Wed, 5 Feb 2025 15:45:39 +0000 (17:45 +0200)] 
lib-http: Remove fallback to net_gethostbyname as not supported by upcoming changes.

4 months agolib-dns-client: Move idle_timeout_msecs and cache_ttl_secs from dns_client_settings...
sergey.kitov [Wed, 5 Feb 2025 11:38:19 +0000 (13:38 +0200)] 
lib-dns-client: Move idle_timeout_msecs and cache_ttl_secs from dns_client_settings to dns_client_parameters.

As a preparation to make dns_client_settings configurable.

4 months agosubmission: Originate submission_client event from event having settings_root set.
sergey.kitov [Tue, 4 Feb 2025 13:14:47 +0000 (15:14 +0200)] 
submission: Originate submission_client event from event having settings_root set.

4 months agolib-http: Fix bug with removal of http_client_request from delayed_requests.
sergey.kitov [Tue, 4 Feb 2025 10:04:16 +0000 (12:04 +0200)] 
lib-http: Fix bug with removal of http_client_request from delayed_requests.

Setting release_time to 0 in the beginning of
http_client_queue_submit_now() prevents removing of the request from
delayed_requests in case of failures.

4 months agolib-dns-client, lib-http: remove ioloop from struct dns_client_settings.
sergey.kitov [Wed, 13 Nov 2024 13:23:43 +0000 (15:23 +0200)] 
lib-dns-client, lib-http: remove ioloop from struct dns_client_settings.