]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
12 hours agoimap: cmd-append - Fix assertion panic occurring upon invalid 'REPLACE 0' command main
Stephan Bosch [Sun, 29 Mar 2026 18:03:40 +0000 (20:03 +0200)] 
imap: cmd-append - Fix assertion panic occurring upon invalid 'REPLACE 0' command

Panic was:
Panic: file mail-cache-lookup.c: line 354 (mail_cache_field_exists): assertion failed: (seq > 0)

12 hours agoimap: cmd-append - Properly consume message literal for invalid REPLACE message sequence
Stephan Bosch [Thu, 2 Apr 2026 01:02:53 +0000 (03:02 +0200)] 
imap: cmd-append - Properly consume message literal for invalid REPLACE message sequence

12 hours agofts-solr: Fix use-after-free crash during DNS lookup
Timo Sirainen [Wed, 1 Apr 2026 12:24:52 +0000 (15:24 +0300)] 
fts-solr: Fix use-after-free crash during DNS lookup

The solr_http_client singleton outlived the user session that created
it. Its event chain held a ref on the mail_storage_service_user event,
keeping it alive after the user was freed. The SETTINGS_EVENT_INSTANCE on
that event still pointed to the already-freed settings_instance. On the
next user session, dns_lookup() walked the stale event chain and
dereferenced the dangling pointer in settings_instance_get().

Fix this by using a shorter lived HTTP client.

29 hours agolib-http: Calculate "other ioloop" statistics also when request wasn't sent
Timo Sirainen [Tue, 31 Mar 2026 17:54:19 +0000 (20:54 +0300)] 
lib-http: Calculate "other ioloop" statistics also when request wasn't sent

29 hours agolib-http: Count lock and ioloop wait statistics beginning when request is queued
Timo Sirainen [Tue, 31 Mar 2026 17:49:42 +0000 (20:49 +0300)] 
lib-http: Count lock and ioloop wait statistics beginning when request is queued

Previously they were counted only after the request was sent. However,
it's important to also know where time is spent while the request is still
queued.

This also fixes wrong output for lock wait statistics when the request
was never sent (e.g. DNS lookup failure).

2 days agolib-master, master: Fix inet_listener_reuse_port=yes handling
Timo Sirainen [Wed, 18 Mar 2026 16:30:20 +0000 (18:30 +0200)] 
lib-master, master: Fix inet_listener_reuse_port=yes handling

This only works properly if the listener sockets don't change and
there is always a process listening on each of the sockets.

Now master process creates the reuse_port=yes listeners for all of the
processes at startup (up to process_limit). Each child process inherits
exactly one unique listener socket based on its assigned process index.

Since with reuse_port=yes connections are assigned to a specific socket,
processes can no longer rely on other processes picking up connections when
they are full. Instead, each process is now responsible for rejecting
connections when they reach client_limit.

2 days agomaster: Add checks to services with inet_listener_reuse_port=yes
Timo Sirainen [Wed, 18 Mar 2026 15:47:46 +0000 (17:47 +0200)] 
master: Add checks to services with inet_listener_reuse_port=yes

 * They must have process_min_avail = process_limit
 * All or none of the inet_listeners must have reuse_port=yes

Otherwise reuse_port=yes doesn't work very well.

2 days agolib-master, master: Replace inet_listener_reuse_port with service_reuse_port
Timo Sirainen [Thu, 26 Mar 2026 14:57:54 +0000 (16:57 +0200)] 
lib-master, master: Replace inet_listener_reuse_port with service_reuse_port

All inet_listeners require the same value for reuse_port, so it's better to
be a service setting.

2 days agopop3: Fix memory leak when using DELE+RSET+DELE
Fred Morcos [Tue, 17 Mar 2026 10:55:19 +0000 (11:55 +0100)] 
pop3: Fix memory leak when using DELE+RSET+DELE

This fixes a leak where calls to delete -> reset -> delete would leak memory because the
client->deleted flag is checked but the state of the client->deleted_bitmask isn't.

This removes client->deleted and uses the bitmask as a marker instead.

2 days agolmtp: Add back service_extra_groups=$SET:default_internal_group
Timo Sirainen [Thu, 2 Apr 2026 06:16:46 +0000 (09:16 +0300)] 
lmtp: Add back service_extra_groups=$SET:default_internal_group

Reverts 8ec25c24db9f1ad9be437ef266688272686daf42 for lmtp.

2 days agoplugins/push-notification: push-notification-driver-ox - Remove trailing whitespace
Karl Fleischmann [Tue, 31 Mar 2026 09:42:36 +0000 (11:42 +0200)] 
plugins/push-notification: push-notification-driver-ox - Remove trailing whitespace

2 days agoplugins/push-notification: push-notification-driver-ox - Restore default http-client...
Karl Fleischmann [Tue, 31 Mar 2026 10:46:58 +0000 (12:46 +0200)] 
plugins/push-notification: push-notification-driver-ox - Restore default http-client settings

This was dropped with the config-rewrite conversion.

2 days agoplugins/push-notification: push-notification-driver-ox - Use settings_event_add_filte...
Karl Fleischmann [Tue, 31 Mar 2026 09:50:12 +0000 (11:50 +0200)] 
plugins/push-notification: push-notification-driver-ox - Use settings_event_add_filter_name()

2 days agoplugins/push-notification: push-notification-driver-lua - Use settings_event_add_filt...
Karl Fleischmann [Tue, 31 Mar 2026 09:47:30 +0000 (11:47 +0200)] 
plugins/push-notification: push-notification-driver-lua - Use settings_event_add_filter_name()

2 days agoplugins/push-notification: push-notification-driver-dlog - Add filter name for dlog...
Karl Fleischmann [Tue, 31 Mar 2026 10:42:08 +0000 (12:42 +0200)] 
plugins/push-notification: push-notification-driver-dlog - Add filter name for dlog driver

This makes this push notification driver work the same as the ox and lua ones.

2 days agoplugins/quota: Use settings_event_add_filter_name()
Karl Fleischmann [Tue, 31 Mar 2026 09:49:26 +0000 (11:49 +0200)] 
plugins/quota: Use settings_event_add_filter_name()

2 days agoauth: Use timing safe comparison for certificate and public key fingerprint
Aki Tuomi [Mon, 6 Apr 2026 17:21:53 +0000 (20:21 +0300)] 
auth: Use timing safe comparison for certificate and public key fingerprint

3 days agolmtp: lmtp-proxy - Make passdb lookup for recipient redirect asynchronous
Stephan Bosch [Tue, 24 Mar 2026 14:09:19 +0000 (15:09 +0100)] 
lmtp: lmtp-proxy - Make passdb lookup for recipient redirect asynchronous

3 days agolmtp: lmtp-proxy - Split off lmtp_proxy_rcpt_redirect_relookup_cb() from lmtp_proxy_r...
Stephan Bosch [Tue, 24 Mar 2026 22:00:12 +0000 (23:00 +0100)] 
lmtp: lmtp-proxy - Split off lmtp_proxy_rcpt_redirect_relookup_cb() from lmtp_proxy_rcpt_redirect_relookup()

This is not an actual callback yet.

3 days agolmtp: lmtp-proxy - Rename variable "ret" to "result" in lmtp_proxy_rcpt_redirect_relo...
Stephan Bosch [Tue, 24 Mar 2026 21:47:13 +0000 (22:47 +0100)] 
lmtp: lmtp-proxy - Rename variable "ret" to "result" in lmtp_proxy_rcpt_redirect_relookup()

3 days agolmtp: lmtp-proxy - Make normal passdb lookup for recipient asynchronous
Stephan Bosch [Sat, 29 Dec 2018 00:07:38 +0000 (01:07 +0100)] 
lmtp: lmtp-proxy - Make normal passdb lookup for recipient asynchronous

3 days agolmtp: lmtp-proxy - Split off lmtp_proxy_rcpt_user_lookup_cb() from lmtp_proxy_rcpt()
Stephan Bosch [Mon, 18 May 2020 20:39:37 +0000 (22:39 +0200)] 
lmtp: lmtp-proxy - Split off lmtp_proxy_rcpt_user_lookup_cb() from lmtp_proxy_rcpt()

This is not an actual callback yet.

3 days agolmtp: lmtp-proxy - Drop orig_username variable in lmtp_proxy_rcpt()
Stephan Bosch [Mon, 18 May 2020 20:49:34 +0000 (22:49 +0200)] 
lmtp: lmtp-proxy - Drop orig_username variable in lmtp_proxy_rcpt()

3 days agolmtp: lmtp-proxy - Rename variable "ret" to "result" in lmtp_proxy_rcpt()
Stephan Bosch [Mon, 18 May 2020 20:21:23 +0000 (22:21 +0200)] 
lmtp: lmtp-proxy - Rename variable "ret" to "result" in lmtp_proxy_rcpt()

3 days agolmtp: Make RCPT command implementation suitable for asynchronous lookups
Stephan Bosch [Fri, 28 Dec 2018 23:03:48 +0000 (00:03 +0100)] 
lmtp: Make RCPT command implementation suitable for asynchronous lookups

3 days agolib-smtp: smtp-server - Make smtp_server_command_ref/unref() public
Stephan Bosch [Tue, 2 Jun 2020 23:06:31 +0000 (01:06 +0200)] 
lib-smtp: smtp-server - Make smtp_server_command_ref/unref() public

3 days agolib-smtp: smtp-client-connection - Make sure all ioloop objects are created on the...
Stephan Bosch [Mon, 28 Jul 2025 23:33:26 +0000 (01:33 +0200)] 
lib-smtp: smtp-client-connection - Make sure all ioloop objects are created on the connection's ioloop

3 days agolib-dns-client: dns-lookup - Allow performing lookups on a specific ioloop
Stephan Bosch [Mon, 28 Jul 2025 23:32:21 +0000 (01:32 +0200)] 
lib-dns-client: dns-lookup - Allow performing lookups on a specific ioloop

3 days agolib: connection - Retain pre-initialized ioloop
Stephan Bosch [Mon, 28 Jul 2025 23:31:29 +0000 (01:31 +0200)] 
lib: connection - Retain pre-initialized ioloop

3 days agolib-auth-client: auth-master - Prevent hangs and crashes when lookups are nested
Stephan Bosch [Thu, 28 Aug 2025 02:36:12 +0000 (04:36 +0200)] 
lib-auth-client: auth-master - Prevent hangs and crashes when lookups are nested

3 days agolmtp: Add debug log message indicating which backend will serve the recipient
Stephan Bosch [Tue, 24 Mar 2026 04:02:23 +0000 (05:02 +0100)] 
lmtp: Add debug log message indicating which backend will serve the recipient

3 days agolib-smtp: smtp-server-recipient - Add debug logging for submitted RCPT reply
Stephan Bosch [Mon, 23 Mar 2026 22:28:34 +0000 (23:28 +0100)] 
lib-smtp: smtp-server-recipient - Add debug logging for submitted RCPT reply

3 days agolib-smtp: smtp-server-recipient - Add recipient index to event log once recipient...
Stephan Bosch [Mon, 23 Mar 2026 21:28:17 +0000 (22:28 +0100)] 
lib-smtp: smtp-server-recipient - Add recipient index to event log once recipient is accepted

3 days agolib-smtp: smtp-server-recipient - Use public recipient struct as smtp_server_recipien...
Stephan Bosch [Mon, 23 Mar 2026 21:30:48 +0000 (22:30 +0100)] 
lib-smtp: smtp-server-recipient - Use public recipient struct as smtp_server_recipient_update_event() parameter

3 days agolib-smtp: smtp-server-reply - Fix presence of dash in smtp_server_reply_write_one_lin...
Stephan Bosch [Tue, 24 Mar 2026 02:11:25 +0000 (03:11 +0100)] 
lib-smtp: smtp-server-reply - Fix presence of dash in smtp_server_reply_write_one_line() output

3 days agolib-smtp: Reformat smtp-server-reply.c
Stephan Bosch [Tue, 24 Mar 2026 02:32:02 +0000 (03:32 +0100)] 
lib-smtp: Reformat smtp-server-reply.c

6 days agoindexer-worker: Drop root privileges permanently
Timo Sirainen [Wed, 1 Apr 2026 16:00:46 +0000 (19:00 +0300)] 
indexer-worker: Drop root privileges permanently

6 days agoindexer-worker: Change default restart_request_count
Timo Sirainen [Wed, 1 Apr 2026 15:59:52 +0000 (18:59 +0300)] 
indexer-worker: Change default restart_request_count

For Pro, use default 1000 like with imap/pop3/etc processes.

For CE, use default 1 so that it works with multiple UIDs after the
following change.

Add settings history only for Pro, because with CE the old default
value might not work anymore now that root privileges are permanetly
dropped.

6 days agoutil: script-login - Don't allow running as root
Timo Sirainen [Wed, 1 Apr 2026 15:11:57 +0000 (18:11 +0300)] 
util: script-login - Don't allow running as root

Originally it it was forgotten to be prevented, and it was changed to be
explicitly allowed by e0dae5d76ea0a4aef849602750ce73dfae995bc8.

6 days agoquota: quota-status - Don't allow running as root
Timo Sirainen [Wed, 1 Apr 2026 15:09:42 +0000 (18:09 +0300)] 
quota: quota-status - Don't allow running as root

Originally it it was forgotten to be prevented, and it was changed to be
explicitly allowed by e0dae5d76ea0a4aef849602750ce73dfae995bc8.

7 days agolib-auth-client: Avoid "unknown id" errors for aborted auth requests
Timo Sirainen [Thu, 26 Mar 2026 11:31:53 +0000 (13:31 +0200)] 
lib-auth-client: Avoid "unknown id" errors for aborted auth requests

Delay freeing aborted request until its response is received or auth server
is disconnected.

Fixes:
Error: auth-client: conn ...: Auth entication server sent unknown id ...

7 days agolib-auth-client, auth: CANCEL command now replies with CANCELLED reply
Timo Sirainen [Thu, 26 Mar 2026 12:27:27 +0000 (14:27 +0200)] 
lib-auth-client, auth: CANCEL command now replies with CANCELLED reply

This is done when auth client protocol is >=v1.4. The CANCELLED reply is
used to free the auth request, if it still exists.

7 days agologin-common: When process is full, don't destroy clients waiting on master auth
Timo Sirainen [Thu, 26 Mar 2026 10:19:36 +0000 (12:19 +0200)] 
login-common: When process is full, don't destroy clients waiting on master auth

These clients have already successfully authenticated. Killing their client
is only going to cause errors.

7 days agologin-common: Give better reason for auth_client_request_abort()
Timo Sirainen [Thu, 26 Mar 2026 10:01:55 +0000 (12:01 +0200)] 
login-common: Give better reason for auth_client_request_abort()

7 days agologin-common: Remove unused client_auth_abort()
Timo Sirainen [Thu, 26 Mar 2026 10:00:16 +0000 (12:00 +0200)] 
login-common: Remove unused client_auth_abort()

7 days agolib-master: Fix crash when reaching client_limit with restart_request_count>1 and...
Timo Sirainen [Thu, 26 Mar 2026 09:45:24 +0000 (11:45 +0200)] 
lib-master: Fix crash when reaching client_limit with restart_request_count>1 and client_limit>1

Fixes:
Panic: file master-service.c: line 1909 (master_service_listen): assertion failed: (service->master_status.available_count > 0)

7 days agolib-master, master: Fix behavior for services with client_limit>1 and restart_request...
Timo Sirainen [Wed, 25 Mar 2026 09:30:20 +0000 (11:30 +0200)] 
lib-master, master: Fix behavior for services with client_limit>1 and restart_request_count

Especially login processes are commonly configured to use client_limit > 1
and process_limit = process_min_avail = number of CPUs. However, this
prevents using restart_request_count, because long lived connections
can reserve the process and prevent a new one from being launched.

Change the behavior so that when restart_request_count is reached for a
process whose service has client_limit > 1, the process is no longer
counted towards process_limit.

7 days agomaster: service_status_more() - Change status parameter to status_available_count
Timo Sirainen [Wed, 25 Mar 2026 09:45:56 +0000 (11:45 +0200)] 
master: service_status_more() - Change status parameter to status_available_count

Simplifies the next commit.

7 days agolib-http: Count time spent in any ioloop waiting on HTTP request as "http ioloop"
Timo Sirainen [Tue, 31 Mar 2026 15:35:07 +0000 (18:35 +0300)] 
lib-http: Count time spent in any ioloop waiting on HTTP request as "http ioloop"

Previously only http_client_wait() caused times to be counted in "http
ioloop". This isn't relevant though. The important difference is that
time spent on "http ioloop" is actually time spent on waiting for the
HTTP request, while "other ioloop" is time spent on waiting for an ioloop
without the HTTP request.

7 days agovirtual: virtual_storage_create() - Deny index rather than allowing just fs
Marco Bettini [Mon, 30 Mar 2026 12:34:54 +0000 (12:34 +0000)] 
virtual: virtual_storage_create() - Deny index rather than allowing just fs

7 days agom4: want_mysql.m4 - Fix detecting SSL support with libmariadb
Timo Sirainen [Wed, 1 Apr 2026 12:22:16 +0000 (15:22 +0300)] 
m4: want_mysql.m4 - Fix detecting SSL support with libmariadb

8 days agolib-regex: Fix memory leak when replace pattern doesn't match
Timo Sirainen [Wed, 1 Apr 2026 13:06:05 +0000 (16:06 +0300)] 
lib-regex: Fix memory leak when replace pattern doesn't match

8 days agolib-program-client: program-client - Assert that program_input is set in program_clie...
Stephan Bosch [Sat, 28 Mar 2026 19:50:55 +0000 (20:50 +0100)] 
lib-program-client: program-client - Assert that program_input is set in program_client_input_finish()

Even though all paths leading to this function make sure it is assigned,
Coverity is worried about it being NULL at some point (CID: 42244).

8 days agolib-json: json-istream - Assert that value_stream either both set or unset in json_is...
Stephan Bosch [Sat, 28 Mar 2026 19:46:40 +0000 (20:46 +0100)] 
lib-json: json-istream - Assert that value_stream either both set or unset in json_istream_consume_value_stream()

This confuses Coverity otherwise (CID: 42255).

8 days agolib-http: http-server-request - Assert that response is set in http_server_request_fi...
Stephan Bosch [Sat, 28 Mar 2026 19:32:57 +0000 (20:32 +0100)] 
lib-http: http-server-request - Assert that response is set in http_server_request_finished()

Previous code suggested it may be NULL, which is not true.

Found by Coverity (CID: 42271)

8 days agolib-auth: auth-scram-server - Assert that hash method never gets to be NULL somehow
Stephan Bosch [Sat, 28 Mar 2026 19:18:15 +0000 (20:18 +0100)] 
lib-auth: auth-scram-server - Assert that hash method never gets to be NULL somehow

Stack-based buffer sizes are based on it a field in the hash method struct. An
assert is easier to debug than a segfault. Also, this makes code consistent with
auth-scram-client.

8 days agolib-auth: auth-scram-client - Check assertions earlier so that no segfault is trigger...
Stephan Bosch [Sat, 28 Mar 2026 19:14:03 +0000 (20:14 +0100)] 
lib-auth: auth-scram-client - Check assertions earlier so that no segfault is triggered instead

Issue found by Coverity (CID: 42292)

9 days agolib-var-expand: Remove pointless assigment in var_expand_program_execute_one_real()
Aki Tuomi [Tue, 31 Mar 2026 10:24:37 +0000 (13:24 +0300)] 
lib-var-expand: Remove pointless assigment in var_expand_program_execute_one_real()

Forgotten from 2b8036fbb90c0c0d716ee419a5595a4328c118be

9 days agodoveadm: Remove CORS headers from OPTIONS reply
Aki Tuomi [Mon, 30 Mar 2026 18:30:45 +0000 (21:30 +0300)] 
doveadm: Remove CORS headers from OPTIONS reply

9 days agolib-program-client: program-client-local - Drop any real root privileges before progr...
Stephan Bosch [Tue, 10 Mar 2026 04:16:52 +0000 (05:16 +0100)] 
lib-program-client: program-client-local - Drop any real root privileges before program execvp()

Running programs with real root privileges while the effective privileges are
user-level is risky and often unexpected.

9 days agoauth: auth_request_validate_client_fp() - Ensure client certificate can be checked
Karl Fleischmann [Fri, 20 Mar 2026 08:48:52 +0000 (09:48 +0100)] 
auth: auth_request_validate_client_fp() - Ensure client certificate can be checked

10 days agolib-sasl: oauth2 - Send configured scope for failure responses
Aki Tuomi [Mon, 16 Mar 2026 11:44:33 +0000 (13:44 +0200)] 
lib-sasl: oauth2 - Send configured scope for failure responses

10 days agoauth: sasl-mech-oauth2 - Add scope to sasl settings for failure responses
Aki Tuomi [Mon, 16 Mar 2026 06:52:49 +0000 (08:52 +0200)] 
auth: sasl-mech-oauth2 - Add scope to sasl settings for failure responses

10 days agoauth: db-oauth2 - Add accessor for space separated list of scopes
Aki Tuomi [Mon, 16 Mar 2026 06:52:06 +0000 (08:52 +0200)] 
auth: db-oauth2 - Add accessor for space separated list of scopes

10 days agolib-sasl: Allow passing scope for failures
Aki Tuomi [Mon, 16 Mar 2026 06:48:54 +0000 (08:48 +0200)] 
lib-sasl: Allow passing scope for failures

11 days agoauth: Use Lua libraries conditionally in test-auth
Aki Tuomi [Fri, 27 Mar 2026 13:04:24 +0000 (15:04 +0200)] 
auth: Use Lua libraries conditionally in test-auth

11 days agom4: want_lua - Check that lualib header exists
Aki Tuomi [Fri, 27 Mar 2026 12:13:45 +0000 (14:13 +0200)] 
m4: want_lua - Check that lualib header exists

13 days agoNEWS: Add news for 2.4.3
Aki Tuomi [Thu, 26 Feb 2026 12:32:23 +0000 (14:32 +0200)] 
NEWS: Add news for 2.4.3

2 weeks agolib-sql: driver-sqlite - Fail with empty query
Aki Tuomi [Thu, 12 Mar 2026 15:14:31 +0000 (17:14 +0200)] 
lib-sql: driver-sqlite - Fail with empty query

By default SQLite happily accepts empty query, so we need to
error out.

2 weeks agoauth: passdb-sql - Require update_query to be set when used
Aki Tuomi [Wed, 11 Mar 2026 10:46:53 +0000 (12:46 +0200)] 
auth: passdb-sql - Require update_query to be set when used

2 weeks agoauth: Initialize set_credentials event properly
Aki Tuomi [Mon, 9 Mar 2026 19:23:29 +0000 (21:23 +0200)] 
auth: Initialize set_credentials event properly

Fixes update_query

2 weeks agoauth: Move passdb event lifecycle handling to auth_request_passdb_event_(begin|end)
Aki Tuomi [Wed, 11 Mar 2026 10:30:32 +0000 (12:30 +0200)] 
auth: Move passdb event lifecycle handling to auth_request_passdb_event_(begin|end)

2 weeks agoauth: cache - Use translated username in auth_cache_remove()
Aki Tuomi [Mon, 9 Mar 2026 18:04:27 +0000 (20:04 +0200)] 
auth: cache - Use translated username in auth_cache_remove()

2 weeks agolib-index: mail_index_try_read_map() - Add assert that header_size is small enough
Timo Sirainen [Thu, 29 Jan 2026 11:34:39 +0000 (13:34 +0200)] 
lib-index: mail_index_try_read_map() - Add assert that header_size is small enough

2 weeks agolib-index: Fix detecting overly large mail_index_header.messages_count
Timo Sirainen [Thu, 29 Jan 2026 11:33:14 +0000 (13:33 +0200)] 
lib-index: Fix detecting overly large mail_index_header.messages_count

The previous check overflowed the integer calculation, which prevented the
check from working correctly.

This commit also removes the unnecessary
mail_index_record_map.mmap_used_size.

2 weeks agodoveadm: client-connection - Get API key from per-connection settings
Aki Tuomi [Wed, 4 Mar 2026 12:39:43 +0000 (14:39 +0200)] 
doveadm: client-connection - Get API key from per-connection settings

2 weeks agodoveadm: Use datastack for temporary b64 value
Aki Tuomi [Wed, 4 Mar 2026 07:28:18 +0000 (09:28 +0200)] 
doveadm: Use datastack for temporary b64 value

There is no need to allocate it from connection pool.

2 weeks agodoveadm: client-connection - Use timing safe credential check
Aki Tuomi [Wed, 4 Mar 2026 06:05:13 +0000 (08:05 +0200)] 
doveadm: client-connection - Use timing safe credential check

2 weeks agoglobal: Use const for struct imap_parser_params params
Timo Sirainen [Mon, 2 Mar 2026 11:50:24 +0000 (13:50 +0200)] 
global: Use const for struct imap_parser_params params

2 weeks agoimap-login: Limit the number of open IMAP parser lists
Timo Sirainen [Fri, 6 Mar 2026 13:35:12 +0000 (15:35 +0200)] 
imap-login: Limit the number of open IMAP parser lists

This prevents attackers from using a large number of '(' in a command to
grow memory usage excessively.

2 weeks agolib-imap: Add imap_parser_params.list_count_limit
Timo Sirainen [Fri, 6 Mar 2026 13:32:29 +0000 (15:32 +0200)] 
lib-imap: Add imap_parser_params.list_count_limit

2 weeks agolib-imap, global: Add params parameter to imap_parser_create()
Timo Sirainen [Fri, 6 Mar 2026 13:25:14 +0000 (15:25 +0200)] 
lib-imap, global: Add params parameter to imap_parser_create()

2 weeks agoauth: userdb sql - Fix escaping for user iteration
Timo Sirainen [Tue, 24 Feb 2026 10:26:46 +0000 (12:26 +0200)] 
auth: userdb sql - Fix escaping for user iteration

This is mostly a non-issue, since userdb iteration doesn't take any
untrusted input.

Broken by ef0c63b690e6ef9fbd53cb815dfab50d1667ba3a

2 weeks agoauth: passdb sql - Fix escaping for set_credentials()
Timo Sirainen [Tue, 24 Feb 2026 10:24:37 +0000 (12:24 +0200)] 
auth: passdb sql - Fix escaping for set_credentials()

This was only used by OTP SASL mechanism after successful authentication, so
it practically couldn't be used for SQL injections.

Broken by ef0c63b690e6ef9fbd53cb815dfab50d1667ba3a

2 weeks agoauth: Rewrite ldap_escape() with a unit test
Timo Sirainen [Mon, 23 Feb 2026 17:54:40 +0000 (19:54 +0200)] 
auth: Rewrite ldap_escape() with a unit test

2 weeks agoauth: test-auth - Run Lua unit tests even when building Lua as plugin
Timo Sirainen [Mon, 23 Feb 2026 17:33:16 +0000 (19:33 +0200)] 
auth: test-auth - Run Lua unit tests even when building Lua as plugin

2 weeks agolib-settings: settings_get_params() - Fix using provided escape_func
Timo Sirainen [Mon, 23 Feb 2026 11:37:09 +0000 (13:37 +0200)] 
lib-settings: settings_get_params() - Fix using provided escape_func

This fixes auth-sql and auth-ldap to actually do escaping.

2 weeks agoauth: passdb/userdb ldap - Fix escaping ldap filter, base and bind_userdn
Timo Sirainen [Fri, 20 Feb 2026 16:37:38 +0000 (18:37 +0200)] 
auth: passdb/userdb ldap - Fix escaping ldap filter, base and bind_userdn

Broken by c2ccdab8d09dec65753ee42366f48d53d7f47cfd

2 weeks agoauth: Make struct settings_get_params params const
Timo Sirainen [Wed, 25 Feb 2026 07:33:25 +0000 (09:33 +0200)] 
auth: Make struct settings_get_params params const

2 weeks agolib-mail: Limit the number of RFC2231 parameters that can be parsed
Timo Sirainen [Tue, 24 Feb 2026 11:11:14 +0000 (13:11 +0200)] 
lib-mail: Limit the number of RFC2231 parameters that can be parsed

This avoids excessive CPU usage especially in result_append().

2 weeks agofts: Remove decode2text.sh
Aki Tuomi [Thu, 8 Jan 2026 06:51:59 +0000 (08:51 +0200)] 
fts: Remove decode2text.sh

The script is flawed and not fit for production use, should
recommend writing your own script, or using Apache Tika.

2 weeks agoauth: Don't disconnect auth client when invalid base64 SASL input is received
Timo Sirainen [Tue, 4 Nov 2025 09:34:30 +0000 (11:34 +0200)] 
auth: Don't disconnect auth client when invalid base64 SASL input is received

The base64 input comes from untrusted client. It shouldn't cause the auth
client to disconnect, which causes other concurrent logins to be aborted.

Broken by 1486c30e191ff079bfa78e7950173bb33d8073d9

2 weeks agoimap: test-imap-client-hibernate - Shorten test directory path
Timo Sirainen [Wed, 25 Mar 2026 15:33:28 +0000 (17:33 +0200)] 
imap: test-imap-client-hibernate - Shorten test directory path

Helps to avoid errors:
net_listen_unix(.../imap-hibernate) failed: File name too long

2 weeks agolib-storage: mail-storage - Avoid checking new mailbox name for forbidden characters...
Stephan Bosch [Wed, 25 Mar 2026 20:56:24 +0000 (21:56 +0100)] 
lib-storage: mail-storage - Avoid checking new mailbox name for forbidden characters for implicit NFC rename

Since NFC normalization does not change a text to suddenly contain characters
that are forbidden in a mailbox name, the original mailbox name already
contained the forbidden characters. There is no point in forbidding the
characters in the implicit rename.

2 weeks agolib-dcrypt: Use clean version of cryptographic pools
Karl Fleischmann [Tue, 24 Mar 2026 08:32:27 +0000 (09:32 +0100)] 
lib-dcrypt: Use clean version of cryptographic pools

Ensure blocks are safely cleaned on destruction.

2 weeks agoauth: Use unique directory for base_dir for unit tests
Aki Tuomi [Mon, 23 Mar 2026 19:31:59 +0000 (21:31 +0200)] 
auth: Use unique directory for base_dir for unit tests

Otherwise auth-token-secret.dat might get clobbered by other
tests when running in parallel.

2 weeks agoauth: test-auth-cache - Fix error matching on older distros
Aki Tuomi [Mon, 23 Mar 2026 13:51:05 +0000 (15:51 +0200)] 
auth: test-auth-cache - Fix error matching on older distros

2 weeks agolib-var-expand: Change var_expand_parameter_value to struct
Aki Tuomi [Mon, 23 Mar 2026 10:10:30 +0000 (12:10 +0200)] 
lib-var-expand: Change var_expand_parameter_value to struct

2 weeks agolib-var-expand: Limit padding in hex and hexlify to 256 bytes
Aki Tuomi [Sun, 22 Mar 2026 20:08:01 +0000 (22:08 +0200)] 
lib-var-expand: Limit padding in hex and hexlify to 256 bytes

2 weeks agolib-var-expand: Add fuzz-var-expand-import
Aki Tuomi [Sun, 22 Mar 2026 20:06:34 +0000 (22:06 +0200)] 
lib-var-expand: Add fuzz-var-expand-import