]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
4 years agoconfigure: Remove useless checks for luajit 155/head
Josef 'Jeff' Sipek [Tue, 2 Mar 2021 14:51:59 +0000 (09:51 -0500)] 
configure: Remove useless checks for luajit

At one point, we considered supporting LuaJIT.  While it turned out to be
not worth it, the prototype removal accidentally left checks in the
configure file.

4 years agoglobal: dict_iterate_deinit(NULL) is a no-op
Josef 'Jeff' Sipek [Mon, 22 Feb 2021 22:44:03 +0000 (17:44 -0500)] 
global: dict_iterate_deinit(NULL) is a no-op

4 years agolib-dict: Make dict_iterate_deinit(NULL) a no-op
Josef 'Jeff' Sipek [Mon, 22 Feb 2021 22:43:49 +0000 (17:43 -0500)] 
lib-dict: Make dict_iterate_deinit(NULL) a no-op

4 years agoglobal: dict_transaction_rollback(NULL) is a no-op
Josef 'Jeff' Sipek [Mon, 22 Feb 2021 22:43:05 +0000 (17:43 -0500)] 
global: dict_transaction_rollback(NULL) is a no-op

4 years agolib-dict: Make dict_transaction_rollback(NULL) a no-op
Josef 'Jeff' Sipek [Mon, 22 Feb 2021 22:41:23 +0000 (17:41 -0500)] 
lib-dict: Make dict_transaction_rollback(NULL) a no-op

4 years agofts: Replace generic "transaction context" error with more specific ones
Timo Sirainen [Thu, 4 Feb 2021 16:25:13 +0000 (18:25 +0200)] 
fts: Replace generic "transaction context" error with more specific ones

4 years agofts: Fix mail_precache() and related error handling
Timo Sirainen [Wed, 3 Feb 2021 17:42:17 +0000 (19:42 +0200)] 
fts: Fix mail_precache() and related error handling

The mail_precache() caller is now expected to stop on error, so there's
no need for fts to stop the search internally anymore. And similarly
the caller will log the mail_precache() error so the search or
transaction don't need to fail.

ft->failed is now used only for failures that are more specific to the
transaction.

4 years agofts: Use storage error logging when possible
Timo Sirainen [Wed, 3 Feb 2021 17:30:35 +0000 (19:30 +0200)] 
fts: Use storage error logging when possible

Use mail_storage_set_internal_error() only when it's required, because it
loses the internal error string in storage.

4 years agolib-fts, fts: fts_language_detect() - Return error string instead of logging it
Timo Sirainen [Wed, 3 Feb 2021 17:27:08 +0000 (19:27 +0200)] 
lib-fts, fts: fts_language_detect() - Return error string instead of logging it

4 years agoindexer: Include "attempted to index ... messages" also in all error messages
Timo Sirainen [Wed, 3 Feb 2021 19:00:22 +0000 (21:00 +0200)] 
indexer: Include "attempted to index ... messages" also in all error messages

After the following changes search or transaction won't always fail anymore.

4 years agoglobal: Handle mail_precache() errors
Timo Sirainen [Thu, 4 Feb 2021 16:07:45 +0000 (18:07 +0200)] 
global: Handle mail_precache() errors

4 years agolib-storage: Change mail_precache() API to allow returning an error
Timo Sirainen [Thu, 4 Feb 2021 16:05:39 +0000 (18:05 +0200)] 
lib-storage: Change mail_precache() API to allow returning an error

4 years agoMakefile: Always include dovecot.socket and dovecot.service
Aki Tuomi [Tue, 23 Feb 2021 14:32:39 +0000 (16:32 +0200)] 
Makefile: Always include dovecot.socket and dovecot.service

4 years agolib-master: Always import systemd related variables with systemd
Aki Tuomi [Tue, 23 Feb 2021 10:52:29 +0000 (12:52 +0200)] 
lib-master: Always import systemd related variables with systemd

Otherwise it is too easy to break systemd integration by forgetting
these from import_environment.

4 years agomaster: Improve systemd integration
Aki Tuomi [Mon, 22 Feb 2021 14:14:14 +0000 (16:14 +0200)] 
master: Improve systemd integration

4 years agomaster: Use libsystemd instead of local source
Aki Tuomi [Mon, 22 Feb 2021 13:29:48 +0000 (15:29 +0200)] 
master: Use libsystemd instead of local source

4 years agomaster: service-listen - Use dovecot coding standard for systemd code
Aki Tuomi [Tue, 23 Feb 2021 14:08:28 +0000 (16:08 +0200)] 
master: service-listen - Use dovecot coding standard for systemd code

4 years agolib-imap-client: Add asserts to make sure running commands always have a timeout
Timo Sirainen [Mon, 22 Feb 2021 14:01:49 +0000 (16:01 +0200)] 
lib-imap-client: Add asserts to make sure running commands always have a timeout

4 years agolib-imap-client: Don't remove global command timeouts when mailbox is unselected
Timo Sirainen [Mon, 22 Feb 2021 13:41:42 +0000 (15:41 +0200)] 
lib-imap-client: Don't remove global command timeouts when mailbox is unselected

4 years agolib-imap-client: Fix busy-loop if server disconnects too early when trying to logout
Timo Sirainen [Mon, 22 Feb 2021 11:15:18 +0000 (13:15 +0200)] 
lib-imap-client: Fix busy-loop if server disconnects too early when trying to logout

This can happen if:
 * imapc sends NOOP to break idle
 * remote server sends BYE, but doesn't immediately disconnect
 * session is stopped, which causes imapc to attempt to send LOGOUT
 * imapc waits for NOOP response first
 * remote server disconnects
 * imapc notices the disconnection, but does nothing with it, because it
   thinks it's already handled. This keeps busy-looping.
 * If there was a mailbox selected, this results in infinite busy-loop. If a
   mailbox wasn't selected, imapc_cmd_timeout aborts the NOOP command.

4 years agolib-mail: message-parser - Always properly finish parsed input
Timo Sirainen [Wed, 24 Feb 2021 15:51:19 +0000 (17:51 +0200)] 
lib-mail: message-parser - Always properly finish parsed input

If the caller hadn't called message_parser_parse_next_block() after
seeing EOF in the istream, the deinit could have crashed with:

Panic: file message-parser.c: line 802 (message_parser_deinit_from_parts): assertion failed: (ctx->nested_parts_count == 0 || i_stream_have_bytes_left(ctx->input))

4 years agolib: io_loop_context_new() - Fix memory leak
Timo Sirainen [Mon, 1 Mar 2021 10:03:45 +0000 (12:03 +0200)] 
lib: io_loop_context_new() - Fix memory leak

Broken by fea09a415cf89223d8b17c5982257c9b3c357cbc

4 years agologin-common: Fix implicit integer conversions when connect timeout is reached
Timo Sirainen [Thu, 18 Feb 2021 12:43:06 +0000 (14:43 +0200)] 
login-common: Fix implicit integer conversions when connect timeout is reached

4 years agolmtp: Fix log prefix when autoexpunge is running
Timo Sirainen [Wed, 3 Feb 2021 18:48:51 +0000 (20:48 +0200)] 
lmtp: Fix log prefix when autoexpunge is running

The username was missing from the log prefix.

4 years agolib: io_loop_context_new() no longer implicitly activates the context
Timo Sirainen [Wed, 3 Feb 2021 18:42:50 +0000 (20:42 +0200)] 
lib: io_loop_context_new() no longer implicitly activates the context

The new behavior requires explicitly activating the context. This change
was needed, because an implicit creation activated the context but didn't
call any of the callbacks. If ioloop wasn't run, the activation callbacks
were never called. This meant that when context was deactivated, the
deactivation callbacks weren't run either.

4 years agolib-storage: Replace i_error() and i_warning() with e_error() and e_warning()
Timo Sirainen [Wed, 17 Feb 2021 17:33:03 +0000 (19:33 +0200)] 
lib-storage: Replace i_error() and i_warning() with e_error() and e_warning()

This changes only the generic code. The driver-specific code still needs
changing.

4 years agolib-storage: test-mailbox-list - Initialize namespace, user and event
Timo Sirainen [Thu, 18 Feb 2021 10:20:20 +0000 (12:20 +0200)] 
lib-storage: test-mailbox-list - Initialize namespace, user and event

Required by the following change.

4 years agolib-storage: mail-duplicate - Replace i_error() with e_error()
Timo Sirainen [Wed, 17 Feb 2021 17:28:03 +0000 (19:28 +0200)] 
lib-storage: mail-duplicate - Replace i_error() with e_error()

4 years agolib-storage: Add functions to get log prefixes
Timo Sirainen [Wed, 17 Feb 2021 17:16:58 +0000 (19:16 +0200)] 
lib-storage: Add functions to get log prefixes

This changes the log prefixes to be stored even when
MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT is used.

4 years agolib-storage: Initialize service_user's logging before creating ioloop context
Timo Sirainen [Wed, 3 Feb 2021 18:37:49 +0000 (20:37 +0200)] 
lib-storage: Initialize service_user's logging before creating ioloop context

Needed by the next change.

4 years agolib-storage: Add PID to the default log prefix
Timo Sirainen [Wed, 3 Feb 2021 18:35:02 +0000 (20:35 +0200)] 
lib-storage: Add PID to the default log prefix

4 years agodoc/example: 10-metrics.conf - Add metrics related settings
Aki Tuomi [Tue, 16 Feb 2021 11:39:02 +0000 (13:39 +0200)] 
doc/example: 10-metrics.conf - Add metrics related settings

4 years agodoc/eaxmple: 10-logging.conf - Update syntax example to point to online documentation
Aki Tuomi [Tue, 16 Feb 2021 11:25:40 +0000 (13:25 +0200)] 
doc/eaxmple: 10-logging.conf - Update syntax example to point to online documentation

4 years agolib: event_get_last_duration() - Change it to return uintmax_t
Timo Sirainen [Thu, 18 Feb 2021 16:58:29 +0000 (18:58 +0200)] 
lib: event_get_last_duration() - Change it to return uintmax_t

It can't be negative, so unsigned return value makes more sense.
Also clarify the function comment and parameter name.

4 years agostats: openmetrics: Do microsecond to seconds conversion only for duration values
Siavash Tavakoli [Thu, 18 Feb 2021 16:25:50 +0000 (16:25 +0000)] 
stats: openmetrics: Do microsecond to seconds conversion only for duration values

Other metrics should be exported with their values unchanged.

4 years agostats: openmentrics: Change histogram bucket unit to seconds
Martin Michaelis [Tue, 16 Feb 2021 20:06:50 +0000 (21:06 +0100)] 
stats: openmentrics: Change histogram bucket unit to seconds

In ae678116a79fff609cdf4fb1eb7eb3db2975bf1c the unit of durations was changed
from microseconds to seconds, but the `le` field in histograms is still in
microseconds.

4 years agostats: refactor duration field name into a macro
Siavash Tavakoli [Thu, 18 Feb 2021 21:39:09 +0000 (21:39 +0000)] 
stats: refactor duration field name into a macro

4 years agolib-master: If config reading via doveconf exec fails, show details in the error
Timo Sirainen [Tue, 16 Feb 2021 13:39:24 +0000 (15:39 +0200)] 
lib-master: If config reading via doveconf exec fails, show details in the error

4 years agolib-master: Reset master_service.config_path_from_master if -c parameter is used
Timo Sirainen [Tue, 16 Feb 2021 13:38:36 +0000 (15:38 +0200)] 
lib-master: Reset master_service.config_path_from_master if -c parameter is used

This doesn't fix anything currently, but clarifies the behavior and
is needed by the following commit.

4 years agoplugins: fts-solr: Use a private HTTP client.
Stephan Bosch [Fri, 4 Jan 2019 08:57:37 +0000 (09:57 +0100)] 
plugins: fts-solr: Use a private HTTP client.

This is a workaround for problems with the http_client_request_send_payload()
API that occur when several shared HTTP clients use this API at the same time
and payload sending gets interleaved.

4 years agoplugins: fts: tika: Use a private HTTP client.
Stephan Bosch [Fri, 4 Jan 2019 08:55:20 +0000 (09:55 +0100)] 
plugins: fts: tika: Use a private HTTP client.

This is a workaround for problems with the http_client_request_send_payload()
API that occur when several shared HTTP clients use this API at the same time
and payload sending gets interleaved.

4 years agolib: test-cpu-limit - Increase ALLOW_MSECS_BELOW to 500ms
Timo Sirainen [Wed, 17 Feb 2021 11:18:55 +0000 (13:18 +0200)] 
lib: test-cpu-limit - Increase ALLOW_MSECS_BELOW to 500ms

The test still randomly failed with 100ms. Maybe 500ms is enough?

4 years agolib: test-cpu-limit - Use test_assert_cmp()
Timo Sirainen [Wed, 17 Feb 2021 11:18:38 +0000 (13:18 +0200)] 
lib: test-cpu-limit - Use test_assert_cmp()

4 years agolib-test: Add test_assert_ucmp[_idx]()
Timo Sirainen [Thu, 18 Feb 2021 12:23:50 +0000 (14:23 +0200)] 
lib-test: Add test_assert_ucmp[_idx]()

These are the unsigned versions of test_assert_cmp*()

4 years agolib-test: Add test_assert_cmp[_idx]()
Timo Sirainen [Wed, 17 Feb 2021 11:17:43 +0000 (13:17 +0200)] 
lib-test: Add test_assert_cmp[_idx]()

Similar to test_assert_strcmp() but for numbers: If the comparison fails,
print the values and the used operator.

4 years agoacl: acl_lookup_dict_rebuild_update()
Markus Valentin [Wed, 17 Feb 2021 10:49:44 +0000 (11:49 +0100)] 
acl: acl_lookup_dict_rebuild_update()

Initialize dict_transaction_context *dt with NULL. Due to the changes
done in bfa7433bfcf538af7c4fdafe37a88bde6508c751 dt could be used
uninitialized.

4 years agoMakefile.am: Don't delete dovecot.socket in make clean
Timo Sirainen [Tue, 16 Feb 2021 23:02:34 +0000 (01:02 +0200)] 
Makefile.am: Don't delete dovecot.socket in make clean

Broken by 0650928f3e3728911d6bcea4daf743df02ec1b3d

4 years agoimap: Fix PREVIEW behavior to support RFC 8970
Michael M Slusarz [Tue, 22 Dec 2020 04:02:23 +0000 (21:02 -0700)] 
imap: Fix PREVIEW behavior to support RFC 8970

4 years agombox: Fix potentially logging read error when there was no error
Timo Sirainen [Wed, 17 Feb 2021 12:40:06 +0000 (14:40 +0200)] 
mbox: Fix potentially logging read error when there was no error

Broken by 959385969388b2d4f6d3d0218fa175481cb46c8a

4 years agoimap: NOTIFY - Fix crash if client disconnects while sending FETCH notification
Timo Sirainen [Wed, 10 Feb 2021 11:13:34 +0000 (13:13 +0200)] 
imap: NOTIFY - Fix crash if client disconnects while sending FETCH notification

Fixes:
Panic: Trying to close mailbox INBOX with open transactions

4 years agodoveadm: Avoid duplicate error logging with doveadm_print_istream()
Timo Sirainen [Wed, 3 Feb 2021 15:38:08 +0000 (17:38 +0200)] 
doveadm: Avoid duplicate error logging with doveadm_print_istream()

4 years agolib-compression, global: Remove support for implicit error logging
Timo Sirainen [Wed, 3 Feb 2021 15:34:01 +0000 (17:34 +0200)] 
lib-compression, global: Remove support for implicit error logging

4 years agodoveadm zlibconnect: Avoid duplicate error logging
Timo Sirainen [Wed, 3 Feb 2021 15:04:49 +0000 (17:04 +0200)] 
doveadm zlibconnect: Avoid duplicate error logging

The istream errors are already logged with i_fatal(). There's no need for a
duplicate error.

4 years agodoveadm dump -t imapzlib: Explicitly log compress istream errors
Timo Sirainen [Wed, 3 Feb 2021 15:04:16 +0000 (17:04 +0200)] 
doveadm dump -t imapzlib: Explicitly log compress istream errors

4 years agozlib: Remove extra error logging for istream failures
Timo Sirainen [Wed, 3 Feb 2021 14:57:30 +0000 (16:57 +0200)] 
zlib: Remove extra error logging for istream failures

The error will nowadays be logged as the istream error anyway.

4 years agombox: istream-raw-mbox - Log parent istream read errors
Timo Sirainen [Wed, 3 Feb 2021 15:32:11 +0000 (17:32 +0200)] 
mbox: istream-raw-mbox - Log parent istream read errors

4 years agombox: Use mbox_ostream_set_syscall_error()
Timo Sirainen [Wed, 3 Feb 2021 15:18:18 +0000 (17:18 +0200)] 
mbox: Use mbox_ostream_set_syscall_error()

4 years agombox: Use mbox_istream_set_syscall_error()
Timo Sirainen [Wed, 3 Feb 2021 15:24:14 +0000 (17:24 +0200)] 
mbox: Use mbox_istream_set_syscall_error()

4 years agombox: Add mbox_[io]stream_set_syscall_error()
Timo Sirainen [Wed, 3 Feb 2021 15:18:09 +0000 (17:18 +0200)] 
mbox: Add mbox_[io]stream_set_syscall_error()

This allows logging the iostream-specific error rather than the more generic
errno.

4 years agolib-master: Fix haproxy PROXY protocol LOCAL type connection behavior when header...
Alex/AT [Thu, 23 Apr 2020 12:26:22 +0000 (15:26 +0300)] 
lib-master: Fix haproxy PROXY protocol LOCAL type connection behavior when header includes address information or TLVs

PROXY protocol LOCAL type headers can actually include supplementary
information (addresses, TLVs) which need to be skipped to correctly handle the
header. Fixes Invalid TLV bug with haproxy 2.0.14 service checks.

More info here: https://github.com/haproxy/haproxy/issues/511
And here: https://www.mail-archive.com/haproxy@formilux.org/msg36890.html

4 years agolib: cpu-limit - Don't round current CPU usage up when checking if rlim_max is reached
Timo Sirainen [Tue, 16 Feb 2021 14:40:35 +0000 (16:40 +0200)] 
lib: cpu-limit - Don't round current CPU usage up when checking if rlim_max is reached

The fatal error could trigger half a second too early.

Also always increase the provided cpu_limit_sec by 1 second to make sure it
won't trigger too early. Although even with this change it can still
trigger a few milliseconds too early for some reason.

4 years agolib: cpu-limit - Allow time comparisons to be more relaxed
Timo Sirainen [Tue, 16 Feb 2021 14:42:54 +0000 (16:42 +0200)] 
lib: cpu-limit - Allow time comparisons to be more relaxed

This should fix random failures.

4 years agolib-storage: Fix assert-crash when parsing binary attachments
Timo Sirainen [Tue, 10 Nov 2020 14:33:41 +0000 (16:33 +0200)] 
lib-storage: Fix assert-crash when parsing binary attachments

EOF may not have been detected in the cur_block istream early enough,
causing the calculation to go wrong. This happened at least with empty
base64 bodies, but could have possibly happened in other situations also.

Fixes:
Panic: file index-mail-binary.c: line 357 (blocks_count_lines): assertion failed: (block_count == 0 || block_idx+1 == block_count)

4 years agoconfig: test-config-parser - Change filename to match .gitignore pattern
Aki Tuomi [Fri, 12 Feb 2021 12:45:39 +0000 (14:45 +0200)] 
config: test-config-parser - Change filename to match .gitignore pattern

4 years agoconfig: test-config-parser - Cleanup input file after test
Aki Tuomi [Fri, 12 Feb 2021 12:32:01 +0000 (14:32 +0200)] 
config: test-config-parser - Cleanup input file after test

4 years agoacl: acl_lookup_dict_rebuild_update() - Commit transaction after each [un]set
Markus Valentin [Mon, 1 Feb 2021 14:38:49 +0000 (15:38 +0100)] 
acl: acl_lookup_dict_rebuild_update() - Commit transaction after each [un]set

When used with Cassandra an error can occur if multiple changes are
included into one transaction: "Multiple changes in transaction not
supported". Prevent these errors by committing every change on it's
own.

4 years agolib-storage: Fix assert-crash in shared namespace if storage has no directories
Timo Sirainen [Tue, 15 Dec 2020 22:13:19 +0000 (00:13 +0200)] 
lib-storage: Fix assert-crash in shared namespace if storage has no directories

This allows using imapc with shared namespaces.

Fixes:
Panic: file mailbox-list.c: line 1419: unreached

4 years agoacl: Add acl_ignore_namespace* settings
Timo Sirainen [Tue, 15 Dec 2020 22:09:32 +0000 (00:09 +0200)] 
acl: Add acl_ignore_namespace* settings

Ignore ACLs entirely for the listed namespaces. For example:

plugin {
  acl_ignore_namespace = virtual/
  acl_ignore_namespace2 = shared/*
}

4 years agoutil: health-check - Timeout the read via trap for POSIX shell compatibility
Simon Rupf [Sun, 7 Feb 2021 08:23:03 +0000 (09:23 +0100)] 
util: health-check - Timeout the read via trap for POSIX shell compatibility

4 years agoutil: health-check - Consistent variable style
Simon Rupf [Sat, 23 Jan 2021 10:29:22 +0000 (11:29 +0100)] 
util: health-check - Consistent variable style

4 years agoutil: health-check - Made bash script compatible with dash shell
Simon Rupf [Sat, 23 Jan 2021 10:07:36 +0000 (11:07 +0100)] 
util: health-check - Made bash script compatible with dash shell

4 years agoMakefile.am: fix typo and broken variable assignment
Nis Martensen [Sun, 24 May 2020 21:15:53 +0000 (23:15 +0200)] 
Makefile.am: fix typo and broken variable assignment

4 years agosystemd integration: notify service manager when ready
Nis Martensen [Sun, 24 May 2020 20:05:42 +0000 (22:05 +0200)] 
systemd integration: notify service manager when ready

With Type=simple or Type=forking, systemd does not really know when the
service is ready to accept connections and might start depending
services too early. Use Type=notify to explicitly tell the service
manager when the service is ready.

For a real problem caused by assuming readiness too early, please see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=951722

For the meaning of the service type and details of the readiness
protocol, see also the following links:
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=
https://www.freedesktop.org/software/systemd/man/sd_notify.html

As discussed in the last link, more elaborate state notifications are
possible. This patch only implements the most basic part.

Original patch prepared by Michael Biebl, with slight modification.

4 years agolib: Add API for limiting CPU usage of subroutines.
Stephan Bosch [Thu, 29 Oct 2020 00:04:26 +0000 (01:04 +0100)] 
lib: Add API for limiting CPU usage of subroutines.

4 years agolib: time-util - Add support for rounding off timeval to a time_t value.
Stephan Bosch [Thu, 29 Oct 2020 00:09:17 +0000 (01:09 +0100)] 
lib: time-util - Add support for rounding off timeval to a time_t value.

4 years agolib: time-util - Add support for calculating the sum of two timeval values.
Stephan Bosch [Thu, 29 Oct 2020 00:06:57 +0000 (01:06 +0100)] 
lib: time-util - Add support for calculating the sum of two timeval values.

4 years agorun-test-valgrind.supp: Add more suppressions
Siavash Tavakoli [Mon, 1 Feb 2021 12:33:02 +0000 (12:33 +0000)] 
run-test-valgrind.supp: Add more suppressions

4 years agodsync: Add namespace prefixes to mailbox tree
Siavash Tavakoli [Thu, 28 Jan 2021 23:09:00 +0000 (23:09 +0000)] 
dsync: Add namespace prefixes to mailbox tree

Adds syncing selectable namespace prefixes, especially shared INBOXes with
"mail_shared_explicit_inbox=yes".

4 years agodsync: Check namespace prefix when syncing shared namespaces
Siavash Tavakoli [Thu, 7 Jan 2021 09:40:51 +0000 (09:40 +0000)] 
dsync: Check namespace prefix when syncing shared namespaces

When iterating over namespaces, comparing namespace pointers doesn't
work for shared namespaces. Instead, check the prefix and include all
the mailboxes in the namespace for syncing.

4 years agodsync: Don't send out of tree namespace parents for syncing
Siavash Tavakoli [Tue, 19 Jan 2021 10:33:17 +0000 (10:33 +0000)] 
dsync: Don't send out of tree namespace parents for syncing

For namespaces prefixes with multiple hierarchical names, we shouldn't
send parents (i.e. first part/parts of the prefix) that are outside of syncing.

4 years agolib-storage: Cache mailbox's namespace prefix if selectable
Siavash Tavakoli [Thu, 4 Feb 2021 20:54:14 +0000 (20:54 +0000)] 
lib-storage: Cache mailbox's namespace prefix if selectable

If namespace prefix is a selectable mailbox, mailbox_guid_cache_refresh
should add it to cache.

4 years agolib-storage: Add mailbox_guid_cache_add_mailbox()
Siavash Tavakoli [Thu, 4 Feb 2021 15:57:09 +0000 (15:57 +0000)] 
lib-storage: Add mailbox_guid_cache_add_mailbox()

Refactored caching logic in mailbox_guid_cache_refresh to this new
function.

4 years agolib-storage: Add mail_namespace_prefix_is_inbox()
Siavash Tavakoli [Thu, 4 Feb 2021 20:52:19 +0000 (20:52 +0000)] 
lib-storage: Add mail_namespace_prefix_is_inbox()

4 years agolib-storage: Skip private server attributes for shared inboxes
Siavash Tavakoli [Thu, 4 Feb 2021 01:42:52 +0000 (01:42 +0000)] 
lib-storage: Skip private server attributes for shared inboxes

Private server attributes should be iterated only for user's own inbox.

4 years agolib-storage: mailbox-list-iter: Send delayed inbox after actually seeing the inbox
Siavash Tavakoli [Mon, 1 Feb 2021 17:53:59 +0000 (17:53 +0000)] 
lib-storage: mailbox-list-iter: Send delayed inbox after actually seeing the inbox

Control delayed inbox listing with a flag in ns_list_iterate_context.
Send only when the inbox is actually seen.

4 years agolib-index: Fix implicit integer truncation found by ubsan
Siavash Tavakoli [Tue, 2 Feb 2021 12:43:50 +0000 (12:43 +0000)] 
lib-index: Fix implicit integer truncation found by ubsan

4 years agolib-index: Avoid a duplicate "missing middle file seq" warning.
Timo Sirainen [Wed, 3 Feb 2021 13:55:14 +0000 (15:55 +0200)] 
lib-index: Avoid a duplicate "missing middle file seq" warning.

The previous changes fixed repeating warning, but it was still possible
that the warning was logged twice. Now it's logged only once.

4 years agolib-index: Change "missing middle file seq" error into warning
Timo Sirainen [Mon, 1 Feb 2021 15:49:18 +0000 (17:49 +0200)] 
lib-index: Change "missing middle file seq" error into warning

It's not really an error, but it has been useful in finding performance
problems. Possibly it should be changed into a named event at some point.

4 years agolib-index: view_sync_set_log_view_range() - Move error logging to parent
Timo Sirainen [Mon, 1 Feb 2021 15:02:24 +0000 (17:02 +0200)] 
lib-index: view_sync_set_log_view_range() - Move error logging to parent

4 years agolib-index: Fix repetitive "missing middle file seq" error.
Timo Sirainen [Mon, 1 Feb 2021 14:53:18 +0000 (16:53 +0200)] 
lib-index: Fix repetitive "missing middle file seq" error.

If a view keeps being synced with MAIL_INDEX_VIEW_SYNC_FLAG_NOEXPUNGES,
every sync regenerated the missing log files and logged this error.
This could have resulted in lots of errors being logged about it, as
well as unnecessary CPU usage.

The view syncing was always syncing from the last "expunge log position",
even when expunges weren't being synced. The new behavior is to do that
only when expunges are synced, but otherwise use the "head log position"
to sync only the new changes since the last view sync.

The error is now logged once when the log is first noticed being lost.
Another error is logged when pending expunges are synced.

4 years agom4: dovecot.m4 - Execute tests with libtool
Aki Tuomi [Tue, 26 Jan 2021 07:30:42 +0000 (09:30 +0200)] 
m4: dovecot.m4 - Execute tests with libtool

This allows libtool to do all the necessary preparations
before test harness is used.

4 years agom4: dovecot.m4 - Find out and use absolute path to valgrind
Aki Tuomi [Tue, 26 Jan 2021 07:29:44 +0000 (09:29 +0200)] 
m4: dovecot.m4 - Find out and use absolute path to valgrind

4 years agolib-settings: test-settings-parser - Use ULL suffix
Aki Tuomi [Mon, 8 Feb 2021 08:05:47 +0000 (10:05 +0200)] 
lib-settings: test-settings-parser - Use ULL suffix

Some of the sizes do not fit to UL in 32 bit systems.

4 years agolib-compression: Remove xz/lzma write support
Josef 'Jeff' Sipek [Fri, 22 Jan 2021 19:00:21 +0000 (14:00 -0500)] 
lib-compression: Remove xz/lzma write support

For now, we keep the read support to allow for a more gradual migration from
lzma/xz.

The code has bugs.  Additionally, there is no benefit in keeping it around.
bzip2 or zstd (at maximum compression level) are likely better choices for
archival.  For non-archival usecases, a light compression algorithm like
zstd (at low to medium compression level) or lz4 are better choices.

4 years agolib-mail: test-message-snippet - Add unit tests for multipart messages
Aki Tuomi [Thu, 28 Jan 2021 15:04:37 +0000 (17:04 +0200)] 
lib-mail: test-message-snippet - Add unit tests for multipart messages

4 years agolib-mail: test-message-snippet - Use test_assert_strcmp
Aki Tuomi [Wed, 3 Feb 2021 15:22:07 +0000 (17:22 +0200)] 
lib-mail: test-message-snippet - Use test_assert_strcmp

Makes it easier to see what failed.

4 years agolib-mail: Reformat test-message-snippet.c
Aki Tuomi [Thu, 28 Jan 2021 14:52:10 +0000 (16:52 +0200)] 
lib-mail: Reformat test-message-snippet.c

4 years agolib-mail: message-snippet - Stop building snippet on first non-empty part
Aki Tuomi [Thu, 28 Jan 2021 15:01:38 +0000 (17:01 +0200)] 
lib-mail: message-snippet - Stop building snippet on first non-empty part

When we have gotten some snippet out of first eligible part,
we can stop.

4 years agolib-mail: message-snippet - Do not stop on first non-text part
Aki Tuomi [Thu, 28 Jan 2021 14:48:05 +0000 (16:48 +0200)] 
lib-mail: message-snippet - Do not stop on first non-text part

Some mail structures would break snippet generation because
the code would stop on multipart.

4 years agolib-mail: message-snippet - Free html parser before making new
Aki Tuomi [Thu, 28 Jan 2021 09:07:32 +0000 (11:07 +0200)] 
lib-mail: message-snippet - Free html parser before making new

If html parser has already been initialized, free it before restarting
the parser.

Fixes memory leak introduced by 7f7be2cbf68f8a202a688d5bc50f82483d461643