]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
3 years agolib-master: Add admin-client API
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.

3 years agoimap/pop3/submission-login: Add srv.<name>/%{pid}-admin unix socket listener
Timo Sirainen [Sat, 9 Oct 2021 23:04:33 +0000 (02:04 +0300)] 
imap/pop3/submission-login: Add srv.<name>/%{pid}-admin unix socket listener

This can be used by admin clients.

3 years agomaster: Automatically mkdir listener subdirectories
Timo Sirainen [Sat, 9 Oct 2021 22:56:21 +0000 (01:56 +0300)] 
master: Automatically mkdir listener subdirectories

The directory permissions are based on the unix/fifo_listeners that are
created under the directory.

3 years agomaster: Split off service_is_enabled()
Timo Sirainen [Tue, 25 Jan 2022 10:18:30 +0000 (11:18 +0100)] 
master: Split off service_is_enabled()

3 years agomaster: Support %{pid} in unix_listener paths
Timo Sirainen [Sat, 14 Nov 2020 18:30:39 +0000 (20:30 +0200)] 
master: Support %{pid} in unix_listener paths

This allows each process to have their own private UNIX socket listener.

3 years agomaster: service_unix_listener_listen() - Add path parameter
Timo Sirainen [Sat, 14 Nov 2020 18:20:29 +0000 (20:20 +0200)] 
master: service_unix_listener_listen() - Add path parameter

3 years agomaster: service_unix_listener_listen() - Add verify_addrinuse parameter
Timo Sirainen [Sat, 14 Nov 2020 17:56:06 +0000 (19:56 +0200)] 
master: service_unix_listener_listen() - Add verify_addrinuse parameter

3 years agomaster: Make service_unix_listener_listen() public
Timo Sirainen [Sat, 14 Nov 2020 17:54:46 +0000 (19:54 +0200)] 
master: Make service_unix_listener_listen() public

3 years agomaster: Move error logging from service_*_listener_listen() to parent function
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.

3 years agolib: Add connection_client_connect_with_retries()
Timo Sirainen [Wed, 5 Jan 2022 21:46:12 +0000 (23:46 +0200)] 
lib: Add connection_client_connect_with_retries()

3 years agolib: Add connection_input_read_stream()
Timo Sirainen [Tue, 4 Jan 2022 16:39:24 +0000 (18:39 +0200)] 
lib: Add connection_input_read_stream()

3 years agolib: Add i_stream_set_error()
Timo Sirainen [Tue, 4 Jan 2022 16:39:09 +0000 (18:39 +0200)] 
lib: Add i_stream_set_error()

3 years agolib-master: Remove unused master_auth_request()
Timo Sirainen [Sat, 14 Nov 2020 20:07:51 +0000 (22:07 +0200)] 
lib-master: Remove unused master_auth_request()

3 years agowelcome: Supply noreply-parameter to program client creation
Karl Fleischmann [Mon, 7 Feb 2022 08:20:34 +0000 (09:20 +0100)] 
welcome: Supply noreply-parameter to program client creation

Use the appropriate noreply parameter when initializing the program
client to implement the behavior as it was configured.

3 years agowelcome: Use program_client_exit_status enum value
Karl Fleischmann [Mon, 7 Feb 2022 08:19:04 +0000 (09:19 +0100)] 
welcome: Use program_client_exit_status enum value

Replace the implicit int with the explicit program_client_exit_status
enum value when starting the script and handling the callback.

3 years agowelcome: Remove io_loop_stop() call in callback
Timo Sirainen [Mon, 7 Feb 2022 08:18:03 +0000 (09:18 +0100)] 
welcome: Remove io_loop_stop() call in callback

This is the responsibility of the program-client API and should not
happen in the plugin itself.

3 years agolib-program-client: Stop waiting ioloop on destruction
Timo Sirainen [Mon, 7 Feb 2022 08:14:53 +0000 (09:14 +0100)] 
lib-program-client: Stop waiting ioloop on destruction

3 years agostats: stats_metrics_remove_dynamic() - Free the removed metric
Martti Rannanjärvi [Thu, 3 Feb 2022 23:28:45 +0000 (01:28 +0200)] 
stats: stats_metrics_remove_dynamic() - Free the removed metric

3 years agostats: stats_metric_alloc() - Fix indentation on p_new() call
Martti Rannanjärvi [Thu, 3 Feb 2022 23:32:18 +0000 (01:32 +0200)] 
stats: stats_metric_alloc() - Fix indentation on p_new() call

3 years agoreplication: aggregator - Free replicator_connection content
Martti Rannanjärvi [Mon, 31 Jan 2022 10:42:46 +0000 (12:42 +0200)] 
replication: aggregator - Free replicator_connection content

3 years agolib-master: Fix deinit memory leak with process_shutdown_filter
sergey.kitov [Wed, 2 Feb 2022 15:01:49 +0000 (17:01 +0200)] 
lib-master: Fix deinit memory leak with process_shutdown_filter

3 years agolmtp: proxy - Add per-connection counter to session_id
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.

3 years agolmtp: Simplify/clarify per-recipient session ID
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.

3 years agolib-smtp: server-transaction - Simplify/clarify transaction ID
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.

3 years agolib-smtp, lmtp: Add brackets to <session-id> in logging
Timo Sirainen [Tue, 1 Feb 2022 13:29:43 +0000 (14:29 +0100)] 
lib-smtp, lmtp: Add brackets to <session-id> in logging

This makes it clearer where the session-id stops. It's also similar to
how it is in mail_log_prefix.

3 years agolmtp: proxy - Use recipient-specific session-id when logging the result
Timo Sirainen [Tue, 1 Feb 2022 14:03:15 +0000 (15:03 +0100)] 
lmtp: proxy - Use recipient-specific session-id when logging the result

Instead of transaction ID, which is shared between recipients.

3 years agolmtp: struct lmtp_recipient - Change all strings to const
Timo Sirainen [Tue, 1 Feb 2022 13:58:57 +0000 (14:58 +0100)] 
lmtp: struct lmtp_recipient - Change all strings to const

3 years agoauth: ldap: Drop partially saved results before retrying request
Timo Sirainen [Wed, 26 Jan 2022 14:09:29 +0000 (16:09 +0200)] 
auth: ldap: Drop partially saved results before retrying request

Fixes "LDAP search returned multiple entries" happening after reconnects.

3 years agoauth: ldap: If any requests were lost, reconnect to LDAP server
Timo Sirainen [Wed, 26 Jan 2022 14:03:27 +0000 (16:03 +0200)] 
auth: ldap: If any requests were lost, reconnect to LDAP server

3 years agoauth: ldap: If LDAP connection appears to be hanging, abort all old requests
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.

3 years agoauth: ldap: Reconnect to server if receiving unknown msgid
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.

3 years agoauth: ldap: Stop re-sending request after 3 disconnect+reconnects
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.

3 years agowelcome: Use program-client for welcome script
Aki Tuomi [Wed, 19 Jan 2022 09:20:24 +0000 (10:20 +0100)] 
welcome: Use program-client for welcome script

Replace manual execution of client script with consolidated
program-client API.

3 years agolib-program-client: Add unit tests for client program execution
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().

3 years agolib-program-client: Add program_client_wait() function
Aki Tuomi [Wed, 19 Jan 2022 08:40:55 +0000 (09:40 +0100)] 
lib-program-client: Add program_client_wait() function

Akin to program_client_run() this function creates an inner io-loop that
waits but without operating on the available data.

3 years agolib-program-client: Process successful unix connection directly
Aki Tuomi [Wed, 19 Jan 2022 08:16:44 +0000 (09:16 +0100)] 
lib-program-client: Process successful unix connection directly

Call program_client_remote_connected() directly instead of adding it to
the io-loop.

3 years agoimapc: Start to handle new untagged fetch messages in imapc_sync()
Markus Valentin [Tue, 18 Jan 2022 08:46:32 +0000 (09:46 +0100)] 
imapc: Start to handle new untagged fetch messages in imapc_sync()

3 years agoimapc: Add imapc_sync_handle_untagged_fetches()
Markus Valentin [Tue, 18 Jan 2022 08:22:24 +0000 (09:22 +0100)] 
imapc: Add imapc_sync_handle_untagged_fetches()

3 years agoimapc: imapc_untagged_fetch_handle() - Change return type to bool
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.

3 years agoimapc: imapc_untagged_fetch_update_flags() - Reduce indentation
Markus Valentin [Thu, 27 Jan 2022 07:06:16 +0000 (08:06 +0100)] 
imapc: imapc_untagged_fetch_update_flags() - Reduce indentation

3 years agoimapc: Split off imapc_untagged_fetch_update_flags() for handling flag updates
Markus Valentin [Thu, 27 Jan 2022 06:56:32 +0000 (07:56 +0100)] 
imapc: Split off imapc_untagged_fetch_update_flags() for handling flag updates

3 years agoimapc: Introduce imapc_untagged_fetch_ctx
Markus Valentin [Mon, 17 Jan 2022 14:00:41 +0000 (15:00 +0100)] 
imapc: Introduce imapc_untagged_fetch_ctx

3 years agoimapc: Decouple imapc_untagged_fetch parsing and handling
Markus Valentin [Mon, 17 Jan 2022 12:57:56 +0000 (13:57 +0100)] 
imapc: Decouple imapc_untagged_fetch parsing and handling

3 years agolib-smtp: test-smtp-client-errors - Add test for succesful authentication with large...
Stephan Bosch [Wed, 26 Jan 2022 03:00:32 +0000 (04:00 +0100)] 
lib-smtp: test-smtp-client-errors - Add test for succesful authentication with large initial response.

3 years agolib-smtp: smtp-client-connection - Fix authentication with multi-roundtrip SASL mecha...
Stephan Bosch [Wed, 26 Jan 2022 02:58:49 +0000 (03:58 +0100)] 
lib-smtp: smtp-client-connection - Fix authentication with multi-roundtrip SASL mechanisms.

Before, it would fail with an unexpected reply error.

3 years agolib-smtp: test-smtp-client-errors - Add test for successful authentication.
Stephan Bosch [Mon, 24 Jan 2022 00:39:19 +0000 (01:39 +0100)] 
lib-smtp: test-smtp-client-errors - Add test for successful authentication.

3 years agolib-smtp: test-smtp-client-errors - Rename "authentication failed" test to "authentic...
Stephan Bosch [Mon, 24 Jan 2022 00:41:15 +0000 (01:41 +0100)] 
lib-smtp: test-smtp-client-errors - Rename "authentication failed" test to "authentication".

3 years agolib-smtp: smtp-client - Fix maximum line length to include CRLF.
Stephan Bosch [Fri, 28 Jan 2022 02:14:16 +0000 (03:14 +0100)] 
lib-smtp: smtp-client - Fix maximum line length to include CRLF.

3 years agolib-smtp: smtp-client-connection - Do not include initial response in AUTH command...
Stephan Bosch [Fri, 21 Jan 2022 00:08:31 +0000 (01:08 +0100)] 
lib-smtp: smtp-client-connection - Do not include initial response in AUTH command if it is too long.

3 years agolib-smtp: smtp-client-connection - Move auth cleanup to separate function.
Stephan Bosch [Fri, 21 Jan 2022 01:26:18 +0000 (02:26 +0100)] 
lib-smtp: smtp-client-connection - Move auth cleanup to separate function.

3 years agolib-sasl: dsasl-client - Make dsasl_client_free(&NULL) a no-op.
Stephan Bosch [Fri, 28 Jan 2022 02:17:59 +0000 (03:17 +0100)] 
lib-sasl: dsasl-client - Make dsasl_client_free(&NULL) a no-op.

3 years agolib-smtp: smtp-client-connection - Reformat comment.
Stephan Bosch [Fri, 21 Jan 2022 01:28:23 +0000 (02:28 +0100)] 
lib-smtp: smtp-client-connection - Reformat comment.

3 years agolib-program-client: Explicitly ignore dns_lookup() return value
Timo Sirainen [Thu, 20 Jan 2022 17:36:27 +0000 (18:36 +0100)] 
lib-program-client: Explicitly ignore dns_lookup() return value

3 years agolmtp: proxy: Fix bad error handling code path with assert
Timo Sirainen [Thu, 20 Jan 2022 17:23:43 +0000 (18:23 +0100)] 
lmtp: proxy: Fix bad error handling code path with assert

3 years agodict-ldap: Fix crash in synchronous dict_lookup()
Timo Sirainen [Thu, 20 Jan 2022 17:10:41 +0000 (18:10 +0100)] 
dict-ldap: Fix crash in synchronous dict_lookup()

However, this code could never actually be called. All dict-ldap lookups
go through dict process, which uses only dict_lookup_async().

Broken by 4453ca75c600ed35643d0775b16848cafae9eaea

3 years agolib-http: http_server_resource_create() - Remove unnecessary pool allocation
Markus Valentin [Fri, 28 Jan 2022 09:54:53 +0000 (10:54 +0100)] 
lib-http: http_server_resource_create() - Remove unnecessary pool allocation

Fixes leaking the memory pool created in stats_http_resource_add()

3 years agolib-storage: LAYOUT=index: Fix accessing freed memory when deleting \Noselect parents
Markus Valentin [Thu, 27 Jan 2022 20:40:25 +0000 (21:40 +0100)] 
lib-storage: LAYOUT=index: Fix accessing freed memory when deleting \Noselect parents

Broken by f5328d6f7e4a8e460c736fa0336f5766aa58abda

3 years agofts: Use fts_backend_is_uid_indexed() instead of fts_backend_get_last_uid()
Timo Sirainen [Mon, 14 May 2018 20:59:02 +0000 (23:59 +0300)] 
fts: Use fts_backend_is_uid_indexed() instead of fts_backend_get_last_uid()

If the highest UID currently known to the view is already indexed, we don't
care whether there are other higher UIDs that have already been indexed.

3 years agofts: Add fts_backend_is_uid_indexed() and fts_backend_vfuncs.is_uid_indexed()
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.

3 years agofts-*: Use named initializers for fts_backend_vfuncs
Timo Sirainen [Mon, 14 May 2018 20:26:07 +0000 (23:26 +0300)] 
fts-*: Use named initializers for fts_backend_vfuncs

3 years agoplugins/fts: Allow plugins to carry state across calls during search session
Marco Bettini [Fri, 17 Dec 2021 08:27:07 +0000 (09:27 +0100)] 
plugins/fts: Allow plugins to carry state across calls during search session

3 years agoindexer: Fix memory leak - worker_requests were never freed
Timo Sirainen [Wed, 26 Jan 2022 18:28:33 +0000 (19:28 +0100)] 
indexer: Fix memory leak - worker_requests were never freed

Broken by 141766b24f885259508ae39f2e18811018373bc7

3 years agoindexer: Fix memory leak - session IDs were never freed
Timo Sirainen [Tue, 25 Jan 2022 22:31:34 +0000 (23:31 +0100)] 
indexer: Fix memory leak - session IDs were never freed

Broken by a8dcd4e2332c73087e9b148d34259230a77edb28

3 years agolib-storage: Add unit tests for mail_parse_human_timestamp()
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.

3 years agolib-storage: mail_parse_human_timestamp() - Make ISO date conversion UTC specific
Karl Fleischmann [Mon, 24 Jan 2022 13:50:46 +0000 (14:50 +0100)] 
lib-storage: mail_parse_human_timestamp() - Make ISO date conversion UTC specific

3 years agolib-sql: pgsql: Added correct notice processor
Dmitry Yakunin [Mon, 16 Apr 2018 10:43:03 +0000 (13:43 +0300)] 
lib-sql: pgsql: Added correct notice processor

3 years agolib-storage: mailbox-list: index_list_rename_mailbox() - Support NO-NOSELECT
Markus Valentin [Fri, 14 Jan 2022 07:07:50 +0000 (08:07 +0100)] 
lib-storage: mailbox-list: index_list_rename_mailbox() - Support NO-NOSELECT

When NO-NOSELECT is configured delete parent mailboxes which are not
selectable or existant when renaming child mailboxes.

3 years agolib-storage: mailbox-list: index_list_delete_mailbox() - Support NO-NOSELECT
Markus Valentin [Fri, 14 Jan 2022 07:04:09 +0000 (08:04 +0100)] 
lib-storage: mailbox-list: index_list_delete_mailbox() - Support NO-NOSELECT

When NO-NOSELECT is configured delete parent mailboxes which are not
selectable or not existant when deleting child mailboxes.

3 years agoimapc: Fix doveadm copy with imapc
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.

3 years agodoveadm fetch/search: Use DOVEADM_MAIL_ITER_FLAG_STOP_WITH_CLIENT
Timo Sirainen [Fri, 21 Jan 2022 14:31:04 +0000 (16:31 +0200)] 
doveadm fetch/search: Use DOVEADM_MAIL_ITER_FLAG_STOP_WITH_CLIENT

These commands only write output to the client, so it's safe to stop
them if the client disconnects.

3 years agodoveadm: doveadm_mail_iter_init() - Add DOVEADM_MAIL_ITER_FLAG_STOP_WITH_CLIENT
Timo Sirainen [Fri, 21 Jan 2022 14:29:48 +0000 (16:29 +0200)] 
doveadm: doveadm_mail_iter_init() - Add DOVEADM_MAIL_ITER_FLAG_STOP_WITH_CLIENT

When this flag is used, the iteration is stopped if print ostream has
reported an error, i.e. doveadm-client has disconnected.

3 years agodoveadm: doveadm_mail_iter_init() - Change bool parameter to flags
Timo Sirainen [Fri, 21 Jan 2022 14:24:39 +0000 (16:24 +0200)] 
doveadm: doveadm_mail_iter_init() - Change bool parameter to flags

3 years agodoveadm-server: Fix hang when flushing print output and client disconnects
Timo Sirainen [Thu, 20 Jan 2022 13:16:51 +0000 (14:16 +0100)] 
doveadm-server: Fix hang when flushing print output and client disconnects

3 years agolib: ostream-multiplex - Call flush callbacks also when stream has failed
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.

3 years agodoveadm: Fix assert-crash when proxying causes print buffer to be flushed
Timo Sirainen [Thu, 20 Jan 2022 12:34:50 +0000 (13:34 +0100)] 
doveadm: Fix assert-crash when proxying causes print buffer to be flushed

Fixes:
Panic: file ioloop.c: line 865 (io_loop_destroy): assertion failed: (ioloop == current_ioloop)

3 years agolib-master: Add process_shutdown_filter setting
sergey.kitov [Thu, 16 Dec 2021 09:49:24 +0000 (11:49 +0200)] 
lib-master: Add process_shutdown_filter setting

3 years agolib-master: Refactor parsing event filters from settings.
sergey.kitov [Thu, 16 Dec 2021 09:44:38 +0000 (11:44 +0200)] 
lib-master: Refactor parsing event filters from settings.

3 years agolib-master: Remove check for client->filter == NULL before event_filter_match().
sergey.kitov [Thu, 16 Dec 2021 09:38:53 +0000 (11:38 +0200)] 
lib-master: Remove check for client->filter == NULL before event_filter_match().

3 years agolib: Add check for NULL to event_filter_match().
sergey.kitov [Thu, 16 Dec 2021 09:38:08 +0000 (11:38 +0200)] 
lib: Add check for NULL to event_filter_match().

3 years agolib-master: Whitespace cleanup.
sergey.kitov [Wed, 15 Dec 2021 13:19:04 +0000 (15:19 +0200)] 
lib-master: Whitespace cleanup.

3 years agolib-storage: Emit event with process stat in mail_user_deinit().
sergey.kitov [Wed, 1 Dec 2021 11:35:12 +0000 (13:35 +0200)] 
lib-storage: Emit event with process stat in mail_user_deinit().

3 years agolib: Add event_add_int_non_zero()
sergey.kitov [Tue, 7 Dec 2021 14:58:43 +0000 (16:58 +0200)] 
lib: Add event_add_int_non_zero()

3 years agolib: Add functionality for acquiring process stat.
sergey.kitov [Wed, 1 Dec 2021 11:34:22 +0000 (13:34 +0200)] 
lib: Add functionality for acquiring process stat.

3 years agolib: add timeval_to_usecs()
sergey.kitov [Tue, 21 Dec 2021 08:47:54 +0000 (10:47 +0200)] 
lib: add timeval_to_usecs()

3 years agolib: Whitespace cleanup
sergey.kitov [Mon, 20 Dec 2021 14:17:54 +0000 (16:17 +0200)] 
lib: Whitespace cleanup

3 years agolib-storage: Fix search query that only contains SEARCH_MAILBOX_GUID
Timo Sirainen [Wed, 1 Dec 2021 10:21:48 +0000 (12:21 +0200)] 
lib-storage: Fix search query that only contains SEARCH_MAILBOX_GUID

Fixes assert-crash in virtual mailbox:

Panic: file virtual-search.c: line 77 (virtual_search_get_records): assertion failed: (result != 0)

3 years agolib-doveadm: Fix connect timeout from 30ms to 30s
Timo Sirainen [Thu, 20 Jan 2022 12:28:44 +0000 (13:28 +0100)] 
lib-doveadm: Fix connect timeout from 30ms to 30s

3 years agoconfig: old_settings_ssl_dh_read() - Replace while() from non-iterating code
Marco Bettini [Tue, 18 Jan 2022 13:26:30 +0000 (14:26 +0100)] 
config: old_settings_ssl_dh_read() - Replace while() from non-iterating code

Found by code analysis tool

3 years agodoveadm: doveadm_mailbox_list_iter_next() - Replace while() in non-iterating code
Marco Bettini [Tue, 18 Jan 2022 11:20:02 +0000 (12:20 +0100)] 
doveadm: doveadm_mailbox_list_iter_next() - Replace while() in non-iterating code

Found by code analysis tool

3 years agodsync: Log errors sent by remote tcp connection
Timo Sirainen [Thu, 10 Dec 2020 11:24:36 +0000 (13:24 +0200)] 
dsync: Log errors sent by remote tcp connection

3 years agodsync: Split off dsync_errors_finish()
Timo Sirainen [Thu, 10 Dec 2020 11:22:31 +0000 (13:22 +0200)] 
dsync: Split off dsync_errors_finish()

The logic changes a bit, but it's fine because either all of err_stream,
io_error and fd_err are set or none of them are.

3 years agolib-storage: Don't delay setting mail event's log prefix
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.

Partially reverts bc68e1c368db746557829f67556f3c72943b7956.

3 years agosubmission: submission-backend-relay - Make sure QUIT command yields 221 when relay...
Stephan Bosch [Fri, 14 Jan 2022 03:02:09 +0000 (04:02 +0100)] 
submission: submission-backend-relay - Make sure QUIT command yields 221 when relay connection is closed normally.

Before, it would sometimes erroneously treat the closing connection as a
"connection lost" 421 situation.

3 years agosubmission: submission-backend-relay - Fix segfault in QUIT command client-side destr...
Stephan Bosch [Fri, 14 Jan 2022 03:01:29 +0000 (04:01 +0100)] 
submission: submission-backend-relay - Fix segfault in QUIT command client-side destruction.

3 years agolib-smtp: smtp-server-cmd-rset - Stop processing pipeline until RSET is complete.
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.

3 years agolib-smtp: smtp-server-cmd-helo - Stop processing pipeline until HELO/EHLO is complete.
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.

3 years agolib-smtp: smtp-server-command - Add smtp_server_command_pipeline_block/unblock().
Stephan Bosch [Sun, 8 Nov 2020 02:58:06 +0000 (03:58 +0100)] 
lib-smtp: smtp-server-command - Add smtp_server_command_pipeline_block/unblock().

3 years agolib-smtp: smtp-client-transaction - Plug the command pipeline while transaction is...
Stephan Bosch [Mon, 10 Jan 2022 02:54:13 +0000 (03:54 +0100)] 
lib-smtp: smtp-client-transaction - Plug the command pipeline while transaction is pending.

This prevents commands submitted after creating the transaction from being
exectuted out-of-order before the transaction's MAIL command.

3 years agolib-smtp: smtp-client-transaction - Add smtp_client_command_mail_submit_after().
Stephan Bosch [Mon, 10 Jan 2022 02:53:41 +0000 (03:53 +0100)] 
lib-smtp: smtp-client-transaction - Add smtp_client_command_mail_submit_after().

3 years agolib-smtp: smtp-client-transaction - Prevent recursion for smtp_client_transaction_fai...
Stephan Bosch [Mon, 10 Jan 2022 00:18:56 +0000 (01:18 +0100)] 
lib-smtp: smtp-client-transaction - Prevent recursion for smtp_client_transaction_fail*().