]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
6 months agolib-settings, config: Prepare "strlist" code/comments to be more generic "list"
Timo Sirainen [Wed, 7 Jun 2023 08:31:54 +0000 (11:31 +0300)] 
lib-settings, config: Prepare "strlist" code/comments to be more generic "list"

6 months agoconfig: Support parsing "quoted key"
Timo Sirainen [Wed, 7 Jun 2023 08:27:29 +0000 (11:27 +0300)] 
config: Support parsing "quoted key"

This will be needed for the boolean-list setting type.

6 months agoconfig: Apply setting_parser_info.default_settings to default config
Timo Sirainen [Wed, 7 Jun 2023 08:23:04 +0000 (11:23 +0300)] 
config: Apply setting_parser_info.default_settings to default config

6 months agolib-ssl-iostream: Don't try to load ssl_iostream_openssl module twice
Timo Sirainen [Wed, 7 Jun 2023 09:35:59 +0000 (12:35 +0300)] 
lib-ssl-iostream: Don't try to load ssl_iostream_openssl module twice

Error handling was also not working as expected, because the first load
attempt already called i_fatal()

Forgotten in fe4058e6f01bf0e104c44815b6df7cfefb80634c

6 months agoglobal: Remove support for building without support for modules
Timo Sirainen [Wed, 7 Jun 2023 08:55:29 +0000 (11:55 +0300)] 
global: Remove support for building without support for modules

dlopen() must be supported now.

6 months agoglobal: Remove remaining traces of userdb nss
Timo Sirainen [Wed, 7 Jun 2023 08:54:29 +0000 (11:54 +0300)] 
global: Remove remaining traces of userdb nss

Forgotten in e1abe6d11a9e63995a7e0ff40261973ebc17ad37

6 months agoconfig: Panic if a string type setting has NULL as default
Timo Sirainen [Wed, 7 Jun 2023 10:58:48 +0000 (13:58 +0300)] 
config: Panic if a string type setting has NULL as default

6 months agomaster: Change *_listener_settings.type default to "" instead of NULL
Timo Sirainen [Wed, 7 Jun 2023 10:58:11 +0000 (13:58 +0300)] 
master: Change *_listener_settings.type default to "" instead of NULL

6 months agoconfig: config_all_parsers_check() - Add data stack frame
Timo Sirainen [Mon, 5 Jun 2023 20:32:01 +0000 (23:32 +0300)] 
config: config_all_parsers_check() - Add data stack frame

6 months agoglobal: Use SET_VALUE_INFINITE for infinite idle_time
Timo Sirainen [Sun, 4 Jun 2023 22:16:43 +0000 (01:16 +0300)] 
global: Use SET_VALUE_INFINITE for infinite idle_time

6 months agolib-settings, config: Add "unlimited" value for uint/size and "infinite" for time...
Timo Sirainen [Sun, 4 Jun 2023 21:48:57 +0000 (00:48 +0300)] 
lib-settings, config: Add "unlimited" value for uint/size and "infinite" for time/time_msecs

This is converted to the maximum size of the number.

6 months agomaster: Remove default_* numeric service settings
Timo Sirainen [Sun, 4 Jun 2023 22:13:37 +0000 (01:13 +0300)] 
master: Remove default_* numeric service settings

The global service_* settings are used instead.

The default_internal_user, default_internal_group and default_login_user
settigs are kept for now, since they're used as variables for listeners.

6 months agoglobal: Remove default service settings from structs
Timo Sirainen [Sun, 4 Jun 2023 22:12:31 +0000 (01:12 +0300)] 
global: Remove default service settings from structs

6 months agoconfig: Don't add numeric default service settings that are 0
Timo Sirainen [Sun, 4 Jun 2023 22:07:07 +0000 (01:07 +0300)] 
config: Don't add numeric default service settings that are 0

This will allow using glboal service_* settings when they're not
explicitly overridden by service { .. } settings.

6 months agoimap: Fix sending unexpanded mail_log_prefix to imap-hibernate
Timo Sirainen [Sun, 4 Jun 2023 20:59:46 +0000 (23:59 +0300)] 
imap: Fix sending unexpanded mail_log_prefix to imap-hibernate

imap-hibernate is supposed to expand it itself, otherwise at least %{pid}
contains the old imap process's pid rather than imap-hibernate's.

Broken by recent changes.

6 months agolib-settings: Remove unnecessary includes and macro
Timo Sirainen [Fri, 2 Jun 2023 20:03:24 +0000 (23:03 +0300)] 
lib-settings: Remove unnecessary includes and macro

6 months agolib-settings: Remove unused settings_parser_dup()
Timo Sirainen [Fri, 2 Jun 2023 20:02:17 +0000 (23:02 +0300)] 
lib-settings: Remove unused settings_parser_dup()

6 months agolib-settings: Remove setting change tracking
Timo Sirainen [Fri, 2 Jun 2023 20:01:01 +0000 (23:01 +0300)] 
lib-settings: Remove setting change tracking

It was used only by config process, which now does it internally.

6 months agolib-settings: Remove SETTING_DEFINE_STRUCT_STR_VARS*() macros
Timo Sirainen [Thu, 1 Jun 2023 21:47:01 +0000 (00:47 +0300)] 
lib-settings: Remove SETTING_DEFINE_STRUCT_STR_VARS*() macros

6 months agoglobal: Replace all STR_VARS settings with STR
Timo Sirainen [Thu, 1 Jun 2023 21:36:13 +0000 (00:36 +0300)] 
global: Replace all STR_VARS settings with STR

6 months agolib: Remove [CONST_]STRUCT_MEMBER_P() macros
Timo Sirainen [Wed, 31 May 2023 21:42:52 +0000 (00:42 +0300)] 
lib: Remove [CONST_]STRUCT_MEMBER_P() macros

Use [CONST_]PTR_OFFSET() instead.

6 months agoglobal: Replace STRUCT_MEMBER_P() with PTR_OFFSET()
Timo Sirainen [Wed, 31 May 2023 21:42:15 +0000 (00:42 +0300)] 
global: Replace STRUCT_MEMBER_P() with PTR_OFFSET()

These macros do the same thing.

6 months agolib-settings, config: Support %variables for all setting types
Timo Sirainen [Wed, 31 May 2023 00:42:16 +0000 (03:42 +0300)] 
lib-settings, config: Support %variables for all setting types

6 months agoconfig: Remove config_module_parser.parser
Timo Sirainen [Wed, 31 May 2023 00:36:30 +0000 (03:36 +0300)] 
config: Remove config_module_parser.parser

6 months agoconfig: test-config-parser - Change to work without config_module_parser.parser
Timo Sirainen [Wed, 31 May 2023 00:19:04 +0000 (03:19 +0300)] 
config: test-config-parser - Change to work without config_module_parser.parser

6 months agoconfig: Build a new setting_parser_context when checking settings
Timo Sirainen [Wed, 31 May 2023 00:07:18 +0000 (03:07 +0300)] 
config: Build a new setting_parser_context when checking settings

6 months agoconfig: config_export_type() - Remove unnecessary parameters
Timo Sirainen [Tue, 30 May 2023 23:38:37 +0000 (02:38 +0300)] 
config: config_export_type() - Remove unnecessary parameters

6 months agoconfig: Export settings without setting_parser_context
Timo Sirainen [Tue, 30 May 2023 22:33:46 +0000 (01:33 +0300)] 
config: Export settings without setting_parser_context

6 months agoconfig: Change setting lookup functions to work without setting_parser_context
Timo Sirainen [Tue, 30 May 2023 21:52:38 +0000 (00:52 +0300)] 
config: Change setting lookup functions to work without setting_parser_context

6 months agoconfig: Expand $setting without setting_parser_context
Timo Sirainen [Tue, 30 May 2023 21:48:49 +0000 (00:48 +0300)] 
config: Expand $setting without setting_parser_context

6 months agoconfig: Track settings in config_module_parser independently of setting_parser_context
Timo Sirainen [Tue, 30 May 2023 21:46:09 +0000 (00:46 +0300)] 
config: Track settings in config_module_parser independently of setting_parser_context

6 months agolib-settings: Replace SETTINGS_EVENT_FILTER_NAME_REQUIRED with settings_try_get()
Timo Sirainen [Tue, 1 Aug 2023 11:29:03 +0000 (14:29 +0300)] 
lib-settings: Replace SETTINGS_EVENT_FILTER_NAME_REQUIRED with settings_try_get()

6 months agolib-settings: Support multiple filter names with strlist
Timo Sirainen [Tue, 1 Aug 2023 11:17:45 +0000 (14:17 +0300)] 
lib-settings: Support multiple filter names with strlist

6 months agolib-settings: Redesign settings override handling
Timo Sirainen [Thu, 8 Jun 2023 00:00:21 +0000 (03:00 +0300)] 
lib-settings: Redesign settings override handling

The previous method had too many assumptions that weren't always correct,
e.g. overriding strlist entries didn't work correctly.

6 months agolib-settings: Split off settings_key_part_find()
Timo Sirainen [Wed, 7 Jun 2023 23:57:40 +0000 (02:57 +0300)] 
lib-settings: Split off settings_key_part_find()

6 months agolib-settings, config: Replace SET_STR to be use %variables
Timo Sirainen [Fri, 26 May 2023 10:44:50 +0000 (13:44 +0300)] 
lib-settings, config: Replace SET_STR to be use %variables

This removes the SET_STR_VARS type, but leaves some macros.

6 months agolib, global: event_filter_merge*() - Support merging also with AND operator
Timo Sirainen [Wed, 7 Jun 2023 21:15:05 +0000 (00:15 +0300)] 
lib, global: event_filter_merge*() - Support merging also with AND operator

6 months agoglobal: Use SET_STR_NOVARS for settings that shouldn't be expanded by config
Timo Sirainen [Fri, 26 May 2023 10:41:30 +0000 (13:41 +0300)] 
global: Use SET_STR_NOVARS for settings that shouldn't be expanded by config

These settings are mostly expanded with explicit var_expand*() calls.
There are also two special cases:
 * log_timestamp - expansion happens with strftime()
 * listen & inet_listener { address } - These have trouble with %scope, so
   at least for now variables are completely disabled for them.

6 months agolib-settings: Add SET_STR_NOVARS type
Timo Sirainen [Fri, 26 May 2023 10:37:42 +0000 (13:37 +0300)] 
lib-settings: Add SET_STR_NOVARS type

This is in preparation for making SET_STR_VARS the default string type,
except for a few problematic cases.

6 months agolib-settings, global: Remove SETTING_STRVAR_* prefix from variable strings
Timo Sirainen [Sun, 28 May 2023 21:06:24 +0000 (00:06 +0300)] 
lib-settings, global: Remove SETTING_STRVAR_* prefix from variable strings

6 months agolib-storage: Track unexpanded_[mail_]location overrides without the use of SETTING_ST...
Timo Sirainen [Sun, 28 May 2023 21:02:21 +0000 (00:02 +0300)] 
lib-storage: Track unexpanded_[mail_]location overrides without the use of SETTING_STRVAR_* prefix

This is in preparation for removing the prefix.

6 months agolib-settings: Remove unused settings_var_expand*()
Timo Sirainen [Sun, 28 May 2023 20:48:23 +0000 (23:48 +0300)] 
lib-settings: Remove unused settings_var_expand*()

6 months agolib-settings: Expand variables without the use of SETTING_STRVAR_* prefix
Timo Sirainen [Sun, 28 May 2023 20:30:33 +0000 (23:30 +0300)] 
lib-settings: Expand variables without the use of SETTING_STRVAR_* prefix

This is in preparation for removing the prefix.

6 months agolib-settings: Apply settings in reverse order of filter specificity
Timo Sirainen [Mon, 29 May 2023 21:02:11 +0000 (00:02 +0300)] 
lib-settings: Apply settings in reverse order of filter specificity

Instead of going from least specific filter to most specific, do it in
reverse. This is going to help with variable expansions in a following
commit.

6 months agolib-settings: Move struct settings_mmap_pool earlier
Timo Sirainen [Mon, 29 May 2023 20:30:34 +0000 (23:30 +0300)] 
lib-settings: Move struct settings_mmap_pool earlier

6 months agolib-settings: settings_override_get_value() - Unalias the returned key
Timo Sirainen [Sun, 4 Jun 2023 21:19:30 +0000 (00:19 +0300)] 
lib-settings: settings_override_get_value() - Unalias the returned key

6 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.

6 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()

6 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()

6 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

6 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.

6 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.

6 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().

6 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

6 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

6 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.

6 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.

6 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.

6 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()

6 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()

6 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

6 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

6 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

6 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".

6 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.

6 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

6 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.

6 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.

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

6 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
}

6 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.

6 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.

6 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.

6 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

6 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

6 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

6 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.

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

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

6 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

6 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

6 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

6 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

7 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)

7 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()

7 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

7 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

7 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

7 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

7 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.

8 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.

8 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()

8 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.

8 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

8 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()

8 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.

8 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

8 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

8 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.

8 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