]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
16 months agolib-settings: Lookup override setting keys only once
Timo Sirainen [Sun, 28 May 2023 20:09:55 +0000 (23:09 +0300)] 
lib-settings: Lookup override setting keys only once

After the key is found, remember its index so it can be directly used.

16 months agoconfig: Use setting_parser_info_get_define_count()
Timo Sirainen [Tue, 30 May 2023 15:15:49 +0000 (18:15 +0300)] 
config: Use setting_parser_info_get_define_count()

16 months agolib-settings: Add setting_parser_info_get_define_count()
Timo Sirainen [Tue, 30 May 2023 15:14:02 +0000 (18:14 +0300)] 
lib-settings: Add setting_parser_info_get_define_count()

16 months agolib-settings: If we already found out setting doesn't exist, don't try to parse it
Timo Sirainen [Sun, 28 May 2023 20:09:10 +0000 (23:09 +0300)] 
lib-settings: If we already found out setting doesn't exist, don't try to parse it

16 months agolib-settings: Remove unnecessary data stack frames
Timo Sirainen [Sun, 28 May 2023 19:33:33 +0000 (22:33 +0300)] 
lib-settings: Remove unnecessary data stack frames

settings_get_full() already has the only necessary data stack frame.

16 months agolib-settings: Remove unused setting_parser_info.expand_check_func()
Timo Sirainen [Sat, 27 May 2023 22:22:38 +0000 (01:22 +0300)] 
lib-settings: Remove unused setting_parser_info.expand_check_func()

check_func() can now be used instead.

16 months agolib-storage: Avoid using setting_parser_info.expand_check_func()
Timo Sirainen [Sat, 27 May 2023 22:21:28 +0000 (01:21 +0300)] 
lib-storage: Avoid using setting_parser_info.expand_check_func()

It can now be done in check_func().

16 months agolib-storage: Move parse_postmaster_address() earlier
Timo Sirainen [Sat, 27 May 2023 22:20:28 +0000 (01:20 +0300)] 
lib-storage: Move parse_postmaster_address() earlier

16 months agolib-settings: settings_get*() - Call check_func()s only after variable expansion
Timo Sirainen [Sat, 27 May 2023 22:02:24 +0000 (01:02 +0300)] 
lib-settings: settings_get*() - Call check_func()s only after variable expansion

16 months agolib-storage: Set unexpanded_[mail_]location using setting_apply()
Timo Sirainen [Sat, 27 May 2023 20:52:19 +0000 (23:52 +0300)] 
lib-storage: Set unexpanded_[mail_]location using setting_apply()

It's always expected to be called, because config sends also the default
settings.

16 months agolib-settings: Call setting_apply() for default settings
Timo Sirainen [Mon, 5 Jun 2023 08:37:42 +0000 (11:37 +0300)] 
lib-settings: Call setting_apply() for default settings

Otherwise if config process doesn't explicitly send the default setting,
setting_appy() isn't called. Also it won't happen if -O parameter is used
to disable reading configuration. This in turn causes assert-crashes after
following changes that rely on setting_apply() being called.

For now this is called only for strings with variables, since it's the only
thing needed for now, and there's no easy way to convert non-strings into
string in lib-settings. This could be changed later if necessary.

16 months agolib-storage: Don't generate postmaster_address if it's empty
Timo Sirainen [Sat, 27 May 2023 22:15:08 +0000 (01:15 +0300)] 
lib-storage: Don't generate postmaster_address if it's empty

The default postmaster_address is nowadays generated using %variables.
There is no need for the legacy method of generating it in a slightly
different way when its value is empty.

16 months agolib-settings: Add setting_parser_info.settings_apply()
Timo Sirainen [Sat, 27 May 2023 20:23:50 +0000 (23:23 +0300)] 
lib-settings: Add setting_parser_info.settings_apply()

16 months agolib-settings: Split off settings_mmap_apply_key()
Timo Sirainen [Mon, 29 May 2023 20:18:39 +0000 (23:18 +0300)] 
lib-settings: Split off settings_mmap_apply_key()

16 months agolib-settings: Add SETTINGS_EVENT_FILTER_NAME_REQUIRED
Timo Sirainen [Mon, 24 Jul 2023 11:12:12 +0000 (14:12 +0300)] 
lib-settings: Add SETTINGS_EVENT_FILTER_NAME_REQUIRED

16 months agolib-settings: Add struct settings_apply_ctx to pass around parameters
Timo Sirainen [Mon, 29 May 2023 20:02:51 +0000 (23:02 +0300)] 
lib-settings: Add struct settings_apply_ctx to pass around parameters

16 months agolib-settings: Set setting structs' pool field early on
Timo Sirainen [Mon, 29 May 2023 19:18:15 +0000 (22:18 +0300)] 
lib-settings: Set setting structs' pool field early on

16 months agosubmission[-login]: Change submission_backend_capabilities empty value handling
Timo Sirainen [Sun, 4 Jun 2023 19:21:50 +0000 (22:21 +0300)] 
submission[-login]: Change submission_backend_capabilities empty value handling

Empty value (instead of NULL) now means to propagate the backend
capabilities. To disable all capabilities, use "none".

16 months agoimap-urlauth: Change imap_urlauth_stream/submit_user default to ""
Timo Sirainen [Sun, 4 Jun 2023 19:16:48 +0000 (22:16 +0300)] 
imap-urlauth: Change imap_urlauth_stream/submit_user default to ""

There's no reason for it to be NULL. It's just complicating everything.

16 months agoglobal: Use namespace name in log messages instead of prefix
Timo Sirainen [Sun, 4 Jun 2023 19:07:52 +0000 (22:07 +0300)] 
global: Use namespace name in log messages instead of prefix

16 months agolib-storage: Change namespace/alias_for to point to namespace name, not prefix
Timo Sirainen [Sun, 4 Jun 2023 18:50:54 +0000 (21:50 +0300)] 
lib-storage: Change namespace/alias_for to point to namespace name, not prefix

The following changes require the default config to be sent to config
clients, and it doesn't differentiate between NULL and empty string.
Without this change, there would be no way to differentiate between
no alias_for vs. alias_for for prefix="" namespace. Also this makes
more sense anyway now that namespaces are required to have a name.

16 months agoconfig: Execute external hooks only when necessary
Timo Sirainen [Sun, 28 May 2023 19:10:26 +0000 (22:10 +0300)] 
config: Execute external hooks only when necessary

The hooks are used currently just by managesieve-login to get default Sieve
capabilities by running managesieve process. This is necessary only when
running the "config" process. Also do it when running "doveconf" manually.
Do not do it when running e.g. doveadm which executes doveconf to read
configuration.

16 months agolib: Add ARRAY_TYPE(bool)
Timo Sirainen [Sun, 28 May 2023 20:30:01 +0000 (23:30 +0300)] 
lib: Add ARRAY_TYPE(bool)

16 months agolib-storage: Replace mail_attribute_dict with mail_attribute filter
Timo Sirainen [Wed, 19 Apr 2023 21:18:56 +0000 (00:18 +0300)] 
lib-storage: Replace mail_attribute_dict with mail_attribute filter

Replace e.g.:

mail_attribute_dict = proxy::foo

with:

mail_attribute {
  dict_driver = proxy
  dict_proxy_name = foo
}

16 months agolib-mail: Explicitly return -1/1/0 for RFC2231 parameter comparisons
Fred Morcos [Mon, 10 Feb 2025 13:30:58 +0000 (14:30 +0100)] 
lib-mail: Explicitly return -1/1/0 for RFC2231 parameter comparisons

This avoids an out of range cast stemming from casting unsigned values to signed.

16 months agolib-mail: Check message boundary length when we have trailing dashes
Fred Morcos [Mon, 10 Feb 2025 13:29:55 +0000 (14:29 +0100)] 
lib-mail: Check message boundary length when we have trailing dashes

This avoids a subtraction resulting in values < 0 in an unsigned value.

16 months agolib: ostream-file - Unset TCP_NODELAY only when stream is written uncorked
Timo Sirainen [Mon, 21 Oct 2024 06:30:46 +0000 (09:30 +0300)] 
lib: ostream-file - Unset TCP_NODELAY only when stream is written uncorked

The previous behavior was always to set TCP_NODELAY and unset it immediately
when uncorking the stream. But if stream is only written to while it's
corked, this adds unnecessary setsockopt() calls for every uncork.

The current behavior is to unset TCP_NODELAY only if data is written to
ostream while it's not corked.

16 months agofts: Remove explicit handling of filename* parameter
Fred Morcos [Mon, 20 Jan 2025 15:33:36 +0000 (16:33 +0100)] 
fts: Remove explicit handling of filename* parameter

16 months agolib-mail: Add tests for attachment detection
Julien Arnoux [Wed, 3 May 2023 08:43:37 +0000 (10:43 +0200)] 
lib-mail: Add tests for attachment detection

16 months agolib-mail: Add more RFC2231 parser tests
Fred Morcos [Thu, 23 Jan 2025 13:52:26 +0000 (14:52 +0100)] 
lib-mail: Add more RFC2231 parser tests

16 months agolib-mail: Fix & unify RFC2231 parsing behavior
Fred Morcos [Mon, 20 Jan 2025 15:59:42 +0000 (16:59 +0100)] 
lib-mail: Fix & unify RFC2231 parsing behavior

Previously, this parser behaved a bit strangely:

- It parsed key* and key as separate pairs because "extended" keys are being kept in a
different container than classical keys.

- It also kept key*0,*1,*2,etc. pairs in that same separate container of extended keys.

- It treated the entire indexed parameter sequence as NOT rfc2231-parameters when key* and
key*0 were being provided. Meaning it treated key* and key*0,*1,*2 pairs as part of the
same sequence with an error in indexing, while they are in fact separate pairs with a key
naming clash.

This new implementation tries to avoid said pitfalls.

16 months agolib-mail: Fix comment formatting
Fred Morcos [Mon, 16 Dec 2024 12:56:33 +0000 (13:56 +0100)] 
lib-mail: Fix comment formatting

16 months agoglobal: Fix whitespace
Fred Morcos [Fri, 13 Dec 2024 14:57:37 +0000 (15:57 +0100)] 
global: Fix whitespace

16 months ago.gitignore: Ignore valgrind coredump files
Fred Morcos [Mon, 27 Jan 2025 10:51:33 +0000 (11:51 +0100)] 
.gitignore: Ignore valgrind coredump files

16 months ago.clang-tidy: Silence some lints
Fred Morcos [Mon, 6 Jan 2025 13:40:01 +0000 (14:40 +0100)] 
.clang-tidy: Silence some lints

16 months agolib: connection - Make connection_list_deinit(NULL) no-op
Aki Tuomi [Thu, 30 Jan 2025 17:18:40 +0000 (19:18 +0200)] 
lib: connection - Make connection_list_deinit(NULL) no-op

16 months agoconfigure: Default to main if asset version is empty
Aki Tuomi [Tue, 28 Jan 2025 07:36:09 +0000 (09:36 +0200)] 
configure: Default to main if asset version is empty

17 months agolib-auth-client: auth-master - Fix crash if failing to connect to socket
Timo Sirainen [Thu, 16 Jan 2025 13:44:50 +0000 (15:44 +0200)] 
lib-auth-client: auth-master - Fix crash if failing to connect to socket

auth_master_unset_io() would be called twice: once by
auth_master_run_cmd_pre() and again by auth_master_run_cmd_post(), which
attempts to add the idle timeout again.

Fixes:
Panic: file auth-master.c: line 440 (auth_master_unset_io): assertion failed: (conn->to == NULL)

17 months agolib-mail: message_skip_virtual() - Optimize with memchr()
Timo Sirainen [Mon, 13 Jan 2025 14:46:59 +0000 (16:46 +0200)] 
lib-mail: message_skip_virtual() - Optimize with memchr()

17 months agolib-mail: message_skip_virtual() - Fix handling plain CRs in message body
Timo Sirainen [Mon, 13 Jan 2025 13:58:29 +0000 (15:58 +0200)] 
lib-mail: message_skip_virtual() - Fix handling plain CRs in message body

The plain CRs should be handled like any other character, not returning
last_cr_r=TRUE.

This fixes partial IMAP FETCHes where body contains e.g. "\rfoo" and
doing a partial FETCH BODY[TEXT]<1> to skip over the CR.

Fixes errors like:
Deleting corrupted cache record: Broken virtual size in mailbox .. FETCH BODY[]<1> got too little data: 2 vs 3

17 months agodovecot-config: Propagate mail utf-8 presence properly
Aki Tuomi [Wed, 8 Jan 2025 14:12:11 +0000 (16:12 +0200)] 
dovecot-config: Propagate mail utf-8 presence properly

17 months agolib: test-data-stack - Explicitly ignore result from t_malloc_no0() when neeeded
Aki Tuomi [Mon, 30 Dec 2024 05:35:32 +0000 (07:35 +0200)] 
lib: test-data-stack - Explicitly ignore result from t_malloc_no0() when neeeded

Satisfies static analysers

17 months agolib: test-data-stack - Drop bogus assertion
Sam James [Sat, 28 Dec 2024 13:17:24 +0000 (13:17 +0000)] 
lib: test-data-stack - Drop bogus assertion

This assertion goes back to 992a1726a41b42fa47204565ff17f7c635fcb421 when
test-data-stack.c was added.

It starts to fail with (upcoming) GCC 15 which has improvements for
optimising out redundant pointer-vs-pointer comparisons, specifically
r15-580-gf3e5f4c58591f5 for gcc bug PR13962.

Anyway, this is a problem for this assertion because t_malloc_no0
is marked with `__attribute__((malloc))` which guarantees that the
returned pointer doesn't alias, hence a == b must be false.

Bug: https://bugs.gentoo.org/939857

17 months agolib-imap: Fail parsing on impossible imap-dates/times
Timo Sirainen [Sat, 13 May 2023 21:25:20 +0000 (00:25 +0300)] 
lib-imap: Fail parsing on impossible imap-dates/times

For example 32-Jan-2023 was converted into a max-timestamp before instead of
being rejected.

18 months agolib-index: Fix handling indexid change in dovecot.index file
Timo Sirainen [Fri, 13 Dec 2024 10:26:56 +0000 (12:26 +0200)] 
lib-index: Fix handling indexid change in dovecot.index file

Depending on the situation the dovecot.index should be either deleted or
the mailbox reopened.

18 months agolib-index: Split off mail_transaction_log_has_changed()
Timo Sirainen [Fri, 13 Dec 2024 10:26:27 +0000 (12:26 +0200)] 
lib-index: Split off mail_transaction_log_has_changed()

18 months agolib-index: Don't delete dovecot.index.log when finding that indexid changes
Timo Sirainen [Fri, 13 Dec 2024 08:53:16 +0000 (10:53 +0200)] 
lib-index: Don't delete dovecot.index.log when finding that indexid changes

The indexes were recreated, so the new indexes should be used instead of
deleting them.

18 months agolib-storage: Fix duplicate mailbox name detection in list index rebuild
Timo Sirainen [Tue, 17 Dec 2024 08:31:45 +0000 (10:31 +0200)] 
lib-storage: Fix duplicate mailbox name detection in list index rebuild

18 months agolib-storage: Split off mailbox_name_add_random_suffix()
Timo Sirainen [Tue, 17 Dec 2024 08:31:29 +0000 (10:31 +0200)] 
lib-storage: Split off mailbox_name_add_random_suffix()

18 months agolib-index: mail_transaction_log_view_mark() - Fix crash when log view is empty
Timo Sirainen [Sat, 14 Dec 2024 19:20:40 +0000 (21:20 +0200)] 
lib-index: mail_transaction_log_view_mark() - Fix crash when log view is empty

This happened when IMAP NOTIFY was used and syncing was delayed enough for
dovecot.list.index to have become rotated twice and gotten missing
transactions.

18 months agoimap-hibernate: Add local and remote port as variables to mail_log_prefix
Aki Tuomi [Mon, 16 Dec 2024 10:53:23 +0000 (12:53 +0200)] 
imap-hibernate: Add local and remote port as variables to mail_log_prefix

18 months agolib-storage: Add local and remote port as variables to mail_log_prefix
Aki Tuomi [Mon, 16 Dec 2024 10:53:06 +0000 (12:53 +0200)] 
lib-storage: Add local and remote port as variables to mail_log_prefix

18 months agolib-ldap: Rename libldap.la to libdldap.la
Timo Sirainen [Mon, 16 Dec 2024 11:38:10 +0000 (13:38 +0200)] 
lib-ldap: Rename libldap.la to libdldap.la

Using libldap.la caused some strange compiling issues at times.

18 months agolib: Move i_faccessat2() to lib.c
Aki Tuomi [Fri, 29 Dec 2023 13:19:04 +0000 (15:19 +0200)] 
lib: Move i_faccessat2() to lib.c

18 months agoimap: Fix ifdef location
Fred Morcos [Wed, 4 Dec 2024 13:24:41 +0000 (14:24 +0100)] 
imap: Fix ifdef location

18 months agolib,doveadm: Add missing includes
Fred Morcos [Tue, 3 Dec 2024 18:36:30 +0000 (19:36 +0100)] 
lib,doveadm: Add missing includes

18 months agolib: Add NOLINT clang-tidy directives for some helpers
Fred Morcos [Tue, 3 Dec 2024 18:17:00 +0000 (19:17 +0100)] 
lib: Add NOLINT clang-tidy directives for some helpers

18 months agolib-smtp: Remove duplicate function declaration
Aki Tuomi [Fri, 29 Dec 2023 14:09:55 +0000 (16:09 +0200)] 
lib-smtp: Remove duplicate function declaration

18 months agodoveadm: Remove duplicate extern
Aki Tuomi [Fri, 29 Dec 2023 14:09:44 +0000 (16:09 +0200)] 
doveadm: Remove duplicate extern

18 months agolib-fs,lib-storage: Fix posix_fadvise usage
Aki Tuomi [Fri, 29 Dec 2023 14:05:27 +0000 (16:05 +0200)] 
lib-fs,lib-storage: Fix posix_fadvise usage

Return value is non-zero on error, not negative.

18 months agoauth: Remove duplicate extern
Aki Tuomi [Fri, 29 Dec 2023 13:20:48 +0000 (15:20 +0200)] 
auth: Remove duplicate extern

18 months agoauth: auth-cache - Remove duplicate include
Aki Tuomi [Fri, 29 Dec 2023 13:20:27 +0000 (15:20 +0200)] 
auth: auth-cache - Remove duplicate include

18 months agolib: time-util - Fix implicit casts
Aki Tuomi [Fri, 29 Dec 2023 13:20:06 +0000 (15:20 +0200)] 
lib: time-util - Fix implicit casts

18 months agolib-index: Remove duplicate function declaration
Aki Tuomi [Fri, 29 Dec 2023 13:19:52 +0000 (15:19 +0200)] 
lib-index: Remove duplicate function declaration

18 months agoglobal: Add NOLINT for noisy macros
Aki Tuomi [Fri, 29 Dec 2023 10:52:48 +0000 (12:52 +0200)] 
global: Add NOLINT for noisy macros

Remove warnings with clang-tidy

18 months agoglobal: Fix whitespace -> tabs
Fred Morcos [Mon, 2 Dec 2024 07:05:29 +0000 (08:05 +0100)] 
global: Fix whitespace -> tabs

18 months agoglobal: Add clangd config file
Fred Morcos [Thu, 12 Dec 2024 11:13:54 +0000 (12:13 +0100)] 
global: Add clangd config file

18 months agoglobal: Add clang-tidy config file
Aki Tuomi [Tue, 12 Nov 2024 08:27:19 +0000 (10:27 +0200)] 
global: Add clang-tidy config file

18 months agoglobal: Add clang-format config file
Fred Morcos [Mon, 2 Dec 2024 07:04:10 +0000 (08:04 +0100)] 
global: Add clang-format config file

18 months agogitignore: Ignore clangd and emacs directories
Aki Tuomi [Tue, 12 Nov 2024 08:29:09 +0000 (10:29 +0200)] 
gitignore: Ignore clangd and emacs directories

18 months agoglobal: Add dovecot-style editor config
Aki Tuomi [Tue, 12 Nov 2024 08:18:12 +0000 (10:18 +0200)] 
global: Add dovecot-style editor config

18 months agoconfigure: Replace "if" with AS_IF
Timo Sirainen [Wed, 11 Dec 2024 12:37:18 +0000 (14:37 +0200)] 
configure: Replace "if" with AS_IF

18 months agoconfigure: Fix config version checks for x.y versioning (without .z)
Timo Sirainen [Wed, 11 Dec 2024 08:42:27 +0000 (10:42 +0200)] 
configure: Fix config version checks for x.y versioning (without .z)

18 months agolib-smtp: smtp-command-parser - Explicitly disallow 8-bit characters for AUTH response
Stephan Bosch [Tue, 10 Dec 2024 14:45:12 +0000 (15:45 +0100)] 
lib-smtp: smtp-command-parser - Explicitly disallow 8-bit characters for AUTH response

Later Base64 parsing would catch that, but command parser errors become clearer
when this is caught early. Also, this fixes a unit test failure when
experimental SMTPUTF8 support is enabled.

When SMTPUTF8 support is disabled, smtp_char_is_textstr() disallows 8-bit
implicitly, but when SMTPUTF8 is enabled 8-bit octets will be let through.
This caused the invalidity unit test to fail.

18 months agolib-smtp: test-smtp-command-parser - Fail invalidity tests properly in case of valid...
Stephan Bosch [Tue, 10 Dec 2024 14:35:16 +0000 (15:35 +0100)] 
lib-smtp: test-smtp-command-parser - Fail invalidity tests properly in case of valid result

18 months agolib-smtp: test-smtp-command-parser - Properly test bad parameter characters vs. missi...
Stephan Bosch [Tue, 10 Dec 2024 13:59:13 +0000 (14:59 +0100)] 
lib-smtp: test-smtp-command-parser - Properly test bad parameter characters vs. missing EOL

18 months agolib-smtp: test-smtp-address - Vary tests based on SMTPUTF8 support
Aki Tuomi [Thu, 5 Dec 2024 08:04:39 +0000 (10:04 +0200)] 
lib-smtp: test-smtp-address - Vary tests based on SMTPUTF8 support

18 months agolib-sql: cassandra - Add data stack frame
Timo Sirainen [Thu, 5 Dec 2024 08:45:11 +0000 (10:45 +0200)] 
lib-sql: cassandra - Add data stack frame

18 months agolib-fs: Add fs_get_root_fs()
Timo Sirainen [Wed, 4 Dec 2024 11:51:47 +0000 (13:51 +0200)] 
lib-fs: Add fs_get_root_fs()

18 months agodoveadm auth: Fix potential crash when auth is aborted with a signal
Timo Sirainen [Thu, 5 Dec 2024 18:23:28 +0000 (20:23 +0200)] 
doveadm auth: Fix potential crash when auth is aborted with a signal

18 months agodict-ldap: Avoid linking to a dovecot-ldap shared library
Timo Sirainen [Mon, 2 Dec 2024 10:11:48 +0000 (12:11 +0200)] 
dict-ldap: Avoid linking to a dovecot-ldap shared library

The dict-ldap itself is the plugin, which is dynamically loaded.
There's no need for dovecot-ldap shared library to be used. This
changes the lib-ldap linking behavior to same as lib-sql.

18 months agolib-dns: dnc_client_lookup*() - Add data stack frames
Timo Sirainen [Mon, 2 Dec 2024 22:11:41 +0000 (00:11 +0200)] 
lib-dns: dnc_client_lookup*() - Add data stack frames

18 months agodoveadm: Use a separate memory pool for parsing doveadm command line parameters
Timo Sirainen [Mon, 2 Dec 2024 22:10:06 +0000 (00:10 +0200)] 
doveadm: Use a separate memory pool for parsing doveadm command line parameters

This avoids spending a lot of the data stack for the actual command
processing, causing them to grow the data stack.

18 months agodoc: Replace html documentation with redirect to documentation
Aki Tuomi [Fri, 29 Nov 2024 10:41:06 +0000 (12:41 +0200)] 
doc: Replace html documentation with redirect to documentation

18 months agoNEWS: Add news for 2.3.21.1
Aki Tuomi [Thu, 8 Aug 2024 12:13:19 +0000 (15:13 +0300)] 
NEWS: Add news for 2.3.21.1

18 months agolib-http: Add http_client_request_retrieve_headers()
Vincent Kenbeek [Thu, 10 Oct 2024 09:38:56 +0000 (11:38 +0200)] 
lib-http: Add http_client_request_retrieve_headers()

18 months agolib-sql: Link test binaries to libdovecot.la
Aki Tuomi [Thu, 28 Nov 2024 07:33:05 +0000 (09:33 +0200)] 
lib-sql: Link test binaries to libdovecot.la

Otherwise it tries to use installed one, if available.

18 months agoconfigure: Use $SED and $GREP to make sure we get correct tools
Aki Tuomi [Thu, 28 Nov 2024 07:14:48 +0000 (09:14 +0200)] 
configure: Use $SED and $GREP to make sure we get correct tools

18 months agoimap: Don't try to hibernate if it's not enabled
Aki Tuomi [Thu, 28 Nov 2024 07:53:22 +0000 (09:53 +0200)] 
imap: Don't try to hibernate if it's not enabled

18 months agoimap-hibernate: If not enabled, do not include in settings either
Kirill A. Korinsky [Thu, 26 Sep 2024 20:08:47 +0000 (22:08 +0200)] 
imap-hibernate: If not enabled, do not include in settings either

18 months agonet: net_connect_ip*() - Handle OpenBSD errors similarly to FreeBSD
Kirill A. Korinsky [Sun, 13 Oct 2024 09:07:00 +0000 (11:07 +0200)] 
net: net_connect_ip*() - Handle OpenBSD errors similarly to FreeBSD

18 months agoauth: Replace random() with proper i_rand_minmax()
Aki Tuomi [Wed, 27 Nov 2024 07:04:36 +0000 (09:04 +0200)] 
auth: Replace random() with proper i_rand_minmax()

18 months agodsync: Use correct format for time_t in dsync_brain_recv_mailbox_tree_deletes()
Aki Tuomi [Wed, 27 Nov 2024 07:04:22 +0000 (09:04 +0200)] 
dsync: Use correct format for time_t in dsync_brain_recv_mailbox_tree_deletes()

18 months agoconfigure: Split grep into multiple -e expressions
Aki Tuomi [Tue, 26 Nov 2024 20:44:35 +0000 (22:44 +0200)] 
configure: Split grep into multiple -e expressions

This is more portable.

18 months agolib-ssl-iostream,lib-dcrypt: Raise minimum OpenSSL compatibility level to 1.1.1
Aki Tuomi [Tue, 26 Nov 2024 12:32:08 +0000 (14:32 +0200)] 
lib-ssl-iostream,lib-dcrypt: Raise minimum OpenSSL compatibility level to 1.1.1

But retain compatibility with LibreSSL.

18 months agolib: mkdir_parents() - Avoid unnecessary syscalls when uid/gid doesn't change
Timo Sirainen [Tue, 26 Nov 2024 20:35:02 +0000 (22:35 +0200)] 
lib: mkdir_parents() - Avoid unnecessary syscalls when uid/gid doesn't change

There's no need to open() + fchown() the directory after mkdir(), if neither
uid nor gid changes.

18 months agolib-settings: Fix variable type mismatches
Timo Sirainen [Tue, 26 Nov 2024 14:57:01 +0000 (16:57 +0200)] 
lib-settings: Fix variable type mismatches

Just use size_t everywhere since it points to mmap()ed memory.

19 months agoauth: Fix userdb auth cache with username changes
Timo Sirainen [Thu, 21 Nov 2024 10:23:46 +0000 (12:23 +0200)] 
auth: Fix userdb auth cache with username changes

The problem was for example when userdb lookup uses only the username part
of the username@domain lookup. Then:

 * "username" lookup caches the results for "username". Since the username
   didn't change, it doesn't store in the cache the "user" field.
 * "username@domain" lookup looks up "username" from cache. Since there is
   no "user" field, the code didn't think the username had changed.

Fix this by saving the "user" field to auth cache, regardless of whether
it's the same as the current username.

19 months agomdbox: Fix crash if resync fails because of an early failure
Timo Sirainen [Wed, 20 Nov 2024 13:16:00 +0000 (15:16 +0200)] 
mdbox: Fix crash if resync fails because of an early failure

This mainly happened if dovecot.map.index.log was locked and resync timed
out waiting for it.

19 months agolib-lua: test-lua-http-client - Prevent HTTP client context from traversing fork
Stephan Bosch [Tue, 19 Nov 2024 22:21:54 +0000 (23:21 +0100)] 
lib-lua: test-lua-http-client - Prevent HTTP client context from traversing fork

The children will start fighting over the connection FDs and the test will
panic out:

DNS: Panic: epoll_ctl(mod, 8) failed: No such file or directory
CLIENT: Panic: epoll_ctl(mod, 8) failed: No such file or directory

This happens very infrequently.