]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
5 years agolib-http: test-http-payload - Use client request object for test_client_download_fini...
Stephan Bosch [Wed, 4 Apr 2018 01:18:55 +0000 (03:18 +0200)] 
lib-http: test-http-payload - Use client request object for test_client_download_finished() rather than index.

5 years agolib-http: test-http-payload - echo: Manage active requests asynchronously.
Stephan Bosch [Wed, 4 Apr 2018 08:10:09 +0000 (10:10 +0200)] 
lib-http: test-http-payload - echo: Manage active requests asynchronously.

5 years agolib-http: test-http-payload - Rename client request file stream field to 'file_in'.
Stephan Bosch [Wed, 4 Apr 2018 01:10:58 +0000 (03:10 +0200)] 
lib-http: test-http-payload - Rename client request file stream field to 'file_in'.

This is the stream used to compare against the incoming payload (either download or echo).

5 years agolib-http: test-http-payload - Group test settings into a common struct.
Stephan Bosch [Sun, 25 Mar 2018 20:02:33 +0000 (22:02 +0200)] 
lib-http: test-http-payload - Group test settings into a common struct.

Allows reliable initialization.

5 years agolib-http: test-http-payload - Add log prefixes to distinguish client and server debug...
Stephan Bosch [Tue, 20 Mar 2018 18:16:33 +0000 (19:16 +0100)] 
lib-http: test-http-payload - Add log prefixes to distinguish client and server debug messages.

5 years agolib-http: test-http-payload - Only switch ioloop for progress timeout when it is...
Stephan Bosch [Wed, 4 Apr 2018 08:25:59 +0000 (10:25 +0200)] 
lib-http: test-http-payload - Only switch ioloop for progress timeout when it is running.

5 years agolib-http: test-http-payload - Do not continue running ioloop when failure occurred.
Stephan Bosch [Wed, 4 Apr 2018 08:18:41 +0000 (10:18 +0200)] 
lib-http: test-http-payload - Do not continue running ioloop when failure occurred.

5 years agolib-http: test-http-payload - echo: Add debug message for when incoming payload is...
Stephan Bosch [Wed, 4 Apr 2018 11:58:00 +0000 (13:58 +0200)] 
lib-http: test-http-payload - echo: Add debug message for when incoming payload is finished.

5 years agolib-http: test-http-payload - echo: Properly handle empty payload.
Stephan Bosch [Wed, 4 Apr 2018 11:56:15 +0000 (13:56 +0200)] 
lib-http: test-http-payload - echo: Properly handle empty payload.

5 years agolib-http: Reformat test-http-payload.c.
Stephan Bosch [Wed, 4 Apr 2018 11:27:53 +0000 (13:27 +0200)] 
lib-http: Reformat test-http-payload.c.

5 years agolib-http: http-server-connection - Fix http_server_connection_flush() return value.
Stephan Bosch [Sun, 17 Nov 2019 23:11:43 +0000 (00:11 +0100)] 
lib-http: http-server-connection - Fix http_server_connection_flush() return value.

5 years agolib-http: http-server-connection - Add support for switching to an explicit ioloop.
Stephan Bosch [Sat, 9 Nov 2019 09:47:22 +0000 (10:47 +0100)] 
lib-http: http-server-connection - Add support for switching to an explicit ioloop.

5 years agolib: iostream-pump - Add support for switching to an explicit ioloop.
Stephan Bosch [Sat, 9 Nov 2019 09:47:04 +0000 (10:47 +0100)] 
lib: iostream-pump - Add support for switching to an explicit ioloop.

5 years agolib-http: http-server-request - Fix blocking payload input stream error handling.
Stephan Bosch [Sun, 25 Mar 2018 18:03:47 +0000 (20:03 +0200)] 
lib-http: http-server-request - Fix blocking payload input stream error handling.

5 years agolib-http: http-message parser - Improve error for invalid payload.
Stephan Bosch [Tue, 20 Mar 2018 01:27:19 +0000 (02:27 +0100)] 
lib-http: http-message parser - Improve error for invalid payload.

Add the textual error from the payload stream (chunked transfer).

5 years agolib-http: http-message parser - Refer to message payload rather than response payload...
Stephan Bosch [Mon, 19 Mar 2018 18:16:11 +0000 (19:16 +0100)] 
lib-http: http-message parser - Refer to message payload rather than response payload in error message.

The message parser is used for both requests and responses.

5 years agolib-http: Restructure http-message-parser.c.
Stephan Bosch [Thu, 27 Feb 2020 00:24:03 +0000 (01:24 +0100)] 
lib-http: Restructure http-message-parser.c.

Reduce line length.

5 years agolib-http: Reformat http-message-parser.c.
Stephan Bosch [Wed, 26 Feb 2020 23:24:54 +0000 (00:24 +0100)] 
lib-http: Reformat http-message-parser.c.

5 years agolib-http: http-transfer-chunked - Don't implicitly finish the output stream upon...
Stephan Bosch [Thu, 27 Feb 2020 20:48:14 +0000 (21:48 +0100)] 
lib-http: http-transfer-chunked - Don't implicitly finish the output stream upon o_stream_close().

5 years agolib-http: http-server-response - Properly finish the payload output stream asynchrono...
Stephan Bosch [Sat, 9 Nov 2019 12:31:52 +0000 (13:31 +0100)] 
lib-http: http-server-response - Properly finish the payload output stream asynchronously.

Payload output handling is finished only after the stream is finished and
flushed completely.

5 years agolib-http: http-client-request - Properly finish the payload output stream asynchronously.
Stephan Bosch [Tue, 20 Mar 2018 19:42:17 +0000 (20:42 +0100)] 
lib-http: http-client-request - Properly finish the payload output stream asynchronously.

Payload output handling is finished only after the stream is finished and
flushed completely.

5 years agolib-http: http-transfer-chunked - Make sending of the trailer chunk in ostream more...
Stephan Bosch [Tue, 20 Mar 2018 17:23:43 +0000 (18:23 +0100)] 
lib-http: http-transfer-chunked - Make sending of the trailer chunk in ostream more reliable.

Use the new o_stream_finish() functionality.

5 years agolib-http: http-transfer-chunked - Add assertions to ensure that the chunk istream...
Stephan Bosch [Tue, 20 Mar 2018 17:39:32 +0000 (18:39 +0100)] 
lib-http: http-transfer-chunked - Add assertions to ensure that the chunk istream position is valid.

5 years agolib-http: Reformat http-client-connection.c.
Stephan Bosch [Tue, 20 Mar 2018 19:58:30 +0000 (20:58 +0100)] 
lib-http: Reformat http-client-connection.c.

5 years agolib-http: Reformat http-transfer-chunked.c.
Stephan Bosch [Tue, 12 Nov 2019 01:45:52 +0000 (02:45 +0100)] 
lib-http: Reformat http-transfer-chunked.c.

5 years agolib-http: http-server-response - Prevent response content stream from finishing the...
Stephan Bosch [Thu, 5 Jul 2018 22:01:14 +0000 (00:01 +0200)] 
lib-http: http-server-response - Prevent response content stream from finishing the connection output stream.

This is not supposed to happen ever, because the connection output stream needs
to be available for several responses. This was at some point a problem in some
of the test with the new ostream payload API.

5 years agolib-http: http-client-request - Prevent request content stream from finishing the...
Stephan Bosch [Thu, 5 Jul 2018 21:52:51 +0000 (23:52 +0200)] 
lib-http: http-client-request - Prevent request content stream from finishing the connection output stream.

This is not supposed to happen ever, because the connection output stream needs
to be available for several requests. This was at some point a problem in some
of the test with the new ostream payload API.

5 years agolib: ostream - Use local variable for stream rather than pointer in o_stream_destroy().
Stephan Bosch [Fri, 22 Nov 2019 18:51:15 +0000 (19:51 +0100)] 
lib: ostream - Use local variable for stream rather than pointer in o_stream_destroy().

Problem is that a destroy callback can mess with the pointer, leading to all kinds of trouble.

5 years agostats: Export sub-metrics for openmetrics
Aki Tuomi [Mon, 17 Feb 2020 09:10:46 +0000 (11:10 +0200)] 
stats: Export sub-metrics for openmetrics

5 years agostats: stats-service-openmetrics.c - Fix whitespace formatting
Aki Tuomi [Mon, 17 Feb 2020 11:19:16 +0000 (13:19 +0200)] 
stats: stats-service-openmetrics.c - Fix whitespace formatting

5 years agostats: stats-service - Add support for OpenMetrics/Prometheus.
Stephan Bosch [Sun, 17 Nov 2019 09:55:49 +0000 (10:55 +0100)] 
stats: stats-service - Add support for OpenMetrics/Prometheus.

5 years agostats: Add stats exporter service infrastructure.
Stephan Bosch [Thu, 14 Nov 2019 23:34:32 +0000 (00:34 +0100)] 
stats: Add stats exporter service infrastructure.

5 years agostats: Add HTTP server support.
Stephan Bosch [Thu, 14 Nov 2019 23:32:00 +0000 (00:32 +0100)] 
stats: Add HTTP server support.

5 years agostats: stats-metrics - Associate each metric with its corresponding metric settings.
Stephan Bosch [Thu, 14 Nov 2019 23:28:18 +0000 (00:28 +0100)] 
stats: stats-metrics - Associate each metric with its corresponding metric settings.

5 years agostats: Make service startup time available as a global variable.
Stephan Bosch [Thu, 14 Nov 2019 23:24:03 +0000 (00:24 +0100)] 
stats: Make service startup time available as a global variable.

5 years agostats: Make metrics struct a global variable.
Stephan Bosch [Thu, 14 Nov 2019 22:57:19 +0000 (23:57 +0100)] 
stats: Make metrics struct a global variable.

5 years agostats: Make settings available as a global variable.
Stephan Bosch [Thu, 14 Nov 2019 23:08:15 +0000 (00:08 +0100)] 
stats: Make settings available as a global variable.

5 years agostats: Create stats-common.h.
Stephan Bosch [Thu, 14 Nov 2019 23:05:29 +0000 (00:05 +0100)] 
stats: Create stats-common.h.

5 years agolib-http: http-server-request - Add http_server_request_fail_bad_method().
Stephan Bosch [Tue, 19 Nov 2019 00:34:06 +0000 (01:34 +0100)] 
lib-http: http-server-request - Add http_server_request_fail_bad_method().

5 years agolib-http: http-url - Add http_url_init_authority_from().
Stephan Bosch [Sun, 17 Nov 2019 14:01:26 +0000 (15:01 +0100)] 
lib-http: http-url - Add http_url_init_authority_from().

5 years agostats: stats-settings - Add description setting for metrics.
Stephan Bosch [Thu, 14 Nov 2019 22:33:49 +0000 (23:33 +0100)] 
stats: stats-settings - Add description setting for metrics.

5 years agolib-http: http-server - Implement support for dynamically adding resources.
Stephan Bosch [Fri, 8 Nov 2019 16:11:36 +0000 (17:11 +0100)] 
lib-http: http-server - Implement support for dynamically adding resources.

Before, the application would get all requests through a single main callback
and the application was always responsible for mapping request targets to a
particular application-defined HTTP resource. Now, an application can receive
requests for a certain HTTP resource through a separately-registered resource
object, which allows dynamic configuration of server resources. This way, e.g.
a generic HTTP service with several separate 'drivers' or plugin support for an
HTTP service can be implemented more easily.

5 years agolib-http: http-server-request - Provide default response for OPTIONS * request.
Stephan Bosch [Sun, 17 Nov 2019 13:28:37 +0000 (14:28 +0100)] 
lib-http: http-server-request - Provide default response for OPTIONS * request.

5 years agolib-http: http-server-connection - Run request callback in new datastack frame.
Stephan Bosch [Sun, 17 Nov 2019 09:52:52 +0000 (10:52 +0100)] 
lib-http: http-server-connection - Run request callback in new datastack frame.

5 years agolib-http: http-server-connection - Restructure request callback handling.
Stephan Bosch [Fri, 8 Nov 2019 16:11:36 +0000 (17:11 +0100)] 
lib-http: http-server-connection - Restructure request callback handling.

Move most of it to http-server-request.

5 years agolib-http: server: Replace http_*_debug() with e_debug().
Stephan Bosch [Fri, 8 Nov 2019 16:11:35 +0000 (17:11 +0100)] 
lib-http: server: Replace http_*_debug() with e_debug().

5 years agolib-http: server: Replace http_*_error() with e_error().
Stephan Bosch [Fri, 8 Nov 2019 16:11:34 +0000 (17:11 +0100)] 
lib-http: server: Replace http_*_error() with e_error().

5 years agolib-http: server: Replace i_error() with e_error().
Stephan Bosch [Fri, 8 Nov 2019 16:11:32 +0000 (17:11 +0100)] 
lib-http: server: Replace i_error() with e_error().

5 years agolib-http: server: Remove redundant debug logging checks.
Stephan Bosch [Fri, 8 Nov 2019 16:11:32 +0000 (17:11 +0100)] 
lib-http: server: Remove redundant debug logging checks.

5 years agolib-http: server: Add support for event API.
Stephan Bosch [Fri, 8 Nov 2019 16:11:31 +0000 (17:11 +0100)] 
lib-http: server: Add support for event API.

5 years agolib-http: http-server-request - Make http_server_request_label() a normal function.
Stephan Bosch [Mon, 11 Nov 2019 16:20:48 +0000 (17:20 +0100)] 
lib-http: http-server-request - Make http_server_request_label() a normal function.

5 years agolib-http: Reformat http-server-response.c.
Stephan Bosch [Sat, 9 Nov 2019 08:36:56 +0000 (09:36 +0100)] 
lib-http: Reformat http-server-response.c.

5 years agolib-http: Reformat http-server-request.c.
Stephan Bosch [Fri, 8 Nov 2019 16:11:31 +0000 (17:11 +0100)] 
lib-http: Reformat http-server-request.c.

5 years agolib-http: Reformat http-server-connection.c.
Stephan Bosch [Fri, 8 Nov 2019 16:11:30 +0000 (17:11 +0100)] 
lib-http: Reformat http-server-connection.c.

5 years agolib-http: Reformat http-server-private.h.
Stephan Bosch [Fri, 8 Nov 2019 16:11:29 +0000 (17:11 +0100)] 
lib-http: Reformat http-server-private.h.

5 years agolib-http: Reformat http-server.h.
Stephan Bosch [Fri, 8 Nov 2019 16:11:28 +0000 (17:11 +0100)] 
lib-http: Reformat http-server.h.

5 years agoAdd generated dovecot.service file to .gitignore.
Stephan Bosch [Fri, 17 Apr 2020 14:35:19 +0000 (16:35 +0200)] 
Add generated dovecot.service file to .gitignore.

5 years agolib-index: Fix cache purging when index is being rebuilt
Timo Sirainen [Thu, 16 Apr 2020 12:59:24 +0000 (15:59 +0300)] 
lib-index: Fix cache purging when index is being rebuilt

All the messages until trans->first_new_seq no longer exist after reset.
At best they cause confusion and are ignored. They could also point to
high UIDs that the rebuilding removes, causing further corruption errors.

5 years agolib-storage: index_index_rebuild_init() - Assert-crash if index isn't locked
Timo Sirainen [Thu, 16 Apr 2020 11:46:28 +0000 (14:46 +0300)] 
lib-storage: index_index_rebuild_init() - Assert-crash if index isn't locked

5 years agolib-index: Add mail_index_lock_sync() and mail_index_unlock()
Timo Sirainen [Thu, 16 Apr 2020 11:46:03 +0000 (14:46 +0300)] 
lib-index: Add mail_index_lock_sync() and mail_index_unlock()

5 years agoauth: Implement auth-worker-client per-command events.
Juha-Petri Tyrkkö [Mon, 30 Mar 2020 06:48:32 +0000 (09:48 +0300)] 
auth: Implement auth-worker-client per-command events.

5 years agolib-index: When flushing cache changes to disk, try to also write offsets to transact...
Timo Sirainen [Wed, 1 Apr 2020 19:53:55 +0000 (22:53 +0300)] 
lib-index: When flushing cache changes to disk, try to also write offsets to transaction log

This works as long as there aren't any newly created non-committed mails.

5 years agolib-index: Cache purging shouldn't always change YES decisions to TEMP
Timo Sirainen [Sun, 5 Apr 2020 15:36:44 +0000 (18:36 +0300)] 
lib-index: Cache purging shouldn't always change YES decisions to TEMP

Previously every purging changed YES decision to be changed to TEMP.
This behaved rather badly if a cache file was purged twice within short
time period, because the clients might not have had time to access the
mailbox and change the decision back to YES. That in turn could have
dropped old mails' cached fields even though the client might still want
to use them. (A workaround for this has been to list all useful fields in
mail_always_cache_fields setting.)

The new behavior is to update the last_used field for a YES decision only
when the YES decision has been confirmed. If it's not confirmed for 30
days (mail_cache_unaccessed_field_drop) then its decision is changed to
TEMP on the next purge.

The new behavior also doubles the time when unaccessed field is dropped
from 30 days to 60 days (2*mail_cache_unaccessed_field_drop). This is
needed so that the field isn't dropped too early after YES -> TEMP
decision is changed.

5 years agolib-index: Split off mail_cache_purge_check_field()
Timo Sirainen [Sun, 5 Apr 2020 15:27:17 +0000 (18:27 +0300)] 
lib-index: Split off mail_cache_purge_check_field()

5 years agolib-index: mail_cache_decision_state_update() - Minor refactoring
Timo Sirainen [Sun, 5 Apr 2020 15:09:18 +0000 (18:09 +0300)] 
lib-index: mail_cache_decision_state_update() - Minor refactoring

Simplifies the next commit.

5 years agolib-index: Split off mail_cache_update_last_used()
Timo Sirainen [Sun, 5 Apr 2020 15:10:24 +0000 (18:10 +0300)] 
lib-index: Split off mail_cache_update_last_used()

5 years agolib-oauth2: Fix linking unit tests
Timo Sirainen [Wed, 15 Apr 2020 12:16:24 +0000 (15:16 +0300)] 
lib-oauth2: Fix linking unit tests

Reverses 0b3b67b848d7032ae94b14b3317ff0b6a45a4057, which was wrong because
lib-http requires lib-master. Also libmaster now requires linking with
lib-auth.

5 years agoauth: Fix potential timing attack in verying crypt() results
Timo Sirainen [Wed, 25 Mar 2020 08:48:13 +0000 (10:48 +0200)] 
auth: Fix potential timing attack in verying crypt() results

Probably impractical attack in any case, but lets do this just to be extra
safe.

5 years agolib-imap-urlauth: Fix potential timing attack in verifying the token
Timo Sirainen [Wed, 25 Mar 2020 08:43:33 +0000 (10:43 +0200)] 
lib-imap-urlauth: Fix potential timing attack in verifying the token

5 years agoauth: DOVECOT-TOKEN mechanism - Fix potential timing attack in verying the token
Timo Sirainen [Wed, 25 Mar 2020 08:42:40 +0000 (10:42 +0200)] 
auth: DOVECOT-TOKEN mechanism - Fix potential timing attack in verying the token

5 years agolib: Add str_equals_timing_almost_safe()
Timo Sirainen [Tue, 7 Apr 2020 16:16:10 +0000 (19:16 +0300)] 
lib: Add str_equals_timing_almost_safe()

5 years agolib-storage: Initialize new cache hdr.* fields with NO decision
Timo Sirainen [Sun, 5 Apr 2020 20:30:41 +0000 (23:30 +0300)] 
lib-storage: Initialize new cache hdr.* fields with NO decision

Calling mail_cache_add() afterwards will change their decision to TEMP.
Or if it's not called, it probably wasn't wanted to be cached anyway.
Most importantly this change will cause mail_cache_decision event to be
triggered for these newly cached headers.

5 years agolib-storage: When sorting mails, mark all the sort program fields as "wanted"
Timo Sirainen [Mon, 6 Apr 2020 11:34:42 +0000 (14:34 +0300)] 
lib-storage: When sorting mails, mark all the sort program fields as "wanted"

Usually only the first field in the sort program is used, so this likely
doesn't make a big difference.

Also, this was already done in a different way for all header fields in the
program. However, the next commit will remove that way.

5 years agolib-index: Add test-mail-cache unit test
Timo Sirainen [Tue, 31 Mar 2020 19:23:05 +0000 (22:23 +0300)] 
lib-index: Add test-mail-cache unit test

5 years agolib-index: Add test-mail-cache-purge unit test
Timo Sirainen [Tue, 31 Mar 2020 18:45:38 +0000 (21:45 +0300)] 
lib-index: Add test-mail-cache-purge unit test

5 years agolib-index: mailbox_cache_purge*() - Add reason string
Timo Sirainen [Fri, 3 Apr 2020 08:06:15 +0000 (11:06 +0300)] 
lib-index: mailbox_cache_purge*() - Add reason string

Include the reason in the mail_cache_purge_* events also.

5 years agolib-index: Add mail_cache_record_corrupted event
Timo Sirainen [Thu, 2 Apr 2020 21:22:45 +0000 (00:22 +0300)] 
lib-index: Add mail_cache_record_corrupted event

5 years agolib-index: Add mail_cache_corrupted event
Timo Sirainen [Thu, 2 Apr 2020 20:52:46 +0000 (23:52 +0300)] 
lib-index: Add mail_cache_corrupted event

5 years agolib-index: If major_version or uoff_t size change in cache file, log error
Timo Sirainen [Thu, 2 Apr 2020 21:18:28 +0000 (00:18 +0300)] 
lib-index: If major_version or uoff_t size change in cache file, log error

These events really aren't expected, so it's better to clearly log errors
about them rather than silently delete the cache file.

5 years agolib-index: Merge mail_cache_reset() into mail_cache_unlink()
Timo Sirainen [Thu, 2 Apr 2020 20:48:50 +0000 (23:48 +0300)] 
lib-index: Merge mail_cache_reset() into mail_cache_unlink()

There are no external callers to mail_cache_reset(), and this simplifies the
code.

5 years agolib-index: mail_cache_set_seq_corrupted_reason() - Don't delete entire cache if trans...
Timo Sirainen [Thu, 2 Apr 2020 21:07:23 +0000 (00:07 +0300)] 
lib-index: mail_cache_set_seq_corrupted_reason() - Don't delete entire cache if transaction commit fails

It can only happen on I/O errors, which most likely means that there's no
disk space to write to transaction log. There's no reason to delete the
entire cache, since it might be expensive to recreate.

5 years agolib-index: Add mail_cache_decision_changed event
Timo Sirainen [Thu, 2 Apr 2020 20:45:49 +0000 (23:45 +0300)] 
lib-index: Add mail_cache_decision_changed event

5 years agolib-index: Add mail_cache_purge_drop_field event
Timo Sirainen [Thu, 2 Apr 2020 20:38:23 +0000 (23:38 +0300)] 
lib-index: Add mail_cache_purge_drop_field event

5 years agolib-index: Add mail_cache_purge_started/finished events
Timo Sirainen [Thu, 2 Apr 2020 20:12:00 +0000 (23:12 +0300)] 
lib-index: Add mail_cache_purge_started/finished events

5 years agolib-index: Log a warning if cache purging causes changes to be lost
Timo Sirainen [Tue, 31 Mar 2020 12:21:28 +0000 (15:21 +0300)] 
lib-index: Log a warning if cache purging causes changes to be lost

5 years agolib-index: Add mail_cache.event with a log prefix and mail-cache category
Timo Sirainen [Thu, 2 Apr 2020 20:25:59 +0000 (23:25 +0300)] 
lib-index: Add mail_cache.event with a log prefix and mail-cache category

5 years agolib-index: Rename "index" event category to "mail-index"
Timo Sirainen [Sat, 4 Apr 2020 09:44:02 +0000 (12:44 +0300)] 
lib-index: Rename "index" event category to "mail-index"

It's a bit too ambiguous to call it just "index" since we have so many
different ones.

5 years agolib-storage: Use mailbox.event as parent to mail_index
Timo Sirainen [Thu, 2 Apr 2020 21:41:55 +0000 (00:41 +0300)] 
lib-storage: Use mailbox.event as parent to mail_index

The index lives longer than the struct mailbox, which is a bit confusing.
In some cases the index could even be used for a different mailbox name
(symlink/alias), in which case the event's mailbox name wouldn't be exactly
correct. However, these downsides are still preferable to not inheriting
from the mailbox event, since then there is no mailbox name.

5 years agolib-index: When cache purging causes changes to be lost, don't update deleted_record_...
Timo Sirainen [Tue, 31 Mar 2020 12:20:33 +0000 (15:20 +0300)] 
lib-index: When cache purging causes changes to be lost, don't update deleted_record_count

The new file that purging created doesn't have any of these deleted records
anymore.

5 years agolib-storage: Rename mail_cache_compress_* settings to mail_cache_purge_*
Timo Sirainen [Tue, 31 Mar 2020 12:03:16 +0000 (15:03 +0300)] 
lib-storage: Rename mail_cache_compress_* settings to mail_cache_purge_*

The old settings are still recognized by the old-set-parser.

5 years agolib-index: Rename cache compress -> cache purge
Timo Sirainen [Tue, 31 Mar 2020 11:59:25 +0000 (14:59 +0300)] 
lib-index: Rename cache compress -> cache purge

Using "purge" term is less confusing than "compress". This was already
decided earlier for "doveadm mailbox cache purge" name, and it's similar
to mdbox purging.

5 years agolib-index: Rename mail-cache-compress.c to mail-cache-purge.c
Timo Sirainen [Tue, 31 Mar 2020 11:49:42 +0000 (14:49 +0300)] 
lib-index: Rename mail-cache-compress.c to mail-cache-purge.c

5 years agolib-index: Make sure cache header is written after changing cache decisions
Timo Sirainen [Sun, 5 Apr 2020 17:42:12 +0000 (20:42 +0300)] 
lib-index: Make sure cache header is written after changing cache decisions

Remove the extra check that caused it to wrongly not be updated in some
situations.

5 years agolib-index: Update last_used field immediately when adding a new cache field
Timo Sirainen [Sun, 5 Apr 2020 17:41:28 +0000 (20:41 +0300)] 
lib-index: Update last_used field immediately when adding a new cache field

Otherwise the newly added field could be dropped immediately on the next
purge.

5 years agolib-index: Make sure purging clears saved bitmask offsets state between mails
Timo Sirainen [Wed, 1 Apr 2020 21:29:07 +0000 (00:29 +0300)] 
lib-index: Make sure purging clears saved bitmask offsets state between mails

This is just to make sure it doesn't try to use previous mail's offset when
merging bitmasks. This shouldn't have been possible anyway, because
field_seen array guaranteed that the bitmask_pos was always set before
reading it. This just makes extra sure of it.

5 years agolib-index: Fix mail_cache_get_first_new_seq() when all mails are old
Timo Sirainen [Wed, 1 Apr 2020 21:27:43 +0000 (00:27 +0300)] 
lib-index: Fix mail_cache_get_first_new_seq() when all mails are old

Instead of returning "all messages are old", it returned "all messages are
new".

5 years agolib-index: mail_cache_get_missing_reason() - Add "Mail is already expunged" as reason
Timo Sirainen [Wed, 1 Apr 2020 13:42:35 +0000 (16:42 +0300)] 
lib-index: mail_cache_get_missing_reason() - Add "Mail is already expunged" as reason

5 years agolib-index: Remove mail_cache_try_lock()
Timo Sirainen [Wed, 1 Apr 2020 19:24:59 +0000 (22:24 +0300)] 
lib-index: Remove mail_cache_try_lock()

5 years agolib-index: Wait for lock in cache compression, not just try once
Timo Sirainen [Tue, 31 Mar 2020 15:53:33 +0000 (18:53 +0300)] 
lib-index: Wait for lock in cache compression, not just try once

Sometimes there's an important reason for the cache to be compressed, and it
shouldn't give up just because there's a race condition with another process
that just happens to be writing to it.

5 years agolib-index: After cache is marked corrupted, don't log error if cache file isn't found
Timo Sirainen [Tue, 31 Mar 2020 14:50:42 +0000 (17:50 +0300)] 
lib-index: After cache is marked corrupted, don't log error if cache file isn't found

It's just an unnecessary extra error.