]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
4 years agolib-oauth2: Reformat oauth2-jwt.c.
Stephan Bosch [Fri, 5 Jun 2020 18:51:19 +0000 (20:51 +0200)] 
lib-oauth2: Reformat oauth2-jwt.c.

4 years agolib-oauth2: Reformat oauth2-key-cache.c.
Stephan Bosch [Fri, 5 Jun 2020 18:50:55 +0000 (20:50 +0200)] 
lib-oauth2: Reformat oauth2-key-cache.c.

4 years agolib-oauth2: Reformat oauth2-request.c.
Stephan Bosch [Fri, 5 Jun 2020 18:50:34 +0000 (20:50 +0200)] 
lib-oauth2: Reformat oauth2-request.c.

4 years agolib-oauth2: Reformat oauth2.c.
Stephan Bosch [Fri, 5 Jun 2020 18:49:34 +0000 (20:49 +0200)] 
lib-oauth2: Reformat oauth2.c.

4 years agolib-oauth2: Reformat oauth2-private.h.
Stephan Bosch [Fri, 5 Jun 2020 18:49:58 +0000 (20:49 +0200)] 
lib-oauth2: Reformat oauth2-private.h.

4 years agolib-oauth2: Reformat oauth2.h.
Stephan Bosch [Fri, 5 Jun 2020 18:49:09 +0000 (20:49 +0200)] 
lib-oauth2: Reformat oauth2.h.

4 years agoauth: db-oauth2 - Add consistent prefix for all error messages
Timo Sirainen [Tue, 26 May 2020 22:49:52 +0000 (01:49 +0300)] 
auth: db-oauth2 - Add consistent prefix for all error messages

4 years agoauth: db-oauth2 - Fix debug logging
Timo Sirainen [Tue, 26 May 2020 22:36:41 +0000 (01:36 +0300)] 
auth: db-oauth2 - Fix debug logging

Don't log a debug message when the callback is going to be logging
exactly the same message as info/error.

4 years agoauth: db-oauth2 - Call db_oauth2_lookup_continue_valid() after valid grant
Timo Sirainen [Tue, 26 May 2020 22:25:41 +0000 (01:25 +0300)] 
auth: db-oauth2 - Call db_oauth2_lookup_continue_valid() after valid grant

No need to check for error/validity again in db_oauth2_lookup_continue().

4 years agoauth: db-oauth2 - db_oauth2_lookup_continue() - Minor cleanup to avoid variables
Timo Sirainen [Tue, 26 May 2020 22:22:13 +0000 (01:22 +0300)] 
auth: db-oauth2 - db_oauth2_lookup_continue() - Minor cleanup to avoid variables

4 years agoauth: db-oauth2 - Split off db_oauth2_lookup_continue_valid()
Timo Sirainen [Tue, 26 May 2020 22:20:36 +0000 (01:20 +0300)] 
auth: db-oauth2 - Split off db_oauth2_lookup_continue_valid()

4 years agoauth: db-oauth2 - db_oauth2_lookup_passwd_grant() - Reorder error handling code flow
Timo Sirainen [Tue, 26 May 2020 22:03:44 +0000 (01:03 +0300)] 
auth: db-oauth2 - db_oauth2_lookup_passwd_grant() - Reorder error handling code flow

4 years agoauth: db-oauth2 - Improve "Internal error" message for grant lookups
Timo Sirainen [Tue, 26 May 2020 22:03:11 +0000 (01:03 +0300)] 
auth: db-oauth2 - Improve "Internal error" message for grant lookups

4 years agoauth: db-oauth2 - Add and use db_oauth2_field_find()
Timo Sirainen [Tue, 26 May 2020 21:59:49 +0000 (00:59 +0300)] 
auth: db-oauth2 - Add and use db_oauth2_field_find()

4 years agoauth: db-oauth2 - Don't set db_oauth2_request.token for grant lookups
Timo Sirainen [Tue, 26 May 2020 21:57:24 +0000 (00:57 +0300)] 
auth: db-oauth2 - Don't set db_oauth2_request.token for grant lookups

The grant lookup sets the token. There's no need to set it before that.

4 years agoauth: db-oauth2 - db_oauth2_lookup_passwd_grant() - Reorder code flow
Timo Sirainen [Tue, 26 May 2020 21:50:07 +0000 (00:50 +0300)] 
auth: db-oauth2 - db_oauth2_lookup_passwd_grant() - Reorder code flow

No behavioral changes.

4 years agoauth: db-oauth2 - Refactor "OAuth2 token missing from reply" code path
Timo Sirainen [Tue, 26 May 2020 21:44:16 +0000 (00:44 +0300)] 
auth: db-oauth2 - Refactor "OAuth2 token missing from reply" code path

It can be NULL only when coming from db_oauth2_lookup_passwd_grant(),
so handle it there.

4 years agoauth: db-oauth2 - db_oauth2_template_export() - Make var_expand() error handling...
Timo Sirainen [Tue, 26 May 2020 21:36:44 +0000 (00:36 +0300)] 
auth: db-oauth2 - db_oauth2_template_export() - Make var_expand() error handling consistent

Other var_expand() errors include the original string in the error message,
so this one should also.

4 years agolib-oauth2: Improve error message when server returns unexpected result
Timo Sirainen [Tue, 26 May 2020 21:30:45 +0000 (00:30 +0300)] 
lib-oauth2: Improve error message when server returns unexpected result

If the result isn't 2xx or 4xx, use the HTTP response message as the error
message.

4 years agolib-oauth2: Don't fail if oauth response payload is NULL
Timo Sirainen [Tue, 26 May 2020 21:27:15 +0000 (00:27 +0300)] 
lib-oauth2: Don't fail if oauth response payload is NULL

oauth2_parse_json() is happy with with empty payload (Content-Length: 0),
so it should be happy also when payload is NULL (Content-Length is missing).

4 years agolib-oauth2: Remove unused oauth2-passwd-grant.c
Timo Sirainen [Tue, 26 May 2020 21:21:24 +0000 (00:21 +0300)] 
lib-oauth2: Remove unused oauth2-passwd-grant.c

4 years agolib-oauth2, auth: Remove redundant oauth2_request_result.success
Timo Sirainen [Tue, 26 May 2020 21:19:42 +0000 (00:19 +0300)] 
lib-oauth2, auth: Remove redundant oauth2_request_result.success

success is the same as (error == NULL)

4 years agolib-oauth2: json_parsed_cb() - Remove redundant success parameter
Timo Sirainen [Tue, 26 May 2020 21:12:49 +0000 (00:12 +0300)] 
lib-oauth2: json_parsed_cb() - Remove redundant success parameter

success is the same as (error == NULL)

4 years agofs-compress: Use istream-decompress
Timo Sirainen [Thu, 1 Oct 2020 13:02:26 +0000 (16:02 +0300)] 
fs-compress: Use istream-decompress

4 years agolib-compression: Fix detecting if input is bzip2 compressed
Timo Sirainen [Thu, 1 Oct 2020 12:59:37 +0000 (15:59 +0300)] 
lib-compression: Fix detecting if input is bzip2 compressed

The detection was broken at least for empty bzip2 input.

4 years agolib-compression: Add istream-decompress
Timo Sirainen [Thu, 1 Oct 2020 12:36:08 +0000 (15:36 +0300)] 
lib-compression: Add istream-decompress

This stream detects the compression format and creates the proper istream
afterwards. This is more efficient than creating each compression istream
and using istream-try.

4 years agolib-storage: Add test-mail unit test
Timo Sirainen [Thu, 19 Nov 2020 15:50:22 +0000 (17:50 +0200)] 
lib-storage: Add test-mail unit test

Initially it just accesses the mail randomly.

4 years agomail-crypt: test-mail-crypt - Use test-mail-storage API
Timo Sirainen [Thu, 19 Nov 2020 13:56:17 +0000 (15:56 +0200)] 
mail-crypt: test-mail-crypt - Use test-mail-storage API

4 years agolib-storage: Add a public test-mail-storage-common.h API
Timo Sirainen [Thu, 19 Nov 2020 13:37:54 +0000 (15:37 +0200)] 
lib-storage: Add a public test-mail-storage-common.h API

Moved the public functions into test-mail-storage-common.c

4 years agolib-storage: test-mail-storage - Die on test_mail_init_user() failure
Timo Sirainen [Thu, 19 Nov 2020 14:13:53 +0000 (16:13 +0200)] 
lib-storage: test-mail-storage - Die on test_mail_init_user() failure

This way the caller won't need to do error handling. The errors were
being handled inconsistently.

4 years agolib-storage: test-mail-storage - Remove randomness from test home directory
Timo Sirainen [Thu, 19 Nov 2020 13:35:07 +0000 (15:35 +0200)] 
lib-storage: test-mail-storage - Remove randomness from test home directory

Also rename test_mail_storage_ctx.mail_home to home_root to better describe
it.

4 years agolib-storage: test-mail-storage - Change test_mail_init() to allocate the struct
Timo Sirainen [Thu, 19 Nov 2020 13:32:20 +0000 (15:32 +0200)] 
lib-storage: test-mail-storage - Change test_mail_init() to allocate the struct

4 years agolib-storage: test-mail-storage - Use settings struct for test_mail_init_user()
Timo Sirainen [Thu, 19 Nov 2020 13:29:01 +0000 (15:29 +0200)] 
lib-storage: test-mail-storage - Use settings struct for test_mail_init_user()

4 years agolib: i_stream_read() - Don't create empty snapshots
Timo Sirainen [Thu, 22 Oct 2020 09:22:40 +0000 (12:22 +0300)] 
lib: i_stream_read() - Don't create empty snapshots

This allows the read() implementation to read data into the existing
memarea. Otherwise a new memarea might have to be created because the old
one is referenced by the snapshot.

4 years agoimap: Process title wrongly shows connections are "corked"
Timo Sirainen [Thu, 29 Oct 2020 11:35:35 +0000 (13:35 +0200)] 
imap: Process title wrongly shows connections are "corked"

The flush callback in ostream-file always corks the connection, so the
process title needs to be delayed until it's no longer in that callback.
Add a 0-timeout to update the process title.

4 years agolib-lua: Rewrite arg checking macros to use STMT_{START,END}
Josef 'Jeff' Sipek [Wed, 25 Nov 2020 16:03:57 +0000 (11:03 -0500)] 
lib-lua: Rewrite arg checking macros to use STMT_{START,END}

This makes it safer to use.  Additionally, this commit adds some newlines to
the macro definition to make it more readable.

4 years agologin-proxy: Use persistent istream buffers
Timo Sirainen [Tue, 10 Nov 2020 14:10:05 +0000 (16:10 +0200)] 
login-proxy: Use persistent istream buffers

Constantly freeing and allocating the memory is a bit slow, but because
Dovecot allocates all memory with calloc() the memory cleaing is especially
slow. With this change proxying lots of data in a plaintext connection
takes about 50% less CPU. The downside is that it uses about 4 kB more
memory per istream (8 kB total, for both client and server connections),
but that shouldn't be too bad for proxies since they don't use much memory
otherwise.

4 years agolib-mail: test-istream-qp-decoder.c - Free input_data_limited
Martti Rannanjärvi [Wed, 2 Dec 2020 04:06:59 +0000 (06:06 +0200)] 
lib-mail: test-istream-qp-decoder.c - Free input_data_limited

4 years agolib-http: http-client-request - Fix payload assertions in http_client_request_send_mo...
Stephan Bosch [Tue, 1 Dec 2020 09:25:09 +0000 (10:25 +0100)] 
lib-http: http-client-request - Fix payload assertions in http_client_request_send_more().

When the request payload is finished, both req->payload_input and
req->payload_output could be NULL, so the assertions on those being not NULL
need to happen after the check for req->payload_finished.

This particularly causes problems with the
blocking http_client_request_send/finish_payload() API, which constantly
modifies req->payload_input and sets it to NULL to finish the output.

This caused a panic:

Panic: file http-client-request.c: line 1232 (http_client_request_send_more): assertion failed: (req->payload_input != NULL)

4 years agolib-http: test-http-payload - Add test for blocking client output payload.
Stephan Bosch [Wed, 4 Apr 2018 13:18:51 +0000 (15:18 +0200)] 
lib-http: test-http-payload - Add test for blocking client output payload.

4 years agolib-http: test-http-payload - Implement reference counting for client request.
Stephan Bosch [Wed, 4 Apr 2018 01:02:24 +0000 (03:02 +0200)] 
lib-http: test-http-payload - Implement reference counting for client request.

4 years agolib-http: Reformat http-client-request.c.
Stephan Bosch [Sat, 27 Jun 2020 16:48:40 +0000 (18:48 +0200)] 
lib-http: Reformat http-client-request.c.

4 years agonotify: Free notify_mail_txn when a plugin does not define mail_transaction_commit
Martti Rannanjärvi [Tue, 25 Feb 2020 11:08:21 +0000 (13:08 +0200)] 
notify: Free notify_mail_txn when a plugin does not define mail_transaction_commit

4 years agolib-mail: Add tests for message-size functions
Markus Valentin [Fri, 6 Nov 2020 10:47:18 +0000 (11:47 +0100)] 
lib-mail: Add tests for message-size functions

Integrate testing of header and body size to existing tests and add new
tests specifically for message-size.

4 years agolib-mail: Extend quoted-printable encoding tests
Markus Valentin [Mon, 9 Nov 2020 11:35:09 +0000 (12:35 +0100)] 
lib-mail: Extend quoted-printable encoding tests

4 years agolib-mail: Extend quoted-printable decoding tests
Markus Valentin [Wed, 4 Nov 2020 13:38:10 +0000 (14:38 +0100)] 
lib-mail: Extend quoted-printable decoding tests

4 years agolib-mail: qp-encoder: Ensure trailing white space is followed by printable
Markus Valentin [Thu, 19 Nov 2020 12:30:54 +0000 (13:30 +0100)] 
lib-mail: qp-encoder: Ensure trailing white space is followed by printable

In case a qp-encoded line ends with space or tab append a soft line
break to prevent white space being cut off by decoding instance.

4 years agolib-mail: test-message-parser - Convert to signed when calculating variance
Aki Tuomi [Thu, 19 Nov 2020 13:32:00 +0000 (15:32 +0200)] 
lib-mail: test-message-parser - Convert to signed when calculating variance

Satisfies runtime analyser, broken in 6b60e5ed490

4 years agolib-mail: message-decoder - Fix CTE parser to accept only syntaxically valid values
Aki Tuomi [Wed, 18 Nov 2020 07:43:07 +0000 (09:43 +0200)] 
lib-mail: message-decoder - Fix CTE parser to accept only syntaxically valid values

4 years agolib-mail: test-rfc822-parser - Add tests for content-type full parsing
Aki Tuomi [Tue, 17 Nov 2020 07:29:30 +0000 (09:29 +0200)] 
lib-mail: test-rfc822-parser - Add tests for content-type full parsing

4 years agolib-mail: message-decoder - Constify message_decoder_parse_cte parameter
Aki Tuomi [Wed, 18 Nov 2020 07:31:03 +0000 (09:31 +0200)] 
lib-mail: message-decoder - Constify message_decoder_parse_cte parameter

4 years agolib-mail: rfc822-parser - Fix content-type parser to accept only valid values
Aki Tuomi [Mon, 16 Nov 2020 14:20:30 +0000 (16:20 +0200)] 
lib-mail: rfc822-parser - Fix content-type parser to accept only valid values

4 years agoimap: Fix potential hang if client disconnects with pipelined ambiguous commands
Timo Sirainen [Thu, 29 Oct 2020 10:55:21 +0000 (12:55 +0200)] 
imap: Fix potential hang if client disconnects with pipelined ambiguous commands

For example if client pipelines FETCH+LOGOUT commands and disconnects during
a large FETCH output, the LOGOUT command is processed as waiting for
unambiguity. This code path however doesn't detect a client disconnection,
and input IO handler is removed so it can't detect it either. So the imap
process hangs.

4 years agoimap: Move disconnected-check inside client_continue_pending_input()
Timo Sirainen [Thu, 29 Oct 2020 10:52:16 +0000 (12:52 +0200)] 
imap: Move disconnected-check inside client_continue_pending_input()

This way all of its callers don't have to check if the client is
disconnected.

4 years agolib-storage: Update comments about mail_search_args_init() and refcount handling
Timo Sirainen [Thu, 19 Nov 2020 09:00:43 +0000 (11:00 +0200)] 
lib-storage: Update comments about mail_search_args_init() and refcount handling

4 years agodoveadm: Add timestamp prefixes for debug output
Siavash Tavakoli [Mon, 23 Nov 2020 12:17:52 +0000 (12:17 +0000)] 
doveadm: Add timestamp prefixes for debug output

But still allow overriding from env by setting LOG_STDERR_TIMESTAMP.

4 years agolib-dict: dict_iterate() - Fix segfault with DICT_ITERATE_FLAG_NO_VALUE
Timo Sirainen [Mon, 23 Nov 2020 16:15:57 +0000 (18:15 +0200)] 
lib-dict: dict_iterate() - Fix segfault with DICT_ITERATE_FLAG_NO_VALUE

Broken by cf0d196c2b373a37bc1ab4e10fde89fb61089f3c

4 years agodict-cdb: Fix to use new dict.iterate() API
Timo Sirainen [Mon, 23 Nov 2020 14:49:49 +0000 (16:49 +0200)] 
dict-cdb: Fix to use new dict.iterate() API

Forgot in 65b7f04f945781cd042f5ad2f6f104f532143ee7

4 years agom4: size_t_signed.m4 - use static assertion instead of run test
rofl0r [Fri, 22 Nov 2019 01:17:32 +0000 (01:17 +0000)] 
m4: size_t_signed.m4 - use static assertion instead of run test

a small step towards cross-compile-ability.

4 years agolib-index: Improve debug logging
Timo Sirainen [Mon, 10 Aug 2020 17:18:48 +0000 (20:18 +0300)] 
lib-index: Improve debug logging

4 years agolib-index: Handle rapidly rotating transaction logs without unnecessary fsck
Timo Sirainen [Mon, 10 Aug 2020 17:16:30 +0000 (20:16 +0300)] 
lib-index: Handle rapidly rotating transaction logs without unnecessary fsck

4 years agolib-index: mail_index_reopen_if_changed() - Add reopened_r parameter
Timo Sirainen [Mon, 10 Aug 2020 15:00:09 +0000 (18:00 +0300)] 
lib-index: mail_index_reopen_if_changed() - Add reopened_r parameter

4 years agolib-index: mail_index_sync_map() - Move corruption handling to caller
Timo Sirainen [Mon, 10 Aug 2020 14:53:08 +0000 (17:53 +0300)] 
lib-index: mail_index_sync_map() - Move corruption handling to caller

4 years agolib-index: mail_index_map_latest_sync() - Minor refactoring
Timo Sirainen [Mon, 10 Aug 2020 14:45:08 +0000 (17:45 +0300)] 
lib-index: mail_index_map_latest_sync() - Minor refactoring

4 years agolib-index: Split off mail_index_map_latest_sync()
Timo Sirainen [Mon, 10 Aug 2020 14:43:50 +0000 (17:43 +0300)] 
lib-index: Split off mail_index_map_latest_sync()

4 years agolib-index: mail_index_sync_map() - Always return -1 on I/O failures
Timo Sirainen [Mon, 10 Aug 2020 14:33:07 +0000 (17:33 +0300)] 
lib-index: mail_index_sync_map() - Always return -1 on I/O failures

Even though with force=FALSE in theory it would be possible to work around
it, but more likely it will just cause another I/O error. This simplifies
the code for the following changes.

4 years agolib-index: Move calling mail_index_sync_map_want_index_reopen() to mail_index_map()
Timo Sirainen [Mon, 10 Aug 2020 14:31:27 +0000 (17:31 +0300)] 
lib-index: Move calling mail_index_sync_map_want_index_reopen() to mail_index_map()

4 years agolib-index: Split off mail_index_sync_map_want_index_reopen()
Timo Sirainen [Mon, 10 Aug 2020 14:29:44 +0000 (17:29 +0300)] 
lib-index: Split off mail_index_sync_map_want_index_reopen()

4 years agolib-index: mail_transaction_log_indexid_changed() - Clarify refcount handling
Timo Sirainen [Mon, 10 Aug 2020 17:02:22 +0000 (20:02 +0300)] 
lib-index: mail_transaction_log_indexid_changed() - Clarify refcount handling

Although the old code worked as well, it wasn't so obvious since the
behavior was slightly different when the log->head had extra references.
Clarify the behavior by always unreferencing after the new log file is
created.

4 years agolib-index: mail_transaction_log_file_free() - Assert that refcount=0
Timo Sirainen [Mon, 10 Aug 2020 17:09:41 +0000 (20:09 +0300)] 
lib-index: mail_transaction_log_file_free() - Assert that refcount=0

4 years agolib-index: mail_index_write() - Make sure index is rewritten after log rotation
Timo Sirainen [Mon, 10 Aug 2020 16:59:36 +0000 (19:59 +0300)] 
lib-index: mail_index_write() - Make sure index is rewritten after log rotation

Otherwise the index will point to .log.2 file, which could become deleted
before the index is rewritten again.

4 years agolib-index: mail_transaction_log_view_set() - Make sure log files aren't freed too...
Timo Sirainen [Mon, 10 Aug 2020 16:54:55 +0000 (19:54 +0300)] 
lib-index: mail_transaction_log_view_set() - Make sure log files aren't freed too early

It's possible that mail_transaction_log_find_file() frees one of the files
that are already in the linked list. Avoid it by referencing the file
immediately when it's added to the list.

4 years agolib-index: test-mail-transaction-log-view - Move test_transaction_log_file_add()
Timo Sirainen [Thu, 12 Nov 2020 16:01:18 +0000 (18:01 +0200)] 
lib-index: test-mail-transaction-log-view - Move test_transaction_log_file_add()

4 years agolib-index: mail_transaction_log_view_set() - Return -1 only on I/O error
Timo Sirainen [Mon, 10 Aug 2020 14:12:32 +0000 (17:12 +0300)] 
lib-index: mail_transaction_log_view_set() - Return -1 only on I/O error

The callers that care about the difference:

 * mail_index_sync_map() already assumes that -1 means I/O error
 * mail_index_sync_set_log_view() handles 0 by logging an error and fscking
   the index, which is likely better than just returning failure.
 * view_sync_set_log_view_range()'s caller handles 0 by rebuilding the
   missing changes in memory. So returning 0 makes it work better.
 * dsync_log_set() and mailbox_get_expunges_init() have fallbacks for
   handling 0, while -1 would just return an error.

4 years agolib-index: mail_transaction_log_file_get_highest_modseq_at() - Separate I/O errors...
Timo Sirainen [Mon, 10 Aug 2020 14:06:05 +0000 (17:06 +0300)] 
lib-index: mail_transaction_log_file_get_highest_modseq_at() - Separate I/O errors from corruption

4 years agolib: Add data_stack_get_used_size()
Timo Sirainen [Fri, 13 Nov 2020 17:30:29 +0000 (19:30 +0200)] 
lib: Add data_stack_get_used_size()

Mainly for debugging purposes.

4 years agodoveadm dict iter: Support printing multiple values
Timo Sirainen [Tue, 17 Nov 2020 15:26:28 +0000 (17:26 +0200)] 
doveadm dict iter: Support printing multiple values

4 years agodict-sql: Support dict_iterate_values()
Timo Sirainen [Tue, 17 Nov 2020 12:41:31 +0000 (14:41 +0200)] 
dict-sql: Support dict_iterate_values()

4 years agodict, dict-client: Support dict_iterate_values()
Timo Sirainen [Tue, 17 Nov 2020 12:24:57 +0000 (14:24 +0200)] 
dict, dict-client: Support dict_iterate_values()

This doesn't change the dict client protocol in an incompatible way, so it's
possible to mix old/new client/server.

4 years agolib-dict: Add dict_iterate_values()
Timo Sirainen [Tue, 17 Nov 2020 12:20:40 +0000 (14:20 +0200)] 
lib-dict: Add dict_iterate_values()

4 years agolib-dict: Change dict.iterate() API to support returning multiple values
Timo Sirainen [Tue, 17 Nov 2020 12:09:30 +0000 (14:09 +0200)] 
lib-dict: Change dict.iterate() API to support returning multiple values

This requires changes to all dict drivers.

4 years agolib-dict: dict_iterate() - Always return NULL if DICT_ITERATE_FLAG_NO_VALUE is used
Timo Sirainen [Tue, 17 Nov 2020 12:30:27 +0000 (14:30 +0200)] 
lib-dict: dict_iterate() - Always return NULL if DICT_ITERATE_FLAG_NO_VALUE is used

This way it behaves more consistently across backends.

4 years agodoveadm: mail: doveadm_mail_failed_error() - Set specific exit code for MAIL_ERROR_INUSE
Markus Valentin [Fri, 20 Nov 2020 11:52:47 +0000 (12:52 +0100)] 
doveadm: mail: doveadm_mail_failed_error() - Set specific exit code for MAIL_ERROR_INUSE

Set exit code DOVEADM_EX_NOTPOSSIBLE in case MAIL_ERROR_INUSE is set via
doveadm_mail_failed_error(). This exit code is used to indicate that a
operation cannot be done because another session prevents it.

4 years agodoveadm: When sending server logs to client, make sure ioloop isn't set to NULL
Timo Sirainen [Fri, 20 Nov 2020 10:15:18 +0000 (12:15 +0200)] 
doveadm: When sending server logs to client, make sure ioloop isn't set to NULL

This could have happened if there was any logging done outside command
handling. For example a doveadm command used http-client, which has a
timeout that triggers logging only after the command is finished.

Fixes segfault and:
Panic: file http-client.c: line 642 (http_client_context_close): assertion failed: (cctx->clients_list == NULL)

4 years agolib-lua: Don't add system libs to libdovecot_lua_la_DEPENDENCIES
Josef 'Jeff' Sipek [Fri, 20 Nov 2020 17:23:21 +0000 (12:23 -0500)] 
lib-lua: Don't add system libs to libdovecot_lua_la_DEPENDENCIES

This confuses the build system, causing it to think that it needs to build
those.  This manifests itself as:

make: *** No rule to make target '-L/usr/lib/x86_64-linux-gnu', needed by 'libdovecot-lua.la'.  Stop.

4 years agoimap: Fix memory leak in get_expunges_fallback()
sergey.kitov [Thu, 19 Nov 2020 20:07:37 +0000 (22:07 +0200)] 
imap: Fix memory leak in get_expunges_fallback()

4 years agolib: test-file-cache - Use memcmp
Aki Tuomi [Fri, 11 Sep 2020 13:06:46 +0000 (16:06 +0300)] 
lib: test-file-cache - Use memcmp

Data is not null-terminated, so use memcmp.

4 years agolib: test-file-cache - Assert map value
Aki Tuomi [Fri, 11 Sep 2020 11:11:55 +0000 (14:11 +0300)] 
lib: test-file-cache - Assert map value

Satisfies static analyser

4 years agolib: event-filter-parser - Test simple but invalid input
Josef 'Jeff' Sipek [Thu, 12 Nov 2020 19:15:54 +0000 (14:15 -0500)] 
lib: event-filter-parser - Test simple but invalid input

4 years agolib: event-filter - Do not assert that there in no output on error
Josef 'Jeff' Sipek [Thu, 12 Nov 2020 18:49:49 +0000 (13:49 -0500)] 
lib: event-filter - Do not assert that there in no output on error

When the input is a simple (but invalid) expression (e.g., a=b=c) the output
variable may be set.  This is perfectly fine.

The assertion (and the associated failure) come from when event filter
parsing was switched to the new filter syntax
(fcba1d530737813de11d9d730d5db6496e2e574b).

4 years agostats: openmetrics - Include submetric name only when present
Josef 'Jeff' Sipek [Mon, 19 Oct 2020 17:47:10 +0000 (13:47 -0400)] 
stats: openmetrics - Include submetric name only when present

Otherwise we SIGSEGV.

4 years agodsync: Fix UID renumbering when GUIDs aren't used
Timo Sirainen [Tue, 10 Nov 2020 22:11:35 +0000 (00:11 +0200)] 
dsync: Fix UID renumbering when GUIDs aren't used

Mails that have local UIDs won't be in import_uids hash table, so they're
not otherwise being iterated at the end and checked if they need
renumbering.

4 years agodsync: Incremental sync sometimes missed messages when GUIDs weren't available
Timo Sirainen [Tue, 10 Nov 2020 17:57:26 +0000 (19:57 +0200)] 
dsync: Incremental sync sometimes missed messages when GUIDs weren't available

GUIDs aren't available when using imapc, so this affected migrations.

4 years ago.gitignore: Ignore coverage and temp files
Aki Tuomi [Mon, 9 Nov 2020 07:04:36 +0000 (09:04 +0200)] 
.gitignore: Ignore coverage and temp files

4 years agolib-mail: test-message-part-serialize - Add tests
Aki Tuomi [Thu, 5 Nov 2020 10:08:38 +0000 (12:08 +0200)] 
lib-mail: test-message-part-serialize - Add tests

4 years agolib-mail: test-message-header-parser - Validate header value
Aki Tuomi [Wed, 4 Nov 2020 13:10:04 +0000 (15:10 +0200)] 
lib-mail: test-message-header-parser - Validate header value

4 years agolib-mail: test-message-header-parser - Test NUL bytes in header
Aki Tuomi [Wed, 4 Nov 2020 13:09:45 +0000 (15:09 +0200)] 
lib-mail: test-message-header-parser - Test NUL bytes in header

4 years agolib-mail: test-message-header-decode - Add more tests
Aki Tuomi [Wed, 4 Nov 2020 10:35:16 +0000 (12:35 +0200)] 
lib-mail: test-message-header-decode - Add more tests

4 years agolib-mail: test-message-header-decode - Use libcharset
Aki Tuomi [Wed, 4 Nov 2020 10:34:57 +0000 (12:34 +0200)] 
lib-mail: test-message-header-decode - Use libcharset

Otherwise we can only test utf-8

4 years agolib-mail: test-message-search - Add more message searching tests
Aki Tuomi [Tue, 3 Nov 2020 13:17:45 +0000 (15:17 +0200)] 
lib-mail: test-message-search - Add more message searching tests