]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
3 years agoanvil: admin-client - Add reference counting
Timo Sirainen [Mon, 21 Feb 2022 16:02:43 +0000 (17:02 +0100)] 
anvil: admin-client - Add reference counting

This allows the command callback to free the admin-client.

3 years agoanvil: connect-limit - Support multiple asynchronous iterators
Timo Sirainen [Mon, 21 Feb 2022 16:59:43 +0000 (17:59 +0100)] 
anvil: connect-limit - Support multiple asynchronous iterators

3 years agolib-storage: mail_user_get_anvil_session() - Add alt_usernames
Timo Sirainen [Mon, 21 Feb 2022 16:51:51 +0000 (17:51 +0100)] 
lib-storage: mail_user_get_anvil_session() - Add alt_usernames

3 years agolib-storage: Add mail_user_get_alt_usernames()
Timo Sirainen [Mon, 21 Feb 2022 16:51:27 +0000 (17:51 +0100)] 
lib-storage: Add mail_user_get_alt_usernames()

3 years agolib: array - Add array_get_copy() which copies the array_get() result to the provided...
Stephan Bosch [Sat, 4 Aug 2018 19:41:59 +0000 (21:41 +0200)] 
lib: array - Add array_get_copy() which copies the array_get() result to the provided pool.

3 years agoconfigure: Stop using cru with ar
Aki Tuomi [Tue, 22 Feb 2022 06:50:10 +0000 (08:50 +0200)] 
configure: Stop using cru with ar

Fixes ar: 'u' modifier ignored since 'D' is the default (see 'U')

3 years agoconfigure: Use silent rules by default
Aki Tuomi [Tue, 22 Feb 2022 06:23:59 +0000 (08:23 +0200)] 
configure: Use silent rules by default

3 years agoMakefile: Add AM_V_GEN to generated files
Aki Tuomi [Fri, 4 Feb 2022 12:12:43 +0000 (14:12 +0200)] 
Makefile: Add AM_V_GEN to generated files

3 years agom4: dovecot.m4 - Bump serial
Aki Tuomi [Fri, 4 Feb 2022 12:06:11 +0000 (14:06 +0200)] 
m4: dovecot.m4 - Bump serial

3 years agorun-test.sh: Move to build-aux
Aki Tuomi [Fri, 4 Feb 2022 12:04:07 +0000 (14:04 +0200)] 
run-test.sh: Move to build-aux

3 years agom4: dovecot.m4 - Fix moduledir self-reference
Aki Tuomi [Fri, 4 Feb 2022 11:45:27 +0000 (13:45 +0200)] 
m4: dovecot.m4 - Fix moduledir self-reference

Fixes distcheck by not referencing itself eventually.

3 years agoconfigure: Use external script to determine version
Aki Tuomi [Mon, 31 Jan 2022 13:22:49 +0000 (15:22 +0200)] 
configure: Use external script to determine version

Makes packaging easier

3 years agoconfigure: Use build-aux for external scripts
Aki Tuomi [Mon, 31 Jan 2022 13:31:21 +0000 (15:31 +0200)] 
configure: Use build-aux for external scripts

3 years agoautogen.sh: Do not set ACLOCAL environment variable
Aki Tuomi [Mon, 31 Jan 2022 13:36:50 +0000 (15:36 +0200)] 
autogen.sh: Do not set ACLOCAL environment variable

m4 directory is set in configure.ac

3 years agoconfigure.ac: Add tar-ustar option to AM_INIT_AUTOMAKE
Aki Tuomi [Tue, 8 Feb 2022 11:19:41 +0000 (13:19 +0200)] 
configure.ac: Add tar-ustar option to AM_INIT_AUTOMAKE

Allows using longer filenames, without it, we are limited to 99 chars.

3 years agodict: Fix potential timeout leak at deinit
Timo Sirainen [Sun, 6 Feb 2022 13:20:08 +0000 (14:20 +0100)] 
dict: Fix potential timeout leak at deinit

The deinit code could still trigger proctitle refresh.

3 years agodict: Make sure proctitle refresh timeout goes to the main ioloop
Timo Sirainen [Tue, 22 Feb 2022 10:23:33 +0000 (11:23 +0100)] 
dict: Make sure proctitle refresh timeout goes to the main ioloop

In some situations it could have gone to dict_wait() ioloop, causing
timeout leaks or crashes.

3 years agodoveadm: Remove unused doveadm_killed_signo()
Timo Sirainen [Mon, 7 Feb 2022 18:39:35 +0000 (19:39 +0100)] 
doveadm: Remove unused doveadm_killed_signo()

3 years agodoveadm sync: Remove duplicate "Killed with signal" logging
Timo Sirainen [Mon, 7 Feb 2022 18:39:08 +0000 (19:39 +0100)] 
doveadm sync: Remove duplicate "Killed with signal" logging

It's already logged by lib-master.

3 years agolib-master: Always log a warning if process is killed by signal
Timo Sirainen [Mon, 7 Feb 2022 18:36:27 +0000 (19:36 +0100)] 
lib-master: Always log a warning if process is killed by signal

If it's not logged by a delayed signal handler, log it at deinit.

3 years agolib-master: Split off log_killed_signal()
Timo Sirainen [Mon, 7 Feb 2022 18:33:28 +0000 (19:33 +0100)] 
lib-master: Split off log_killed_signal()

3 years agolib-master: Use sig_delayed_ prefix for delayed signal handler functions
Timo Sirainen [Mon, 7 Feb 2022 18:32:17 +0000 (19:32 +0100)] 
lib-master: Use sig_delayed_ prefix for delayed signal handler functions

This makes it clearer which signal handlers are immediate and which are
delayed.

3 years agolib-storage: Interrupt long mailbox searches on signal
Timo Sirainen [Thu, 3 Feb 2022 20:28:20 +0000 (21:28 +0100)] 
lib-storage: Interrupt long mailbox searches on signal

When interrupt signal (SIGTERM) is received, run mailbox search for 2 more
seconds until failing it with MAIL_ERROR_INTERRUPTED.

3 years agoindexer: Log MAIL_ERROR_INTERRUPTED with info-level instead of error
Timo Sirainen [Thu, 3 Feb 2022 19:59:46 +0000 (20:59 +0100)] 
indexer: Log MAIL_ERROR_INTERRUPTED with info-level instead of error

3 years agolib-storage: Add MAIL_ERROR_INTERRUPTED
Timo Sirainen [Thu, 3 Feb 2022 19:54:14 +0000 (20:54 +0100)] 
lib-storage: Add MAIL_ERROR_INTERRUPTED

This is going to be used to interrupt operations when e.g. SIGTERM is
received.

3 years agolib-storage: Avoid transaction rollback if mailbox delete fails in the middle
Timo Sirainen [Thu, 3 Feb 2022 19:14:25 +0000 (20:14 +0100)] 
lib-storage: Avoid transaction rollback if mailbox delete fails in the middle

Commit the changes done so far and then return failure.

3 years agoimap: Don't rollback transaction if expunge search fails
Timo Sirainen [Thu, 3 Feb 2022 19:01:04 +0000 (20:01 +0100)] 
imap: Don't rollback transaction if expunge search fails

Just commit the expunges done before the failure. The next EXPUNGE will
continue from there.

3 years agoimap: Add comment explaining EXPUNGE batching
Timo Sirainen [Thu, 3 Feb 2022 18:59:05 +0000 (19:59 +0100)] 
imap: Add comment explaining EXPUNGE batching

3 years agodoveadm: Remove duplicate SIGINT/SIGTERM handlers
Timo Sirainen [Thu, 3 Feb 2022 20:54:48 +0000 (21:54 +0100)] 
doveadm: Remove duplicate SIGINT/SIGTERM handlers

lib-master already handles these.

3 years agodoveadm: Remove duplicate "Killed with signal" logging in user iteration
Timo Sirainen [Mon, 21 Feb 2022 07:58:36 +0000 (08:58 +0100)] 
doveadm: Remove duplicate "Killed with signal" logging in user iteration

It's already logged by lib-master.

3 years agolib-master: Add master_service_get_kill_time()
Timo Sirainen [Thu, 3 Feb 2022 22:14:27 +0000 (23:14 +0100)] 
lib-master: Add master_service_get_kill_time()

3 years agolib-master: Add master_service_get_kill_signal()
Timo Sirainen [Thu, 3 Feb 2022 20:54:04 +0000 (21:54 +0100)] 
lib-master: Add master_service_get_kill_signal()

3 years agolib-master: Set killed-flag immediately in standalone programs
Timo Sirainen [Thu, 3 Feb 2022 20:48:14 +0000 (21:48 +0100)] 
lib-master: Set killed-flag immediately in standalone programs

3 years agolib-master: Set killed-flag immediately in SIGTERM handler
Timo Sirainen [Thu, 3 Feb 2022 20:44:24 +0000 (21:44 +0100)] 
lib-master: Set killed-flag immediately in SIGTERM handler

This allows master_service_is_killed() to return TRUE without waiting for
the next ioloop to run.

3 years agolib: If log prefix update can't be sent to log, exit with FATAL_LOGERROR
Timo Sirainen [Mon, 21 Feb 2022 11:47:29 +0000 (12:47 +0100)] 
lib: If log prefix update can't be sent to log, exit with FATAL_LOGERROR

3 years agolib: Fix losing log prefix or IP change when log process is busy
Timo Sirainen [Mon, 21 Feb 2022 11:39:02 +0000 (12:39 +0100)] 
lib: Fix losing log prefix or IP change when log process is busy

The fd for writing to log process is non-blocking. When sending options
to log process, it was done with write_full(), which stopped whenever
EAGAIN was returned. This error was simply ignored, and the logging code
thought that the prefix was successfully changed (or the IP was sent).

This mainly caused a problem when processes were reused and log process
was busy. The prefix update could have failed, and the following logging
would be using the previous session's log prefix, i.e. log lines could have
been logged for the wrong user/session.

Broken by 9372e48b702a3af5705785e08fbf47b0e37f2047

3 years agoconfigure: Remove DOVECOT_WANT_SHADOW
Aki Tuomi [Tue, 22 Feb 2022 06:08:52 +0000 (08:08 +0200)] 
configure: Remove DOVECOT_WANT_SHADOW

Forgotten in 62cde650ebc83a8af6fe23f85dc92214afee672b

3 years agolib: connection - Fix changing istream in handshake_line() or input_line()
Timo Sirainen [Mon, 21 Feb 2022 15:01:22 +0000 (16:01 +0100)] 
lib: connection - Fix changing istream in handshake_line() or input_line()

If the istream was changed (e.g. istream-multiplex added), the following
line was still read using the previous istream.

Fixes errors caused by recent anvil changes:
anvil: Error: Anvil client sent empty line

3 years agolib: Split off connection_input_parse_lines()
Timo Sirainen [Mon, 21 Feb 2022 14:59:16 +0000 (15:59 +0100)] 
lib: Split off connection_input_parse_lines()

3 years agoanvil: Log errors using connection event
Timo Sirainen [Mon, 21 Feb 2022 14:56:36 +0000 (15:56 +0100)] 
anvil: Log errors using connection event

3 years agoindexer: Free user after anvil disconnect
Aki Tuomi [Thu, 17 Feb 2022 08:06:40 +0000 (10:06 +0200)] 
indexer: Free user after anvil disconnect

Fixes invalid use after free. Broken by f9627ea62b5cb471d9adde0cc188ee8dea93c172

3 years agofts-squat: Remove the plugin
Marco Bettini [Wed, 2 Feb 2022 15:09:37 +0000 (16:09 +0100)] 
fts-squat: Remove the plugin

3 years agoimap-hibernate: Support kicking connections
Timo Sirainen [Tue, 25 Jan 2022 10:48:55 +0000 (11:48 +0100)] 
imap-hibernate: Support kicking connections

3 years agolib-master, global: Add and use MASTER_SERVICE_SHUTTING_DOWN_MSG
Timo Sirainen [Tue, 8 Feb 2022 14:33:31 +0000 (15:33 +0100)] 
lib-master, global: Add and use MASTER_SERVICE_SHUTTING_DOWN_MSG

Use a macro to replace "Server shutting down" texts in different services.

3 years agoimap-hibernate: Send BYE message to client when process shuts down.
Timo Sirainen [Tue, 25 Jan 2022 10:41:50 +0000 (11:41 +0100)] 
imap-hibernate: Send BYE message to client when process shuts down.

Since the BYE message isn't explicitly flushed, this change also disables
error handling for the client ostream to prevent assert-crash at destroy.

3 years agoimap-hibernate: Use the same "Server shutting down" log message as imap
Timo Sirainen [Tue, 25 Jan 2022 10:39:13 +0000 (11:39 +0100)] 
imap-hibernate: Use the same "Server shutting down" log message as imap

Not just "Shutting down".

3 years agoimap, imap-urlauth, pop3: Remove trailing period from "Server shutting down" log...
Timo Sirainen [Tue, 25 Jan 2022 10:37:40 +0000 (11:37 +0100)] 
imap, imap-urlauth, pop3: Remove trailing period from "Server shutting down" log message

It's a bit weird having it in the log message. It's still sent to the
client though.

3 years agofts-lucene: Remove the plugin
Marco Bettini [Thu, 3 Feb 2022 11:02:00 +0000 (12:02 +0100)] 
fts-lucene: Remove the plugin

3 years agoauth: Remove shadow passdb driver
Karl Fleischmann [Wed, 2 Feb 2022 16:25:55 +0000 (17:25 +0100)] 
auth: Remove shadow passdb driver

Drop support of shadow passdb driver by removing the implementation,
relevant references, build chain entries and the example config.

3 years agomail-crypt: Fix for mail being wrongly storing encrypted via LMTP
Marco Bettini [Tue, 1 Feb 2022 13:22:31 +0000 (14:22 +0100)] 
mail-crypt: Fix for mail being wrongly storing encrypted via LMTP

If 1st recipient has mail_crypt_save_version=2,
and 2nd recipient has mail_crypt_save_version=0,
the mail for 2nd recipient is wrongly stored encrypted.

Same happens if 2nd recipient has mail_crypt disabled

3 years agomail-crypt: Remove "plugin disabled" texts from errors
Timo Sirainen [Tue, 31 Mar 2020 10:51:09 +0000 (13:51 +0300)] 
mail-crypt: Remove "plugin disabled" texts from errors

The plugin isn't just disabled, the user initialization fails entirely.

3 years agomail-crypt: Fix crash when plugin is already initialized, but not used for another...
Timo Sirainen [Tue, 31 Mar 2020 10:49:28 +0000 (13:49 +0300)] 
mail-crypt: Fix crash when plugin is already initialized, but not used for another user

Fixes:
Panic: Module context mail_crypt_user_module missing

3 years agoold-stats: Remove the plugin, lib-old-stats old-stats plugins/imap-old-stats plugins...
Marco Bettini [Thu, 3 Feb 2022 14:08:39 +0000 (15:08 +0100)] 
old-stats: Remove the plugin, lib-old-stats old-stats plugins/imap-old-stats plugins/old-stats

3 years agolib-storage: Drop struct mail_user_vfuncs.stats_fill API
Marco Bettini [Wed, 16 Feb 2022 10:52:41 +0000 (11:52 +0100)] 
lib-storage: Drop struct mail_user_vfuncs.stats_fill API

3 years agoauth: Drop auth-stat
Marco Bettini [Thu, 3 Feb 2022 14:59:21 +0000 (15:59 +0100)] 
auth: Drop auth-stat

3 years agolib-dict: Remove memcached
Marco Bettini [Thu, 10 Feb 2022 10:42:08 +0000 (11:42 +0100)] 
lib-dict: Remove memcached

3 years agolib-storage: Don't use cached message_parts while message is being parsed
Timo Sirainen [Mon, 25 Oct 2021 12:43:00 +0000 (15:43 +0300)] 
lib-storage: Don't use cached message_parts while message is being parsed

Finish the parsing instead. Otherwise there can be some confusion about
parsed_bodystructure* fields, which indicate that data->parts have the
bodystructure info while in reality data->parts came from cached fields
and they have no bodystructure info.

3 years agolib-storage: Reset bodystructure parsing state when reseting message_parts
Timo Sirainen [Mon, 25 Oct 2021 09:22:06 +0000 (12:22 +0300)] 
lib-storage: Reset bodystructure parsing state when reseting message_parts

Fixes:
Panic: file message-part-data.c: line 28 (message_part_data_is_plain_7bit): assertion failed: (data != NULL)

3 years agosubmission: Add submission_add_received_header setting
Aki Tuomi [Tue, 4 Jan 2022 08:30:53 +0000 (10:30 +0200)] 
submission: Add submission_add_received_header setting

3 years agodict-sql: Fix assert-crash if trying to rollback an open set/inc transaction
Timo Sirainen [Wed, 9 Feb 2022 21:12:19 +0000 (23:12 +0200)] 
dict-sql: Fix assert-crash if trying to rollback an open set/inc transaction

Fixes:
Panic: file dict-sql.c: line 911 (sql_dict_transaction_free): assertion failed: (!array_is_created(&ctx->prev_set))

3 years agolib-master: sig_term_try_kick_user() - Remove ignored sockaddr and addrlen
Martti Rannanjärvi [Tue, 15 Feb 2022 02:39:26 +0000 (04:39 +0200)] 
lib-master: sig_term_try_kick_user() - Remove ignored sockaddr and addrlen

Coverity complains about uninitialized addrlen, but no point in passing
these to accept() as the results are ignored.

3 years ago.gitignore: Ignore doc/man/doveadm-indexer.1
Martti Rannanjärvi [Mon, 14 Feb 2022 16:17:37 +0000 (18:17 +0200)] 
.gitignore: Ignore doc/man/doveadm-indexer.1

3 years agopop3: Fix empty command handling
Aki Tuomi [Mon, 14 Feb 2022 11:50:02 +0000 (13:50 +0200)] 
pop3: Fix empty command handling

If empty command is given, error out instead of trying to create event.
This fixes a crash caused by d2ab26be6038bd53b13a3ff18c403d6c192c1d91.

3 years agoman: Add doveadm-indexer
Timo Sirainen [Thu, 3 Feb 2022 16:20:57 +0000 (17:20 +0100)] 
man: Add doveadm-indexer

3 years agoimap, pop3, indexer-worker, submission: Add per-process admin socket listener
Timo Sirainen [Thu, 3 Feb 2022 15:33:06 +0000 (16:33 +0100)] 
imap, pop3, indexer-worker, submission: Add per-process admin socket listener

This enables race-free kicking using socket+SIGTERM.

3 years agolib-master: Add support for for race-free kicking of users with SIGTERM
Timo Sirainen [Wed, 2 Feb 2022 19:15:13 +0000 (20:15 +0100)] 
lib-master: Add support for for race-free kicking of users with SIGTERM

This works by anvil connecting to the per-process admin socket and sending
KICK-USER-SIGNAL command, followed by SIGTERM.

The receiving process usually gets the SIGTERM and attempts to accept() the
admin socket and read() the KICK-USER-SIGNAL command. If the command is for
a different user than is currently running, the signal is ignored.

If the SIGTERM is delayed, the generic admin connection needs to support
handling the KICK-USER-SIGNAL. This is done by blocking the SIGTERM early
while accessing the admin connection.

If the SIGTERM handler finds out that the admin socket was accepted but
a different command than KICK-USER-SIGNAL was found, this means a rather
race condition with another admin command. The process was most likely
going to be killed anyway, so just ignore the command and kill the process.

3 years agolib-master: Split off master_service_accept()
Timo Sirainen [Thu, 3 Feb 2022 15:10:40 +0000 (16:10 +0100)] 
lib-master: Split off master_service_accept()

3 years agolib-storage: Call master_service_set_current_user()
Timo Sirainen [Thu, 3 Feb 2022 15:24:39 +0000 (16:24 +0100)] 
lib-storage: Call master_service_set_current_user()

3 years agolib-master: Add master_service_set_current_user()
Timo Sirainen [Thu, 3 Feb 2022 15:24:11 +0000 (16:24 +0100)] 
lib-master: Add master_service_set_current_user()

3 years agoanvil: Add support for KICK_TYPE_SIGNAL_WITH_SOCKET
Timo Sirainen [Thu, 3 Feb 2022 15:20:26 +0000 (16:20 +0100)] 
anvil: Add support for KICK_TYPE_SIGNAL_WITH_SOCKET

This provides (mostly) race-free SIGTERM kick that doesn't kick the wrong
user.

3 years agolib: lib-signals - Add lib_signals_set_handler2() to set both immediate/delayed handlers
Timo Sirainen [Wed, 2 Feb 2022 18:41:16 +0000 (19:41 +0100)] 
lib: lib-signals - Add lib_signals_set_handler2() to set both immediate/delayed handlers

3 years agolib: lib-signals - Split off lib_signal_delayed()
Timo Sirainen [Wed, 2 Feb 2022 18:39:44 +0000 (19:39 +0100)] 
lib: lib-signals - Split off lib_signal_delayed()

3 years agolib: lib-signals - Check handler callbacks instead of LIBSIG_FLAG_DELAYED
Timo Sirainen [Wed, 2 Feb 2022 18:33:41 +0000 (19:33 +0100)] 
lib: lib-signals - Check handler callbacks instead of LIBSIG_FLAG_DELAYED

This is in preparation for allowing both handlers to be called.

3 years agolib: lib-signals - Split immediate and delayed handlers to separate fields
Timo Sirainen [Wed, 2 Feb 2022 18:31:18 +0000 (19:31 +0100)] 
lib: lib-signals - Split immediate and delayed handlers to separate fields

This is in preparation for allowing both handlers to be called.

3 years agoindexer-worker: Register indexing session to anvil
Timo Sirainen [Mon, 31 Jan 2022 21:51:43 +0000 (22:51 +0100)] 
indexer-worker: Register indexing session to anvil

3 years agoindexer-worker: master_connection_cmd_index() - Reduce indent
Timo Sirainen [Mon, 31 Jan 2022 21:48:10 +0000 (22:48 +0100)] 
indexer-worker: master_connection_cmd_index() - Reduce indent

3 years agoindexer-worker: Split off master_connection_cmd_index()
Timo Sirainen [Mon, 31 Jan 2022 21:46:46 +0000 (22:46 +0100)] 
indexer-worker: Split off master_connection_cmd_index()

3 years agoindexer: Use e_error() for error logging
Timo Sirainen [Thu, 27 Jan 2022 15:28:28 +0000 (16:28 +0100)] 
indexer: Use e_error() for error logging

3 years agoindexer: Change worker-connection API to return struct worker_connection
Timo Sirainen [Thu, 27 Jan 2022 14:52:07 +0000 (15:52 +0100)] 
indexer: Change worker-connection API to return struct worker_connection

3 years agoindexer: Send request immediately in worker_connection_try_create()
Timo Sirainen [Wed, 26 Jan 2022 18:36:12 +0000 (19:36 +0100)] 
indexer: Send request immediately in worker_connection_try_create()

This also guarantees that request_username is always set.

3 years agoindexer: worker_connection_try_create() - Remove unnecessary conn_r parameter
Timo Sirainen [Thu, 27 Jan 2022 14:57:51 +0000 (15:57 +0100)] 
indexer: worker_connection_try_create() - Remove unnecessary conn_r parameter

3 years agoindexer: worker-connection - Remove unnecessarily public functions
Timo Sirainen [Wed, 26 Jan 2022 18:19:53 +0000 (19:19 +0100)] 
indexer: worker-connection - Remove unnecessarily public functions

3 years agoindexer: Remove worker-pool wrapper
Timo Sirainen [Wed, 26 Jan 2022 18:16:27 +0000 (19:16 +0100)] 
indexer: Remove worker-pool wrapper

It wasn't actually performing any pooling functionality anymore, so it was
just causing confusion.

3 years agoindexer: Move functions from worker-pool to worker-connection
Timo Sirainen [Wed, 26 Jan 2022 18:10:16 +0000 (19:10 +0100)] 
indexer: Move functions from worker-pool to worker-connection

3 years agoindexer: Refactor worker_connection_create() to _try_create()
Timo Sirainen [Wed, 26 Jan 2022 18:02:37 +0000 (19:02 +0100)] 
indexer: Refactor worker_connection_create() to _try_create()

Moved connection limit checking and connect() error handling inside it.

3 years agoindexer: Send worker's PID in handshake
Timo Sirainen [Wed, 26 Jan 2022 17:50:47 +0000 (18:50 +0100)] 
indexer: Send worker's PID in handshake

3 years agodoveadm: Add indexer add/remove/list commands
Timo Sirainen [Tue, 25 Jan 2022 17:45:32 +0000 (18:45 +0100)] 
doveadm: Add indexer add/remove/list commands

3 years agodoveadm: Use doveadm_blocking_connect() for connecting to indexer socket
Timo Sirainen [Tue, 25 Jan 2022 17:19:01 +0000 (18:19 +0100)] 
doveadm: Use doveadm_blocking_connect() for connecting to indexer socket

This also adds extra error checking to make sure the command was accepted by
indexer.

3 years agodoveadm: Use doveadm_blocking_connect() for connecting to master socket
Timo Sirainen [Tue, 25 Jan 2022 17:18:24 +0000 (18:18 +0100)] 
doveadm: Use doveadm_blocking_connect() for connecting to master socket

3 years agodoveadm: Add doveadm_blocking_connect()
Timo Sirainen [Tue, 25 Jan 2022 17:16:32 +0000 (18:16 +0100)] 
doveadm: Add doveadm_blocking_connect()

This makes it easier for doveadm to connect to various connection API
compatible sockets.

3 years agolib: Add o_stream_create_fd_blocking()
Timo Sirainen [Tue, 25 Jan 2022 17:16:17 +0000 (18:16 +0100)] 
lib: Add o_stream_create_fd_blocking()

3 years agolib: connection - Improve "wrong socket type" error message
Timo Sirainen [Tue, 25 Jan 2022 17:15:16 +0000 (18:15 +0100)] 
lib: connection - Improve "wrong socket type" error message

Especially "Connected to wrong socket type" was confusing when it was logged
for incoming connections.

3 years agodoveadm index: Use blocking fd for indexer
Timo Sirainen [Tue, 25 Jan 2022 15:23:21 +0000 (16:23 +0100)] 
doveadm index: Use blocking fd for indexer

It was already assumed to be blocking, but the writes were so small that
usually it didn't matter.

3 years agoindexer: Add test-indexer-queue unit test
Timo Sirainen [Tue, 25 Jan 2022 22:13:36 +0000 (23:13 +0100)] 
indexer: Add test-indexer-queue unit test

3 years agoindexer: Add REMOVE command to remove requests from queue
Timo Sirainen [Tue, 25 Jan 2022 21:48:58 +0000 (22:48 +0100)] 
indexer: Add REMOVE command to remove requests from queue

3 years agoindexer: Split off a more generic indexer_queue_request_cancel()
Timo Sirainen [Tue, 25 Jan 2022 21:48:20 +0000 (22:48 +0100)] 
indexer: Split off a more generic indexer_queue_request_cancel()

This function can be used to cancel any request, not just the head of the
queue.

3 years agoindexer: Add LIST command to list all requests
Timo Sirainen [Tue, 25 Jan 2022 15:19:58 +0000 (16:19 +0100)] 
indexer: Add LIST command to list all requests

3 years agoindexer: Add indexer-queue iterator API
Timo Sirainen [Tue, 25 Jan 2022 15:19:47 +0000 (16:19 +0100)] 
indexer: Add indexer-queue iterator API

3 years agoindexer: Track user's indexing requests in a separate hash table
Timo Sirainen [Tue, 25 Jan 2022 21:38:44 +0000 (22:38 +0100)] 
indexer: Track user's indexing requests in a separate hash table

3 years agoindexer: Use a proper enum for request type
Timo Sirainen [Tue, 25 Jan 2022 15:05:41 +0000 (16:05 +0100)] 
indexer: Use a proper enum for request type

This cleans up the code a bit.