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