]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Mon, 19 Apr 2021 21:28:02 +0000 (00:28 +0300)]
doveadm copy: Don't permanently activate source user's ioloop
Timo Sirainen [Mon, 19 Apr 2021 21:24:39 +0000 (00:24 +0300)]
doveadm import: Don't permanently activate source user's ioloop
After the source user is initialized, the original user's ioloop should be
activated back.
Timo Sirainen [Wed, 17 Mar 2021 16:48:37 +0000 (18:48 +0200)]
submission: Add reason_code=submission:cmd_<name>
Timo Sirainen [Wed, 17 Mar 2021 16:48:24 +0000 (18:48 +0200)]
lmtp: Add reason_code=lmtp:cmd_<name>
Timo Sirainen [Wed, 17 Mar 2021 16:44:09 +0000 (18:44 +0200)]
lib-smtp: Add reason_code=<reason_code_module>:cmd_*
This requires caller to set smtp_server_settings.reason_code_module.
For now only cmd_mail, cmd_rcpt and cmd_data are implemented. The other
commands are likely not very useful.
Timo Sirainen [Thu, 22 Apr 2021 17:27:45 +0000 (20:27 +0300)]
lib-http: http-client-request - Preserve global events' reason_code in request events
Since HTTP requests are asynchronous, it's possible that the global events
go away before the HTTP request is finished. This way the reason_code will
be preserved in http_request_finished event.
Timo Sirainen [Thu, 11 Mar 2021 15:54:18 +0000 (17:54 +0200)]
lib: Add event_reason_code() for building reason codes easily
Timo Sirainen [Tue, 9 Mar 2021 14:45:20 +0000 (16:45 +0200)]
lib: Add event_reason_begin/end() API
This can be used to easily add reason_code to all events being emitted
within the begin..end calls. The reasons can also be nested. For example:
reason = event_reason_begin("reason1");
// ...
reason2 = event_reason_begin("reason2");
// ..
event_reason_end(&reason2);
event_reason_end(&reason);
This results in having reason_code=["reason1", "reason2"] for all events
emitted while reason2 exists.
Timo Sirainen [Wed, 21 Apr 2021 13:55:57 +0000 (16:55 +0300)]
lib: event_pop_global() - Assert-crash if trying to pop ioloop context's global root event
This makes it easier to debug bugs.
Timo Sirainen [Thu, 11 Mar 2021 00:19:37 +0000 (02:19 +0200)]
lib: Push/pop global event stack automatically when ioloop contexts are switched
Timo Sirainen [Wed, 21 Apr 2021 14:11:54 +0000 (17:11 +0300)]
lib-storage: mail_storage_service_next*() - On failure don't leave user's io context activated
Timo Sirainen [Thu, 11 Mar 2021 00:18:55 +0000 (02:18 +0200)]
lib-storage: Remove global event stack tracking
This will be implemented by ioloop contexts directly in the next commit.
Timo Sirainen [Tue, 9 Mar 2021 14:33:15 +0000 (16:33 +0200)]
lib: Fix global events to actually work
Also add comments to clarify how exactly it works.
Timo Sirainen [Mon, 19 Apr 2021 21:08:57 +0000 (00:08 +0300)]
lib: event_push_global() - Assert that event is not NULL
Timo Sirainen [Thu, 9 Sep 2021 10:46:24 +0000 (13:46 +0300)]
lib-master: Fix sending events recursively
The event sending itself may recursively trigger more events (e.g.
data_stack_grow). The previous BEGINs must have been flushed by that
time or the recursive events might be pointing to event IDs that haven't
even been sent to the stats process yet.
Fixes:
stats: Error: Client sent invalid input for UPDATE: Unknown event ID
Timo Sirainen [Tue, 9 Mar 2021 14:29:49 +0000 (16:29 +0200)]
lib-master, stats: Send global events to stats process
Timo Sirainen [Fri, 19 Mar 2021 11:13:45 +0000 (13:13 +0200)]
stats: Support group_by for string lists
Aki Tuomi [Wed, 27 Jan 2021 11:10:07 +0000 (13:10 +0200)]
stats: Support exporting event string lists
Timo Sirainen [Fri, 19 Mar 2021 11:02:54 +0000 (13:02 +0200)]
stats: Split off stats_metric_get_sub_metric()
Timo Sirainen [Fri, 19 Mar 2021 11:05:35 +0000 (13:05 +0200)]
stats: Rename stats_metric_get_sub_metric() to stats_metric_find_sub_metric()
Timo Sirainen [Fri, 19 Mar 2021 10:59:53 +0000 (12:59 +0200)]
stats: Split off stats_metric_group_by_value_label()
Timo Sirainen [Fri, 19 Mar 2021 10:52:13 +0000 (12:52 +0200)]
stats: stats_metric_group_by_*() - Add _r suffix to returned value parameter
Aki Tuomi [Tue, 15 Dec 2020 07:17:57 +0000 (09:17 +0200)]
lib: lib-event - Add support for string lists
Provide API to create string lists. These are particularly
useful if you need to provide list of causes for an event,
such as why some mail was opened.
Timo Sirainen [Mon, 23 Aug 2021 14:21:58 +0000 (17:21 +0300)]
lib: test-event-filter - Improve "override parent fields" test
Timo Sirainen [Mon, 23 Aug 2021 14:15:47 +0000 (17:15 +0300)]
lib: test-event-filter - Fix parent/child events to actually be parent/child
Timo Sirainen [Tue, 16 Mar 2021 17:22:25 +0000 (19:22 +0200)]
lib: Split off event_import_arg()
Timo Sirainen [Tue, 16 Mar 2021 17:19:43 +0000 (19:19 +0200)]
lib: Split off event_import_field()
Timo Sirainen [Fri, 24 Sep 2021 15:21:29 +0000 (18:21 +0300)]
lib-index: Allow ignoring index corruption checks with --enable-devel-checks
If DEBUG_IGNORE_INDEX_CORRUPTION environment is set, don't check if
index contains internal corruption. This is useful for CI tests that
intentionally test corrupted indexes.
Siavash Tavakoli [Mon, 27 Sep 2021 23:28:35 +0000 (00:28 +0100)]
lib-http: http-server: Add request events
Adds http_server_request_started and http_server_request_finished.
Siavash Tavakoli [Thu, 26 Aug 2021 12:13:55 +0000 (13:13 +0100)]
lib-http: http-server-request - Add request_id and status_code fields to event
sergey.kitov [Tue, 28 Sep 2021 12:35:21 +0000 (15:35 +0300)]
stats: Use duplicated metric settings in stats_metrics_add_dynamic().
Markus Valentin [Wed, 15 Sep 2021 12:44:42 +0000 (14:44 +0200)]
imapc: Add MAIL_STORAGE_CLASS_FLAG_SECONDARY_INDEX storage class flag
Add SECONDARY_INDEX storage class flag to enable storing shared private
indexes in obox user root bundle.
Timo Sirainen [Fri, 24 Sep 2021 14:33:38 +0000 (17:33 +0300)]
lib-storage: mail_get_binary_stream() - Add comment about having to unref returned istream
Timo Sirainen [Wed, 22 Sep 2021 12:58:55 +0000 (15:58 +0300)]
lib: test-cpu-limit - Remove dead code
No longer needed after
6d902507c24fca4f64e3e9bf7d79ae5a48281cd8
Timo Sirainen [Mon, 27 Sep 2021 08:49:05 +0000 (11:49 +0300)]
lib: test-strfuncs - Avoid testing p_strndup() with overlong max_chars parameter
This ended up in memchr() call with n=SIZE_MAX-1, which sometimes doesn't
work right with old glibc versions.
Fixes:
Panic: Trying to allocate
18446744073709551615 bytes
Aki Tuomi [Wed, 8 Sep 2021 07:39:36 +0000 (10:39 +0300)]
lib-mail: Add test for empty header value
Aki Tuomi [Thu, 2 Sep 2021 14:10:11 +0000 (17:10 +0300)]
lib-mail: Limit header length to 1000 bytes
Aki Tuomi [Thu, 2 Sep 2021 14:12:55 +0000 (17:12 +0300)]
lib-mail: If message header has no colon, store it as value only
If the header is missing :, it is not valid header. Storing it as
value only ensures it will be kept by mbox rewrite, but will not
be processed as a header.
Aki Tuomi [Thu, 2 Sep 2021 13:46:19 +0000 (16:46 +0300)]
lib-mail: test-message-header-parser - Add NAME10, 100, 1000 macros for testing
Aki Tuomi [Tue, 7 Sep 2021 11:37:34 +0000 (14:37 +0300)]
lib: Add i_memspn() and i_memcspn()
Binary data safe variants of strspn() and strcspn()
Timo Sirainen [Thu, 16 Sep 2021 11:32:37 +0000 (13:32 +0200)]
virtual: Log a debug message why backend mailbox has changed
Stephan Bosch [Fri, 24 Sep 2021 08:39:43 +0000 (10:39 +0200)]
lib-storage: mail-duplicate - Restructure mail_duplicate_read_db_file() to make sure fd is closed.
Found by Coverity.
Stephan Bosch [Fri, 24 Sep 2021 08:22:28 +0000 (10:22 +0200)]
lib-storage: mail-duplicate - Fix segfault occurring upon failure to lock and open DB file.
Found by Coverity.
Timo Sirainen [Wed, 18 Aug 2021 14:54:00 +0000 (16:54 +0200)]
indexer-worker: Fix event leak on error handling
Stephan Bosch [Tue, 13 Jul 2021 02:15:14 +0000 (04:15 +0200)]
lib-storage: mail-duplicate - Implement separate error code for deadlock.
Stephan Bosch [Wed, 15 Sep 2021 23:49:57 +0000 (01:49 +0200)]
lib-storage: mail-duplicate - Update records from duplicate DB file after acquirement of per-ID lock.
The process previously holding the per-ID lock may have updated the DB.
Stephan Bosch [Fri, 17 Sep 2021 09:11:21 +0000 (11:11 +0200)]
lib-storage: mail-duplicate - Move acquirement of dotlock for DB file into mail_duplicate_read().
Stephan Bosch [Mon, 20 Sep 2021 09:58:12 +0000 (11:58 +0200)]
lib-storage: mail-duplicate - Implement per-ID locking.
Stephan Bosch [Fri, 17 Sep 2021 09:16:39 +0000 (11:16 +0200)]
lib-storage: mail-duplicate - Allow calling mail_duplicate_read() more than once in a transaction.
Stephan Bosch [Tue, 13 Jul 2021 21:22:52 +0000 (23:22 +0200)]
lib-storage: mail-duplicate - Record an entry for both checked and marked IDs.
Still only write the marked IDs to the file. The in-memory record is needed for
the locking introduced in a later commit.
Stephan Bosch [Tue, 13 Jul 2021 03:03:02 +0000 (05:03 +0200)]
lib-storage: mail-duplicate - Add debug messages for transaction.
Stephan Bosch [Tue, 13 Jul 2021 03:07:39 +0000 (05:07 +0200)]
lib-storage: mail-duplicate - Add debug messages for database.
Stephan Bosch [Tue, 13 Jul 2021 02:40:24 +0000 (04:40 +0200)]
lib-storage: mail-duplicate - Add event to transaction object.
Stephan Bosch [Tue, 13 Jul 2021 02:53:11 +0000 (04:53 +0200)]
lib-storage: mail-duplicate - Add event to database object.
Stephan Bosch [Tue, 8 Jun 2021 01:51:10 +0000 (03:51 +0200)]
lib-storage: mail-duplicate - Restructure API to make it transaction-based.
Stephan Bosch [Tue, 13 Jul 2021 02:03:42 +0000 (04:03 +0200)]
lib-storage: mail-duplicate - Change mail_duplicate_check() return type from bool to enum.
Stephan Bosch [Fri, 17 Sep 2021 09:04:55 +0000 (11:04 +0200)]
lib-storage: Reformat mail-duplicate.c.
Stephan Bosch [Sat, 7 Aug 2021 13:43:35 +0000 (15:43 +0200)]
lib-storage: mail-user - Add mail_user_get_volatile_dir().
Stephan Bosch [Mon, 20 Sep 2021 00:45:23 +0000 (02:45 +0200)]
lib: file-lock - Adjust API to allow EDEADLK to be used by application.
It always caused a Dovecot panic before when returned from kernel.
Stephan Bosch [Sun, 19 Sep 2021 11:09:29 +0000 (13:09 +0200)]
lib: file-lock - Rework API to make it extensible.
Stephan Bosch [Mon, 20 Sep 2021 00:39:08 +0000 (02:39 +0200)]
lib: file-lock - Rename file_{wait,try}_lock_error() to file_{wait,try}_lock().
Stephan Bosch [Mon, 20 Sep 2021 00:29:55 +0000 (02:29 +0200)]
lib: file-lock - Remove file_{wait,try}_lock().
Stephan Bosch [Mon, 20 Sep 2021 00:26:46 +0000 (02:26 +0200)]
global: Avoid use of file_{wait,try}_lock().
Use the file_{wait,try}_lock_error() variants instead.
Timo Sirainen [Wed, 22 Sep 2021 14:36:27 +0000 (17:36 +0300)]
lib-http: test-http-client-errors - Allow more relaxed timeouts for connect retry tests
With max_connect_attempts=3 the connects come at (0ms, 100ms, 300ms).
Before the 3rd attempt a timeout at 250ms must have triggered, so there
was only 50ms time for it to trigger. This wasn't always enough when
running with valgrind on an overloaded system. Solve this by increasing
max_connect_attempts=4 so the 4th attempt comes at 700ms, giving the
timeout 450ms to trigger.
Timo Sirainen [Wed, 22 Sep 2021 09:14:08 +0000 (12:14 +0300)]
lib: Add most data_stack_grow event fields before checking if event is wanted
This allows using e.g. "event=data_stack_grow and alloc_size > 32768" as
an event filter.
Timo Sirainen [Tue, 21 Sep 2021 15:27:29 +0000 (18:27 +0300)]
config: Add data stack frame
Timo Sirainen [Tue, 21 Sep 2021 15:26:53 +0000 (18:26 +0300)]
doveconf: Avoid unnecessary data stack use when writing output
Timo Sirainen [Tue, 21 Sep 2021 15:21:54 +0000 (18:21 +0300)]
master: Create each service in its own data stack frame
Timo Sirainen [Tue, 21 Sep 2021 14:52:15 +0000 (17:52 +0300)]
doveadm: Call each run() in its own data stack frame
Timo Sirainen [Tue, 21 Sep 2021 14:14:44 +0000 (17:14 +0300)]
dsync: Add data stack frames to mailbox loops
Timo Sirainen [Tue, 21 Sep 2021 14:10:56 +0000 (17:10 +0300)]
dsync: Split off dsync_brain_recv_mailbox_tree_add()
Timo Sirainen [Tue, 21 Sep 2021 14:50:32 +0000 (17:50 +0300)]
acl: Code cleanup - Remove pointless while-loop
Timo Sirainen [Tue, 21 Sep 2021 14:03:45 +0000 (17:03 +0300)]
acl: acllist rebuild - Move data stack frame to caller's loop
Timo Sirainen [Tue, 21 Sep 2021 13:14:12 +0000 (16:14 +0300)]
acl: Add data stack frame when iterating mailboxes
Avoids wasting memory when there are a lot of mailboxes.
Timo Sirainen [Tue, 21 Sep 2021 14:51:15 +0000 (17:51 +0300)]
lib-storage: mail_user_unref() - Add data stack frame
The deinit code paths can sometimes eat up quite a lot of data stack.
Timo Sirainen [Wed, 22 Sep 2021 09:49:46 +0000 (12:49 +0300)]
lib-storage: mailbox_create() - Add data stack frames
Timo Sirainen [Wed, 22 Sep 2021 09:48:18 +0000 (12:48 +0300)]
lib-storage: Add data stack frames to [service] user initialization
Initialization steps can use a lot of data stack, so try to free it at
several checkpoints.
Timo Sirainen [Tue, 21 Sep 2021 14:49:34 +0000 (17:49 +0300)]
lib-storage: Add data stack frame when iterating mailboxes to build GUID cache
Timo Sirainen [Tue, 21 Sep 2021 14:48:33 +0000 (17:48 +0300)]
lib-storage: mailbox_verify_*name() - Add data stack frames
This function can eat up quite a lot of data stack.
Timo Sirainen [Tue, 21 Sep 2021 14:47:41 +0000 (17:47 +0300)]
lib-storage: str_contains_special_use() - Add data stack frame
This function is called in a loop by namespace_find_special_use().
Timo Sirainen [Tue, 21 Sep 2021 13:58:13 +0000 (16:58 +0300)]
lib-storage: List index rebuild - Add data stack frames
Timo Sirainen [Tue, 21 Sep 2021 13:57:13 +0000 (16:57 +0300)]
lib-storage: List index rebuild - Split off mail_storage_list_index_find_indexed_mailbox()
Timo Sirainen [Tue, 21 Sep 2021 13:37:13 +0000 (16:37 +0300)]
lib-storage: Don't use data stack for mailbox list index header update
There can be a lot of mailboxes, causing excessive data stack usage.
Timo Sirainen [Tue, 21 Sep 2021 13:42:39 +0000 (16:42 +0300)]
lib-index: Don't use data stack for building index header update buffer
The header update can be large (e.g. dovecot.list.index with many
mailboxes) and grow data stack unnecessarily.
Timo Sirainen [Tue, 21 Sep 2021 14:51:50 +0000 (17:51 +0300)]
lib: module_dir_deinit() - Call each deinit() in its own data stack frame
Timo Sirainen [Tue, 21 Sep 2021 13:15:54 +0000 (16:15 +0300)]
lib: test-data-stack - Make sure data stack memory usage doesn't leak
Timo Sirainen [Tue, 21 Sep 2021 10:38:27 +0000 (13:38 +0300)]
lib: test-cpu-limit - Remove checking for CPU usage upper limit
These tests keep randomly failing on loaded systems. It's more important
anyway to check that the minimum CPU usage is high enough than it is to
check that CPU usage isn't too high.
Timo Sirainen [Fri, 17 Sep 2021 13:11:12 +0000 (16:11 +0300)]
lib: Optimize str_tabescape()
Timo Sirainen [Fri, 17 Sep 2021 13:10:12 +0000 (16:10 +0300)]
lib: Optimize p_strsplit_tabescaped()
Timo Sirainen [Fri, 17 Sep 2021 13:06:17 +0000 (16:06 +0300)]
lib: Optimize t_strsplit_tabescaped()
Timo Sirainen [Fri, 17 Sep 2021 13:04:00 +0000 (16:04 +0300)]
lib: Optimize t_strsplit_tabescaped_inplace()
Timo Sirainen [Fri, 17 Sep 2021 13:02:10 +0000 (16:02 +0300)]
lib: Optimize t_strdup*()
Avoid zeroing the allocated data stack memory just before it's going to be
filled with the duplicated string anyway.
Timo Sirainen [Thu, 11 Mar 2021 23:41:35 +0000 (01:41 +0200)]
lib: Optimize t_str_tabunescape()
Timo Sirainen [Thu, 11 Mar 2021 23:38:13 +0000 (01:38 +0200)]
lib: Optimize str_tabunescape()
Timo Sirainen [Thu, 11 Mar 2021 23:27:30 +0000 (01:27 +0200)]
lib: Optimize str_append_tabescaped()
Avoid calling strlen() and replace for-loop with strcspn().
Timo Sirainen [Thu, 11 Mar 2021 23:23:04 +0000 (01:23 +0200)]
lib: Optimize str_append_tabescaped_n()
Timo Sirainen [Thu, 11 Mar 2021 23:19:38 +0000 (01:19 +0200)]
lib: Optimize p_strndup()
Timo Sirainen [Thu, 11 Feb 2021 00:56:11 +0000 (02:56 +0200)]
lib: Optimize buffer_append() and buffer_append_c()
Timo Sirainen [Thu, 11 Feb 2021 00:44:34 +0000 (02:44 +0200)]
lib: buffer_create_dynamic_max() - Fix max_size handling
Never allocate buffer larger than its max_size, since it's just wasted
memory. Also clarify that the allocation can actually go up to max_size+1
because of str_c() NUL byte reservation.
Timo Sirainen [Thu, 11 Feb 2021 00:30:12 +0000 (02:30 +0200)]
lib: buffer_append_zero() - Avoid unnecessary memset()