]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
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

4 years agolib-mail: test-mail-user-hash - Add tests for mail_user_hash
Aki Tuomi [Mon, 2 Nov 2020 18:59:18 +0000 (20:59 +0200)] 
lib-mail: test-mail-user-hash - Add tests for mail_user_hash

4 years agolib-mail: test-message-decoder - Add charset conversion test
Aki Tuomi [Mon, 2 Nov 2020 18:06:28 +0000 (20:06 +0200)] 
lib-mail: test-message-decoder - Add charset conversion test

4 years agolib-mail: test-message-decoder - Test Content-Transfer-Encoding
Aki Tuomi [Mon, 2 Nov 2020 16:38:32 +0000 (18:38 +0200)] 
lib-mail: test-message-decoder - Test Content-Transfer-Encoding

4 years agolib-mail: test-message-parser - Add tests for MIME-Version header
Aki Tuomi [Mon, 2 Nov 2020 11:46:12 +0000 (13:46 +0200)] 
lib-mail: test-message-parser - Add tests for MIME-Version header

4 years agolib-mail: test-* - Add missing test_assert
Aki Tuomi [Mon, 9 Nov 2020 07:29:26 +0000 (09:29 +0200)] 
lib-mail: test-* - Add missing test_assert

Need to ensure stream did not fail during parsing.

4 years agolib-mail: test-message-parser - Use message_part_is_equal
Aki Tuomi [Mon, 9 Nov 2020 07:22:28 +0000 (09:22 +0200)] 
lib-mail: test-message-parser - Use message_part_is_equal

Replace msg_parts_cmp with message_part_is_equal.

4 years agolib-mail: test-message-parser - Refactor message parsing to utility function
Aki Tuomi [Mon, 2 Nov 2020 11:15:24 +0000 (13:15 +0200)] 
lib-mail: test-message-parser - Refactor message parsing to utility function

Makes next changes easier.

4 years agolib-mail: Add message_part_is_equal
Aki Tuomi [Mon, 9 Nov 2020 07:16:27 +0000 (09:16 +0200)] 
lib-mail: Add message_part_is_equal

Returns TRUE if two parts are equal.

4 years agoconfigure.ac: Finish removing vpopmail support
Timo Sirainen [Wed, 11 Nov 2020 09:09:02 +0000 (11:09 +0200)] 
configure.ac: Finish removing vpopmail support

4 years agolib-storage: Add prefix to failed mailbox list index rebuild error messages
Timo Sirainen [Tue, 27 Oct 2020 13:12:19 +0000 (15:12 +0200)] 
lib-storage: Add prefix to failed mailbox list index rebuild error messages

This makes it clearer that the failure is happening because index was being
rebuilt.

4 years agolib-storage: Fix error message when mailbox list index rebuild fails
Timo Sirainen [Tue, 27 Oct 2020 13:13:39 +0000 (15:13 +0200)] 
lib-storage: Fix error message when mailbox list index rebuild fails

The error needs to be copied to mailbox_list, otherwise it's just
"Unknown internal list error".

4 years agolib-storage: Fix mailbox list iteration error handling for INBOX
Timo Sirainen [Tue, 27 Oct 2020 13:11:12 +0000 (15:11 +0200)] 
lib-storage: Fix mailbox list iteration error handling for INBOX

If INBOX isn't in the first namespace, the error wasn't correctly set for
it.

4 years agolib-storage: Use mailbox_get_last_mail_error() for mailbox_get_path_to() errors
Timo Sirainen [Tue, 27 Oct 2020 13:08:15 +0000 (15:08 +0200)] 
lib-storage: Use mailbox_get_last_mail_error() for mailbox_get_path_to() errors

mailbox_list_get_last_error() happens to work currently, but it's
accidental.

4 years agolib-index: Fix detecting if index is undeleted
Timo Sirainen [Mon, 2 Nov 2020 16:55:16 +0000 (18:55 +0200)] 
lib-index: Fix detecting if index is undeleted

It was possible that mail_index_is_deleted() kept returning that the index
was deleted, even if it was marked as undeleted. This happened when the
deletion was in dovecot.index.log.2, undeletion in dovecot.index.log and
dovecot.index pointed to the .log.2 file. This caused the .log file to be
read first, which sees the undeletion. Later on the .log.2 was parsed and
it marked the index back as deleted.

4 years agolib-fts: Avoid NULL pointer arithmetic
Timo Sirainen [Mon, 9 Nov 2020 23:30:06 +0000 (01:30 +0200)] 
lib-fts: Avoid NULL pointer arithmetic

Even though it was only doing +0. Fixes:
runtime error: applying zero offset to null pointer

4 years agolib-smtp: smtp_address_init_from_msg() - Avoid implicit char to unsigned char conversion
Timo Sirainen [Mon, 9 Nov 2020 16:10:21 +0000 (18:10 +0200)] 
lib-smtp: smtp_address_init_from_msg() - Avoid implicit char to unsigned char conversion

Fixes calling smtp_char_is_qpair() with ubsan:
runtime error: implicit conversion from type 'char' of value -61 (8-bit, signed) to type 'unsigned char' changed the value to 195 (8-bit, unsigned)

4 years agolib-index: Add explicit wrapping to 8bit variable increments
Timo Sirainen [Mon, 9 Nov 2020 15:52:51 +0000 (17:52 +0200)] 
lib-index: Add explicit wrapping to 8bit variable increments

Fixes ubsan errors:
runtime error: implicit conversion from type 'int' of value 256 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned)

4 years agolib: istream-concat - Avoid NULL pointer arithmetic
Timo Sirainen [Mon, 9 Nov 2020 15:38:26 +0000 (17:38 +0200)] 
lib: istream-concat - Avoid NULL pointer arithmetic

Even though it was only doing +0. Fixes:
runtime error: applying zero offset to null pointer