Stephan Bosch [Thu, 27 Nov 2025 23:47:02 +0000 (00:47 +0100)]
submisssion-login: Fix segfault occuring at proxy AUTH upon relay connection failure
Fixed by halting server input once proxy authentication succeeds. This prevents
race conditions between input from proxy server and command output, which causes
a segfault when the current server command is already cleared when more input
(beyond AUTH success) from the proxy server comes in.
With earlier code one of ctx->username, finished or failed was guaranteed to
be set. With the new auth_master_request_wait() code this is no longer true.
It's unclear when exactly this happens or how to reproduce, but the fixed code
makes sure it doesn't, or at least assert-crashes if it still does.
Timo Sirainen [Wed, 3 Dec 2025 14:00:08 +0000 (16:00 +0200)]
login-common: Use login_binary.service_name for anvil lookups
This fixes mail_max_userip_connections to work with managesieve. It was
previously using "sieve" to do the lookup, while actually using
"managesieve" for registering itself to anvil. Now the lookup will also
use "managesieve".
Timo Sirainen [Wed, 3 Dec 2025 10:06:42 +0000 (12:06 +0200)]
login-common, *-login: Add proxy_dest_connection_limit error_code to proxy_session_finished
If IMAP backend returns with [LIMIT] or POP3 backend returns with [IN-USE],
use this error code rather than the generic proxy_dest_auth_failed.
Error messages are also updated.
Timo Sirainen [Wed, 3 Dec 2025 09:43:19 +0000 (11:43 +0200)]
pop3-login: If mail_max_userip_connections is reached, reply to login with [IN-USE] prefix
The [IN-USE] indicates that the mailbox is locked for servers that allow
only a single POP3 client at a time. This is similar to rejecting login
due to too many concurrent logins.
Timo Sirainen [Wed, 3 Dec 2025 09:25:45 +0000 (11:25 +0200)]
login-common: If proxy fails, log the reason in the "Login aborted" log line
It was already logged separately in proxy's "Login failed" line, but having
the reason in the "Login aborted" line as well avoids having to match log
lines to find the reason.
Timo Sirainen [Wed, 3 Dec 2025 09:11:00 +0000 (11:11 +0200)]
lib-login: Don't reset process title after successful login
The login_server_conn_unref() function was unconditionally calling
login_server_proctitle_refresh(), which would reset the process title
to "[idling]". This happened even after a successful login, overwriting
the process title set by the service (e.g., imap, pop3).
Timo Sirainen [Mon, 24 Nov 2025 08:30:12 +0000 (10:30 +0200)]
lib: connection API - Add assert to make sure input is not NULL
Some code, such as http_client_connection_start_tunnel(), can explicitly set
input/output to NULL to detach from the connection. However, they shouldn't
do it with client_connect_succeeded=FALSE stage.
Timo Sirainen [Tue, 2 Dec 2025 11:11:20 +0000 (13:11 +0200)]
doveadm: Flush print output after processing each user
Otherwise when processing many users, the print output wouldn't be flushed
until enough output had been written. If there wasn't much written, it
could have taken a long time to see anything printed.
Timo Sirainen [Mon, 1 Dec 2025 16:18:27 +0000 (18:18 +0200)]
lib: connection API - Always have iostreams available
Set iostreams immediately when connection is initialized, and unset them
only at connection_deinit(). client_disconnect() only closes the iostreams.
This way it's safe to always access connection's iostreams without having to
check whether they are NULL.
This fixes at least a crash in auth process's pass_callback_finish()
where output is tried to be written to auth-master client connection,
which has already disconnected.
Aki Tuomi [Wed, 19 Nov 2025 10:10:27 +0000 (12:10 +0200)]
lib-dovecot: Make it possible to do semistatic libdovecot.so
This can be now done with setting
- ZLIB_LIBS_STATIC to libz.a location
- LIBPCRE_LIBS_STATIC to libpcre2-32.a location
- SSL_LIBS to both libssl.a and libcrypto.a location
Timo Sirainen [Thu, 6 Nov 2025 12:20:05 +0000 (14:20 +0200)]
auth: Fix auth caching to work with passdb_ldap_bind_userdn
passdb_ldap_bind_userdn wasn't part of the cache key, so:
* If no %variables were given in ldap_base or passdb_ldap_filter, startup
failed with "Cache key must contain at least one variable"
* If the same %variables were part of ldap_base or passdb_ldap_filter,
it worked correctly.
* If different %variables were part of ldap_base or passdb_ldap_filter,
cached lookups may have returned wrong results.