]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
2 months agoauth: auth-cache - Change auth_cache_parse_key_exclude() to return error
Aki Tuomi [Fri, 25 Jul 2025 08:51:16 +0000 (11:51 +0300)] 
auth: auth-cache - Change auth_cache_parse_key_exclude() to return error

Simplifies following commit

2 months agoauth: auth-cache - Deduplicate auth_cache_parse_key() to use auth_cache_parse_key_and...
Aki Tuomi [Fri, 25 Jul 2025 08:48:43 +0000 (11:48 +0300)] 
auth: auth-cache - Deduplicate auth_cache_parse_key() to use auth_cache_parse_key_and_fields()

Simplifies following commit

2 months agoauth: auth-cache - Refactor auth_cache_parse_key_and_fields()
Aki Tuomi [Wed, 30 Jul 2025 06:42:20 +0000 (09:42 +0300)] 
auth: auth-cache - Refactor auth_cache_parse_key_and_fields()

Call auth_cache_parse_key_exclude() at the function end,
simplifies next commit.

2 months agoauth: Use AUTH_CACHE_KEY_USER instead of per-database constants
Aki Tuomi [Fri, 25 Jul 2025 05:16:52 +0000 (08:16 +0300)] 
auth: Use AUTH_CACHE_KEY_USER instead of per-database constants

Fixes cache key issue where users would end up overwriting
each other in cache due to cache key being essentially static
string because we no longer support %u.

Forgotten in 2e298e7ee98b6df61cf85117f000290d60a473b8

2 months agolib-language: Substitute libicu lowercase mapping implementation with our own
Stephan Bosch [Tue, 1 Apr 2025 02:43:33 +0000 (04:43 +0200)] 
lib-language: Substitute libicu lowercase mapping implementation with our own

2 months agolib: unicode-transform - Implement case mapping
Stephan Bosch [Tue, 1 Apr 2025 02:23:15 +0000 (04:23 +0200)] 
lib: unicode-transform - Implement case mapping

2 months agolib: unicode-data - Add case folding mappings
Stephan Bosch [Tue, 1 Apr 2025 01:07:30 +0000 (03:07 +0200)] 
lib: unicode-data - Add case folding mappings

2 months agolib: unicode-data - Add special case mappings for upper and lower case
Stephan Bosch [Mon, 31 Mar 2025 21:23:01 +0000 (23:23 +0200)] 
lib: unicode-data - Add special case mappings for upper and lower case

2 months agolib-language: Drop old word break and word boundary lookup implementation
Stephan Bosch [Fri, 21 Mar 2025 18:40:01 +0000 (19:40 +0100)] 
lib-language: Drop old word break and word boundary lookup implementation

2 months agolib-language: lang-tokenizer-generic - Use the new Unicode character database
Stephan Bosch [Fri, 21 Mar 2025 18:34:44 +0000 (19:34 +0100)] 
lib-language: lang-tokenizer-generic - Use the new Unicode character database

2 months agolib: unicode-data - Add relevant word break and boundary bits
Stephan Bosch [Fri, 21 Mar 2025 17:18:07 +0000 (18:18 +0100)] 
lib: unicode-data - Add relevant word break and boundary bits

2 months agolib: unicode-transform - Add Unicode conformance test for NF* normalizations as unit...
Stephan Bosch [Mon, 7 Apr 2025 22:17:09 +0000 (00:17 +0200)] 
lib: unicode-transform - Add Unicode conformance test for NF* normalizations as unit test

2 months agolib: unicode-transform - Implement streaming Unicode Normalization
Stephan Bosch [Wed, 27 Nov 2024 00:36:43 +0000 (01:36 +0100)] 
lib: unicode-transform - Implement streaming Unicode Normalization

All standard forms are supported: NFD, NFKD, NFC, NFKC.

2 months agolib: unicode-transform - Add generic Unicode string transformation API
Stephan Bosch [Sun, 30 Mar 2025 01:02:58 +0000 (03:02 +0200)] 
lib: unicode-transform - Add generic Unicode string transformation API

2 months agolib: unicode-data - Add fields needed for Unicode normalization
Stephan Bosch [Tue, 22 Apr 2025 00:04:43 +0000 (02:04 +0200)] 
lib: unicode-data - Add fields needed for Unicode normalization

2 months agolib: unicode-transform - Make Hangul base and count definitions global
Stephan Bosch [Fri, 21 Mar 2025 05:19:57 +0000 (06:19 +0100)] 
lib: unicode-transform - Make Hangul base and count definitions global

2 months agolib: unicode-transform - Implement RFC5051 API in UTF32 and use it
Stephan Bosch [Fri, 21 Mar 2025 04:59:48 +0000 (05:59 +0100)] 
lib: unicode-transform - Implement RFC5051 API in UTF32 and use it

2 months agolib: unicode-transform - Rename chr variables/parameters to cp
Stephan Bosch [Fri, 21 Mar 2025 05:09:21 +0000 (06:09 +0100)] 
lib: unicode-transform - Rename chr variables/parameters to cp

These are code points and not characters per se.

2 months agolib: unicode-transform - Rename uni_ucs4_decompose_hangul() to unicode_hangul_decompose()
Stephan Bosch [Fri, 21 Mar 2025 05:04:19 +0000 (06:04 +0100)] 
lib: unicode-transform - Rename uni_ucs4_decompose_hangul() to unicode_hangul_decompose()

2 months agolib: unicode-transform - Avoid unichar_t in unicode modules
Stephan Bosch [Fri, 21 Mar 2025 05:02:49 +0000 (06:02 +0100)] 
lib: unicode-transform - Avoid unichar_t in unicode modules

2 months agolib: unichar - Move uni_ucs4_decompose_one_utf8() to unicode-transform.c
Stephan Bosch [Fri, 21 Mar 2025 04:48:48 +0000 (05:48 +0100)] 
lib: unichar - Move uni_ucs4_decompose_one_utf8() to unicode-transform.c

2 months agolib: unichar - Move Hangul syllable handling to unicode-transform.c
Stephan Bosch [Fri, 21 Mar 2025 04:45:07 +0000 (05:45 +0100)] 
lib: unichar - Move Hangul syllable handling to unicode-transform.c

2 months agolib: Drop the old Unicode Character Database implementation
Stephan Bosch [Fri, 21 Mar 2025 15:07:14 +0000 (16:07 +0100)] 
lib: Drop the old Unicode Character Database implementation

2 months agolib: unichar - Implement uni_utf8_to_decomposed_titlecase() using the new Unicode...
Stephan Bosch [Fri, 21 Mar 2025 15:06:05 +0000 (16:06 +0100)] 
lib: unichar - Implement uni_utf8_to_decomposed_titlecase() using the new Unicode character database

2 months agolib: unichar - Implement uni_ucs4_to_titlecase() using the new Unicode character...
Stephan Bosch [Fri, 21 Mar 2025 04:06:20 +0000 (05:06 +0100)] 
lib: unichar - Implement uni_ucs4_to_titlecase() using the new Unicode character database

2 months agolib: unichar - Split off uni_ucs4_decompose_hangul()
Stephan Bosch [Fri, 21 Mar 2025 03:49:57 +0000 (04:49 +0100)] 
lib: unichar - Split off uni_ucs4_decompose_hangul()

2 months agolib: unichar - Update hangul syllable decomposition to the latest standard
Stephan Bosch [Fri, 21 Mar 2025 03:47:24 +0000 (04:47 +0100)] 
lib: unichar - Update hangul syllable decomposition to the latest standard

2 months agolib: test-unichar - Move collation test to separate function
Stephan Bosch [Fri, 21 Mar 2025 04:14:26 +0000 (05:14 +0100)] 
lib: test-unichar - Move collation test to separate function

2 months agolib: unicode-data - Add data for first and full code point decomposition
Stephan Bosch [Tue, 22 Apr 2025 00:55:05 +0000 (02:55 +0200)] 
lib: unicode-data - Add data for first and full code point decomposition

2 months agolib: Start new Unicode Character Database implementation
Stephan Bosch [Fri, 21 Mar 2025 03:26:50 +0000 (04:26 +0100)] 
lib: Start new Unicode Character Database implementation

It uses a pre-compiled trie structure and will in later commits feature full
support for the data necessary for Unicode normalization. Stuff needed for
lib-language can be migrated here as well.

2 months agolib: Move Unicode Character Database (UCD) files to ./ucd
Stephan Bosch [Mon, 17 Mar 2025 02:55:38 +0000 (03:55 +0100)] 
lib: Move Unicode Character Database (UCD) files to ./ucd

2 months agolib-test: Add test_assert_memcmp*()
Stephan Bosch [Fri, 25 Jul 2025 01:31:44 +0000 (03:31 +0200)] 
lib-test: Add test_assert_memcmp*()

2 months agolib-test: test-common - Drop spurious spaces in function prototype
Stephan Bosch [Sat, 26 Jul 2025 00:25:22 +0000 (02:25 +0200)] 
lib-test: test-common - Drop spurious spaces in function prototype

2 months agolib-storage: mail_storage_settings_ext_check() - Add warning for deprecated mailbox_d...
Karl Fleischmann [Tue, 1 Jul 2025 13:00:57 +0000 (15:00 +0200)] 
lib-storage: mail_storage_settings_ext_check() - Add warning for deprecated mailbox_directory_name_legacy setting

2 months agolib-storage: mail-storage-settings - Disable mailbox_directory_name_legacy by default
Karl Fleischmann [Tue, 1 Jul 2025 12:43:35 +0000 (14:43 +0200)] 
lib-storage: mail-storage-settings - Disable mailbox_directory_name_legacy by default

2 months agoconfig: Setting changes may have updated the included group's settings
Timo Sirainen [Tue, 29 Jul 2025 17:10:03 +0000 (20:10 +0300)] 
config: Setting changes may have updated the included group's settings

If group include was done before other settings, any further updates
changed the group's settings. For example:

group @test foo {
  default_internal_user = A
}
service imap {
  @test = foo
  default_internal_user = B
}
service pop3 {
  @test = foo
}

This caused service pop3 to also have default_internal_user=B.

2 months agomaster: Check that no other fd than DOVECOT_CONFIG_FD leaks
Aki Tuomi [Tue, 29 Jul 2025 11:19:57 +0000 (14:19 +0300)] 
master: Check that no other fd than DOVECOT_CONFIG_FD leaks

This fd is needed for configuration reading.

2 months agolib-master: Ensure cache fd is closed on exec
Aki Tuomi [Tue, 29 Jul 2025 11:19:41 +0000 (14:19 +0300)] 
lib-master: Ensure cache fd is closed on exec

Prevents it from leaking by accident.

2 months agolib-storage: fs - Initialize roots in iteration always
Aki Tuomi [Tue, 29 Jul 2025 06:35:51 +0000 (09:35 +0300)] 
lib-storage: fs - Initialize roots in iteration always

Fixes segmentation fault when running force-resync with missing folder.

2 months agolib-storage: Remove diversions to mailbox_list_subscriptions_iter_*()
Marco Bettini [Fri, 27 Jun 2025 14:07:29 +0000 (14:07 +0000)] 
lib-storage: Remove diversions to mailbox_list_subscriptions_iter_*()

2 months agolib-storage: drivers - Remove *_list_iter_next() driver specific code
Marco Bettini [Mon, 21 Jul 2025 12:24:30 +0000 (12:24 +0000)] 
lib-storage: drivers - Remove *_list_iter_next() driver specific code

2 months agolib-storage: mailbox_list_iter_next_call() - Handle subscriptions
Marco Bettini [Tue, 8 Jul 2025 09:25:42 +0000 (09:25 +0000)] 
lib-storage: mailbox_list_iter_next_call() - Handle subscriptions
directly here

2 months agolib-storage: Make mailbox_tree_deinit() and mailbox_tree_iterate_deinit() no-ops...
Marco Bettini [Tue, 15 Jul 2025 08:09:09 +0000 (08:09 +0000)] 
lib-storage: Make mailbox_tree_deinit() and mailbox_tree_iterate_deinit() no-ops on NULLs

2 months agofts: fts_parser_script_try_init() - Initialize filename
Marco Bettini [Fri, 25 Jul 2025 12:52:56 +0000 (12:52 +0000)] 
fts: fts_parser_script_try_init() - Initialize filename

Found by clang scan-build static analysis.

2 months agolib-imap: test_imap_write_capabilities() - Add missing NULL to terminate the array
Marco Bettini [Thu, 24 Jul 2025 10:18:13 +0000 (10:18 +0000)] 
lib-imap: test_imap_write_capabilities() - Add missing NULL to terminate the array

2 months agofts: Work harder to find attachment filename
Fred Morcos [Fri, 18 Jul 2025 08:38:38 +0000 (10:38 +0200)] 
fts: Work harder to find attachment filename

2 months agologin-common: Handle different dsasl_client_results failures better
Timo Sirainen [Fri, 18 Jul 2025 11:14:34 +0000 (14:14 +0300)] 
login-common: Handle different dsasl_client_results failures better

2 months ago*-login: Deduplicate shared SASL step handling code to login_proxy_sasl_step()
Timo Sirainen [Fri, 18 Jul 2025 11:13:23 +0000 (14:13 +0300)] 
*-login: Deduplicate shared SASL step handling code to login_proxy_sasl_step()

2 months ago*-login: Add LOGIN_PROXY_FAILURE_TYPE_AUTH_NOT_REPLIED
Timo Sirainen [Fri, 18 Jul 2025 11:28:47 +0000 (14:28 +0300)] 
*-login: Add LOGIN_PROXY_FAILURE_TYPE_AUTH_NOT_REPLIED

2 months ago*-commin: Rename LOGIN_PROXY_FAILURE_TYPE_AUTH to LOGIN_PROXY_FAILURE_TYPE_AUTH_REPLIED
Timo Sirainen [Fri, 18 Jul 2025 11:26:21 +0000 (14:26 +0300)] 
*-commin: Rename LOGIN_PROXY_FAILURE_TYPE_AUTH to LOGIN_PROXY_FAILURE_TYPE_AUTH_REPLIED

2 months agolib-sasl: Add more results to enum dsasl_client_result
Timo Sirainen [Fri, 18 Jul 2025 11:02:36 +0000 (14:02 +0300)] 
lib-sasl: Add more results to enum dsasl_client_result

2 months agolib-sasl, global: Change dsasl_client_input/output() to return enum
Timo Sirainen [Fri, 18 Jul 2025 10:55:43 +0000 (13:55 +0300)] 
lib-sasl, global: Change dsasl_client_input/output() to return enum

2 months agoimap-urlauth: Remove dead assignment
Timo Sirainen [Fri, 18 Jul 2025 11:55:25 +0000 (14:55 +0300)] 
imap-urlauth: Remove dead assignment

2 months agolib-var-expand-crypt: Fix linking issues
Timo Sirainen [Wed, 16 Jul 2025 06:50:56 +0000 (09:50 +0300)] 
lib-var-expand-crypt: Fix linking issues

This fixes at least OSX linking issues.

2 months agodoveadm: Fix boolean-parameter:false handling in doveadm HTTP API
Timo Sirainen [Mon, 7 Jul 2025 08:17:42 +0000 (11:17 +0300)] 
doveadm: Fix boolean-parameter:false handling in doveadm HTTP API

doveadm_cmd_param_flag() returned TRUE if the parameter was set, regardless
of whether its value was set to true or false.

2 months agolib-http: Fix memory leak when accessing HTTP server via UNIX socket
Timo Sirainen [Wed, 2 Jul 2025 11:01:38 +0000 (14:01 +0300)] 
lib-http: Fix memory leak when accessing HTTP server via UNIX socket

2 months agologin-common: Change login_socket_path setting to be hidden
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.

2 months agolib-storage, doveadm: Change auth_socket_path setting to be hidden
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.

2 months agoglobal: Replace mail service binaries' -a parameter with auth_master_socket_path...
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

2 months agolib-lua: Add dlua_var_expand() allow var_expand() from lua
Markus Valentin [Thu, 26 Jun 2025 08:42:39 +0000 (10:42 +0200)] 
lib-lua: Add dlua_var_expand() allow var_expand() from lua

2 months agolib-dict-extra: dict-client - Fix crash if server sends invalid iteration reply
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

2 months agolib-dict-extra: Install dict-client.h
Timo Sirainen [Mon, 9 Jun 2025 08:41:36 +0000 (11:41 +0300)] 
lib-dict-extra: Install dict-client.h

2 months agolib-dict: Remove unused enum dict_data_type
Timo Sirainen [Mon, 9 Jun 2025 08:20:42 +0000 (11:20 +0300)] 
lib-dict: Remove unused enum dict_data_type

2 months agodict: Remove unnecessary parsing of value_type parameter in handshake
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

2 months agolib: Fix crash when config is reloaded and logging to syslog
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.

2 months agoimapc: imapc_list_subscriptions_refresh() - Use LIST (SUBSCRIBED) when available...
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

2 months agoimapc: imapc_untagged_list() - Handle the \Subscribed flag
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)

2 months agoimapc: imapc_untagged_lsub() - Extract tree variable
Marco Bettini [Mon, 14 Jul 2025 10:01:05 +0000 (10:01 +0000)] 
imapc: imapc_untagged_lsub() - Extract tree variable

2 months agoimapc: imapc_list_update_tree() - Always get a node
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.

2 months agolib-imap-client: Add imapc_cmd_has_imap4rev2()
Marco Bettini [Tue, 3 Jun 2025 12:22:54 +0000 (12:22 +0000)] 
lib-imap-client: Add imapc_cmd_has_imap4rev2()

2 months agoimap: Add imap_compress_on_proxy hidden setting
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.

2 months agolib-compression: Fix potential hangs writing to non-blocking ostreams
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.

2 months agolib, lib-ssl-iostream: Split off o_stream_init_buffering_flush()
Timo Sirainen [Wed, 4 Jun 2025 06:56:26 +0000 (09:56 +0300)] 
lib, lib-ssl-iostream: Split off o_stream_init_buffering_flush()

2 months agolib: Fix potential hangs when filter istream read doesn't read from its parent
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.

2 months agologin-common: Write client rawlogs in plaintext
Timo Sirainen [Tue, 3 Jun 2025 12:36:00 +0000 (15:36 +0300)] 
login-common: Write client rawlogs in plaintext

2 months agoimap, imap-login: Fix libcompress dependency tracking
Timo Sirainen [Tue, 3 Jun 2025 12:35:01 +0000 (15:35 +0300)] 
imap, imap-login: Fix libcompress dependency tracking

2 months agologin-common: Change proxy_no_multiplex to bit field
Timo Sirainen [Tue, 3 Jun 2025 09:23:17 +0000 (12:23 +0300)] 
login-common: Change proxy_no_multiplex to bit field

2 months agolib-ssl-iostream: Remove unused OPENSSL_IOSTREAM_SYNC_TYPE_FIRST_READ
Timo Sirainen [Wed, 4 Jun 2025 08:30:36 +0000 (11:30 +0300)] 
lib-ssl-iostream: Remove unused OPENSSL_IOSTREAM_SYNC_TYPE_FIRST_READ

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