Timo Sirainen [Thu, 13 Jan 2022 15:32:09 +0000 (17:32 +0200)]
lib-master: Add admin-client API
The admin-clients are automatically created for %{pid} socket listeners.
They are not reported to master process as being actual connections to
the process, or counted towards service_count.
Timo Sirainen [Sat, 14 Nov 2020 18:13:06 +0000 (20:13 +0200)]
master: Move error logging from service_*_listener_listen() to parent function
This is in preparation for the following changes. It would have been
enough actually to just do this for service_unix_listener_listen(), but
it's nicer this way for consistency.
Timo Sirainen [Tue, 1 Feb 2022 13:57:16 +0000 (14:57 +0100)]
lmtp: proxy - Add per-connection counter to session_id
This way connections to two different backends don't try to use the same
session_id. Add 'P' letter before the counter to clarify that it's the
proxy connection counter.
Timo Sirainen [Tue, 1 Feb 2022 13:40:48 +0000 (14:40 +0100)]
lmtp: Simplify/clarify per-recipient session ID
The session ID is the transaction ID followed by an increasing recipient
count (number of RCPT commands) in the SMTP transaction. Clarify this by
adding 'R' letter before the counter. Also don't add the counter suffix at
all for the first recipient, since most transactions only have a single
recipient.
Timo Sirainen [Tue, 1 Feb 2022 13:35:05 +0000 (14:35 +0100)]
lib-smtp: server-transaction - Simplify/clarify transaction ID
The transaction ID is the session ID followed by an increasing transaction
count (number of MAIL commands) in the SMTP server connection. Clarify
this by adding 'T' letter before the counter. Also don't add the counter
suffix at all for the first session, since most sessions only have a
single transaction.
Timo Sirainen [Wed, 26 Jan 2022 14:00:45 +0000 (16:00 +0200)]
auth: ldap: If LDAP connection appears to be hanging, abort all old requests
Retrying the reconnect might fix them, but since this situation isn't
supposed to happen in the first place, it's safer to just remove them
entirely to guarantee that it's not trying to keep retrying them for
a long time.
Timo Sirainen [Wed, 26 Jan 2022 12:46:55 +0000 (14:46 +0200)]
auth: ldap: Reconnect to server if receiving unknown msgid
It's unclear why this happens. Is it a bug on server or client side?
Either way, this situation doesn't now fix itself automatically, so
reconnecting should help.
Timo Sirainen [Wed, 26 Jan 2022 12:43:01 +0000 (14:43 +0200)]
auth: ldap: Stop re-sending request after 3 disconnect+reconnects
This prevents retrying the same LDAP request forever in situations where the
request causes LDAP server to become disconnected. This might fix some real
issues, but it was mainly implemented because testing the following commit
caused infinite looping.
Karl Fleischmann [Thu, 20 Jan 2022 09:34:00 +0000 (10:34 +0100)]
lib-program-client: Add unit tests for client program execution
- Add unit test that covers program_client_wait(), in which the script
execution environment needs to wait for a still running asynchronous
client program, and
- add unit test that covers a synchronous program_client_run().
Markus Valentin [Mon, 17 Jan 2022 14:41:25 +0000 (15:41 +0100)]
imapc: imapc_untagged_fetch_handle() - Change return type to bool
When calling imapc_untagged_fetch_handle() also retrieve new_message_r
from it which allows imapc_mailbox_msgmap_update() to determine if the
message just handled was already in index or not.
Timo Sirainen [Mon, 14 May 2018 20:32:08 +0000 (23:32 +0300)]
fts: Add fts_backend_is_uid_indexed() and fts_backend_vfuncs.is_uid_indexed()
Backends may be able to optimize this better than get_last_uid(), because
they only need to verify whether the given UID is indexed or not. This
allows e.g. caching internally without having to refresh the index to see
whether another mail was just recently indexed.
If the new vfunc isn't implemented by the backend, get_last_uid() is used to
implement it.
Karl Fleischmann [Mon, 24 Jan 2022 13:51:41 +0000 (14:51 +0100)]
lib-storage: Add unit tests for mail_parse_human_timestamp()
Add one test for one of each branches in mail_parse_human_timestamp()
which include:
- ISO dates,
- IMAP dates,
- UNIX timestamps, and
- relative time intervals.
Markus Valentin [Wed, 22 Dec 2021 11:12:51 +0000 (12:12 +0100)]
imapc: Fix doveadm copy with imapc
When copying to a mailbox with imapc it does not sync the destination
mailbox when opening. This created "Error: Syncing mailbox '$mailboxname'
failed: Internal error occurred." Prevent this error by checking for the
MAILBOX_FLAG_SAVEONLY flag which is used by doveadm to create the
destination mailbox. If that flag is set ignore that there was no initial
fetching done.
Timo Sirainen [Thu, 20 Jan 2022 13:13:48 +0000 (14:13 +0100)]
lib: ostream-multiplex - Call flush callbacks also when stream has failed
It may be important for the flush callbacks to know when ostream has been
closed. This is a partial fix to prevent doveadm-server hanging when it's
printing lots of output and doveadm client disconnects.
Timo Sirainen [Thu, 20 Jan 2022 10:42:57 +0000 (12:42 +0200)]
lib-storage: Don't delay setting mail event's log prefix
This caused crashes if the mail event was kept referenced and used for
logging after struct mail was already freed. With the delayed mail event
creation the log prefix shouldn't be much of a performance problem, so just
set the prefix immediately.
Stephan Bosch [Mon, 9 Nov 2020 01:29:04 +0000 (02:29 +0100)]
lib-smtp: smtp-server-cmd-rset - Stop processing pipeline until RSET is complete.
A subsequent MAIL command could get reset in the middle otherwise. Before, it
only blocked input until a reply was submitted, but the transaction isn't reset
until the RSET command is complete (just before actually sending the reply)
which can cause issues when the subsequent MAIL command is already being
processed.
Stephan Bosch [Sun, 8 Nov 2020 23:02:51 +0000 (00:02 +0100)]
lib-smtp: smtp-server-cmd-helo - Stop processing pipeline until HELO/EHLO is complete.
A subsequent MAIL command could get reset in the middle otherwise. Before, it
only blocked input until a reply was submitted, but the transaction isn't reset
until the EHLO/HELO command is complete (just before actually sending the reply)
which can cause issues when the subsequent MAIL command is already
being processed.