]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Wed, 20 Jan 2021 15:54:49 +0000 (17:54 +0200)]
lib-index: Move fields from struct mail_index to struct mail_index_settings
This clarifies which fields are settings related.
Timo Sirainen [Wed, 20 Jan 2021 15:35:20 +0000 (17:35 +0200)]
lib-index: Remove mail_index_view.index_sync_view
Nothing was using it.
Timo Sirainen [Wed, 20 Jan 2021 15:34:01 +0000 (17:34 +0200)]
lib-index: Remove mail_index_view.transactions and related functions
It's enough to have transaction_list, nothing needs the count.
Timo Sirainen [Wed, 20 Jan 2021 15:31:36 +0000 (17:31 +0200)]
lib-index: Change mail_index_view_get_transaction_count() into _have_transactions()
This allows removing mail_index_view.transactions in the next commit.
Timo Sirainen [Wed, 20 Jan 2021 15:22:20 +0000 (17:22 +0200)]
lib-index: Rename mail_index.last_read_log_* to main_index_hdr_log_*
Also update the comment to describe better what the variables do.
Timo Sirainen [Tue, 19 Jan 2021 10:51:07 +0000 (12:51 +0200)]
lib-index: Remove mail_index_map.hdr_base
It was just causing unnecessary complexity. Simpler to just keep
hdr_copy_buf always up-to-date and access it directly.
Timo Sirainen [Fri, 29 Jan 2021 15:45:45 +0000 (17:45 +0200)]
lib-index: MAIL_TRANSACTION_LOG_VERSION_* - Add also FEATURE_ suffix for feature macros
This more clearly differentiates them from the other
MAIL_TRANSACTION_LOG_VERSION_* macros
Timo Sirainen [Fri, 29 Jan 2021 15:03:34 +0000 (17:03 +0200)]
lib-index: Verify that keywords in dovecot.index header don't change unexpectedly
Previously this was behind DEBUG for performance reasons, but that was only
because dovecot.index file used to be modified directly. Nowadays it's rare
that the index is being re-read within the same session (most changes are
read via dovecot.index.log), so it's better to verify that things are
working correctly.
Timo Sirainen [Tue, 19 Jan 2021 10:48:16 +0000 (12:48 +0200)]
lib-index: Add and use MAIL_INDEX_MAP_HDR_OFFSET() helper macro
Timo Sirainen [Tue, 19 Jan 2021 10:42:02 +0000 (12:42 +0200)]
lib-index: Fill mail_index_map.hdr_copy_buf also when mmap()ing index
This doesn't seem to have been necessary so far, but will be required by
the following changes.
Timo Sirainen [Mon, 3 May 2021 10:15:17 +0000 (13:15 +0300)]
imap: Fix using SETMETADATA NIL to unset value
Broken by
923362d27d9b2428e301614673cb0efba3bf928f
Timo Sirainen [Thu, 22 Apr 2021 08:36:40 +0000 (11:36 +0300)]
master: Explain how "client_limit is lower than required" is calculated in the warning
Josef 'Jeff' Sipek [Wed, 21 Apr 2021 14:41:27 +0000 (10:41 -0400)]
stats: Use only one filter for stats and exports
Since there is no way to have a exported-only metric (i.e., all metrics are
used for statistics calculations), the exported metrics are always a subset
of all metrics. Additionally, since exported metrics have a non-NULL
exporter info while stats-only metrics have a NULL, it is very easy to check
if a given metric shoud be exported or not.
We can combine these facts and simplify the event matching. We can simply
match against the "all metrics" filter, perform the statistics, and then
export the event if needed.
This reduces the CPU load quite dramatically since we are no longer
duplicating the matching for exported metrics. Stats-only metrics shouldn't
see any measurable difference in performance.
Josef 'Jeff' Sipek [Wed, 21 Apr 2021 15:50:54 +0000 (11:50 -0400)]
lib: event filter - Extend existing queries if context matches (event_filter_parse)
Since there is no practical difference between a filter with one query and a
filter with multiple queries using the same context pointer, we can extend
the existing queries as long as there is a context pointer match. This
reduces the number of queries (and filter expressions) thereby increasing
future optimization opportunities.
Josef 'Jeff' Sipek [Wed, 21 Apr 2021 15:47:51 +0000 (11:47 -0400)]
lib: event filter - Extend existing queries if context matches (event_filter_merge_with_context*)
Since there is no practical difference between a filter with one query and a
filter with multiple queries using the same context pointer, we can extend
the existing queries as long as there is a context pointer match. This
reduces the number of queries (and filter expressions) thereby increasing
future optimization opportunities.
Josef 'Jeff' Sipek [Wed, 21 Apr 2021 15:42:55 +0000 (11:42 -0400)]
lib: event filter - Extend existing queries if context matches (event_filter_add)
Since there is no practical difference between a filter with one query and a
filter with multiple queries using the same context pointer, we can extend
the existing queries as long as there is a context pointer match. This
reduces the number of queries (and filter expressions) thereby increasing
future optimization opportunities.
Josef 'Jeff' Sipek [Wed, 21 Apr 2021 15:52:27 +0000 (11:52 -0400)]
lib: event filter - Move add_node higher up in the file to avoid a prototype
Josef 'Jeff' Sipek [Wed, 21 Apr 2021 15:37:31 +0000 (11:37 -0400)]
lib: event filter - Add filter op argument to add_node
Josef 'Jeff' Sipek [Wed, 21 Apr 2021 15:19:31 +0000 (11:19 -0400)]
lib: event filter - Generalize query construction helpers
If instead of taking the internal query, they take a filter expression node,
they can be reused by optimizations in subsequent commits.
Timo Sirainen [Mon, 26 Apr 2021 16:49:22 +0000 (19:49 +0300)]
lib: Rename event_find_field() to event_find_field_nonrecursive() and make it public
Timo Sirainen [Tue, 16 Mar 2021 17:13:23 +0000 (19:13 +0200)]
lib: Reformat lib-event to avoid long lines
Timo Sirainen [Tue, 16 Mar 2021 17:09:06 +0000 (19:09 +0200)]
lib: Rename event_find_field*() to event_find_field_recursive*()
This clarifies how it works.
Timo Sirainen [Tue, 16 Mar 2021 16:26:20 +0000 (18:26 +0200)]
lib: event_find_field() - Rewrite without using recursion
This simplifies the following change.
Timo Sirainen [Tue, 9 Mar 2021 14:32:35 +0000 (16:32 +0200)]
lib: event_match_field() - Avoid recursing event fields twice
event_find_field() is already recursive.
Timo Sirainen [Tue, 9 Mar 2021 14:31:20 +0000 (16:31 +0200)]
lib: Split off event_has_category_nonrecursive()
Timo Sirainen [Thu, 11 Mar 2021 16:55:21 +0000 (18:55 +0200)]
lib-master: test-event-stats - Fix "large event id" test to check for END
Otherwise the END would be visible in the next test.
Timo Sirainen [Thu, 11 Mar 2021 16:29:45 +0000 (18:29 +0200)]
lib-master: test-event-stats - Avoid busy-looping while waiting for "test done" file
Aki Tuomi [Wed, 27 Jan 2021 08:55:14 +0000 (10:55 +0200)]
lib: event importing - Do not accept empty field name
Aki Tuomi [Tue, 15 Dec 2020 07:15:56 +0000 (09:15 +0200)]
lib: lib-event - Use named initializators for passthrough event
Aki Tuomi [Mon, 26 Apr 2021 12:39:36 +0000 (15:39 +0300)]
m4: Include local copy of pkg.m4
We need features not present in early versions. The variable=name
support has been there since 1.7.4 of pkg-config.
Timo Sirainen [Wed, 21 Apr 2021 16:18:07 +0000 (19:18 +0300)]
lib-storage: Avoid logging the same mail istream read error multiple times
Aki Tuomi [Mon, 26 Apr 2021 09:02:58 +0000 (12:02 +0300)]
master: Notify systemd after we are really stopped
Aki Tuomi [Mon, 26 Apr 2021 05:39:50 +0000 (08:39 +0300)]
Makefile.am: Fix systemd detection mess in automake
Aki Tuomi [Mon, 26 Apr 2021 05:29:02 +0000 (08:29 +0300)]
dovecot.service: Set type to notify only when compiling with systemd
Aki Tuomi [Mon, 26 Apr 2021 05:38:14 +0000 (08:38 +0300)]
Makefile.am: Make systemd service file generation more readable
Aki Tuomi [Mon, 26 Apr 2021 06:38:44 +0000 (09:38 +0300)]
configure.ac: Move CFLAGS to right place
Now it's in middle of passdb displaying
Timo Sirainen [Wed, 24 Mar 2021 14:09:51 +0000 (16:09 +0200)]
lib-storage: Fix detecting duplicate nodes in mailbox list index
The duplicates were checked only for root nodes, not for child nodes.
Siavash Tavakoli [Thu, 8 Apr 2021 16:08:54 +0000 (17:08 +0100)]
driver-mysql: Rollback a failed multi-statement transaction
If transaction failed, send "ROLLBACK" statement.
Siavash Tavakoli [Wed, 7 Apr 2021 15:44:00 +0000 (16:44 +0100)]
driver-mysql: Avoid BEGIN/COMMIT for single statement transactions
To reduce unnecessary load to database.
Timo Sirainen [Thu, 1 Apr 2021 17:39:27 +0000 (20:39 +0300)]
lib-imap: imap_bodystructure_write() - Return error on corruption instead of assert-crash
This could happen if broken message_parts came from cache and
message_part->data was newly read from the mail input.
Timo Sirainen [Thu, 8 Apr 2021 12:04:42 +0000 (15:04 +0300)]
lib-storage: Split off index_mail_parse_bodystructure_full()
Timo Sirainen [Fri, 9 Apr 2021 11:09:17 +0000 (14:09 +0300)]
lib-imap: fuzz-imap-bodystructure - Change failures to i_panic() instead of i_fatal()
Aki Tuomi [Thu, 4 Mar 2021 07:52:40 +0000 (09:52 +0200)]
NEWS: Mention XZ/LZMA removal.
Aki Tuomi [Tue, 2 Mar 2021 08:55:53 +0000 (10:55 +0200)]
NEWS: Update news for 2.3.14
Stephan Bosch [Tue, 30 Mar 2021 19:12:41 +0000 (21:12 +0200)]
lib-smtp: smtp-params - Make explicit which extra parameters can be written by smtp_params_*_write().
This can be used to prevent sending unsupported parameters to the remote server,
even when these are listed in extra_parameters. Before, blindly proxying
parameters would cause MAIL/RCPT error replies from the remote server.
Stephan Bosch [Tue, 30 Mar 2021 19:06:58 +0000 (21:06 +0200)]
lib-smtp: smtp-client-connection - Explicitly specify which MAIL/RCPT parameters are added by extra capabilities.
This is used in later commit to limit which custom parameters are actually sent
to the server based on the capabilities supported by said server.
Stephan Bosch [Tue, 30 Mar 2021 19:48:24 +0000 (21:48 +0200)]
lib-smtp: smtp-client-connection - Prevent recording extra capabilities from server more than once.
Stephan Bosch [Tue, 30 Mar 2021 19:45:33 +0000 (21:45 +0200)]
lib-smtp: smtp-client-connection - Prevent duplicate registrations for extra capabilities.
Stephan Bosch [Wed, 31 Mar 2021 10:33:38 +0000 (12:33 +0200)]
lib-smtp: smtp-client-connection - Move smtp_client_connection_find_extra_capability().
Stephan Bosch [Tue, 30 Mar 2021 19:33:17 +0000 (21:33 +0200)]
lib-smtp: smtp-client-connection - Change extra capability registration to use a struct.
This is needed for adding additional features in later commit.
Stephan Bosch [Tue, 30 Mar 2021 19:41:48 +0000 (21:41 +0200)]
lib-smtp: smtp-client-connection - Fix typo in function name.
Stephan Bosch [Tue, 30 Mar 2021 22:06:29 +0000 (00:06 +0200)]
lmtp: lmtp-commands - Drop XRCPTFORWARD parameter once processed.
This prevents it from popping up elsewhere. This for example crudely fixes a
problem in the proxy where XRCPTFORWARD was sent even without backend server support.
Timo Sirainen [Mon, 19 Apr 2021 09:46:44 +0000 (12:46 +0300)]
imap: NOTIFY - Fix crash if client disconnects while sending FETCH notification (try #2)
Continues the incomplete fix for
c4f4058d16096f23eea0b3182205d6653f5954dd
Fixes:
Panic: Trying to close mailbox INBOX with open transactions
Timo Sirainen [Fri, 16 Apr 2021 13:13:39 +0000 (16:13 +0300)]
login-common: Fix memory leak if anvil query is aborted
Aki Tuomi [Fri, 16 Apr 2021 08:18:15 +0000 (11:18 +0300)]
virtual: virtual-mail - Use index_mail_set_seq to ensure cleanup
Forgotten in
67ab2070cf513179382b564871f2a0f177987cc9
Aki Tuomi [Fri, 16 Apr 2021 08:16:36 +0000 (11:16 +0300)]
virtual: virtual-mail - Pass wanted_headers and wanted_fields to backend mails only
Broken in
67ab2070cf513179382b564871f2a0f177987cc9
Aki Tuomi [Fri, 16 Apr 2021 07:01:45 +0000 (10:01 +0300)]
virtual: virtual-mail - Use index_mail_free
Since we are using index_mail_init, we need to use index_mail_free
to free up the virtual mail.
Aki Tuomi [Fri, 16 Apr 2021 07:24:22 +0000 (10:24 +0300)]
virtual: virtual-mail - Free wanted headers in close if we are freeing
Simplifies next change
Aki Tuomi [Fri, 16 Apr 2021 07:03:33 +0000 (10:03 +0300)]
virtual: virtual-mail - Free up mails in virtual_mail_close if we are freeing up
Makes next change easier
Timo Sirainen [Wed, 14 Apr 2021 15:08:03 +0000 (18:08 +0300)]
lib: Add comment to CALLBACK_TYPECHECK() macro
Siavash Tavakoli [Wed, 31 Mar 2021 02:08:26 +0000 (03:08 +0100)]
lib-index: Add "mail_cache_lookup" event
Adds new event for cache lookups with lookup name as "field" event field.
Siavash Tavakoli [Wed, 31 Mar 2021 16:28:46 +0000 (17:28 +0100)]
lib-index: Small refactor in mail_cache_lookup_field()
Makes it easier to emit event in next commit regardless of code path.
Siavash Tavakoli [Mon, 29 Mar 2021 23:37:59 +0000 (00:37 +0100)]
lib-storage: Add "mail_expunged" event
Emitted when a message is actually expunged. Has UID as a field.
Siavash Tavakoli [Mon, 29 Mar 2021 12:41:55 +0000 (13:41 +0100)]
lib-storage, plugins/virtual: Use mail_sync_notify()
Instead of calling sync_notify vfunc directly.
Siavash Tavakoli [Mon, 29 Mar 2021 12:41:32 +0000 (13:41 +0100)]
lib-storage: Add mailbox_sync_notify()
Instead of calling sync_notify vfunc directly everywhere.
Siavash Tavakoli [Mon, 29 Mar 2021 12:01:40 +0000 (13:01 +0100)]
lib-storage: Emit "mail_expunge_requested" event
Adds a new event, "mail_expunge_requested" which is emitted when a
message is marked to being expunged.
Aki Tuomi [Wed, 10 Feb 2021 11:57:08 +0000 (13:57 +0200)]
lib-storage: Emit "mail_opened" event when mails opened
Adds a new event, "mail_opened" with "reason" as field. Also drop duplicate
event in index_mail_init_stream().
Siavash Tavakoli [Mon, 5 Apr 2021 23:38:06 +0000 (00:38 +0100)]
lib-storage: Include "age_days" field in mail.event
Goes back one week, if mail age information is known, an integer field is added
with value of mail age in number of days.
Siavash Tavakoli [Wed, 31 Mar 2021 15:08:06 +0000 (16:08 +0100)]
plugins/virtual: Use index_mail_init() to initialize the mail
Cleans up duplicated code. Also, index_mail_init initializes mail.event
as well. Something that was missing previously.
Siavash Tavakoli [Wed, 31 Mar 2021 15:01:02 +0000 (16:01 +0100)]
lib-storage: Refactor index_mail_init() to make it more reusable
Adds arguments for two memory pools, to be set for mail.pool and
mail.data_pool. If data_pool is NULL, a pool is allocated but mail_pool
is required.
Timo Sirainen [Thu, 11 Mar 2021 12:14:53 +0000 (14:14 +0200)]
lib-storage: Recreate mail.event when active mail is changed
This makes sure that the two mails' events are treated completely
independently without any accidental spilling. It also prevents wasting
memory if each mail changes the event and grows the memory pool.
Stephan Bosch [Mon, 12 Apr 2021 19:18:05 +0000 (21:18 +0200)]
lib-smtp: fuzz-smtp-server - Implement all callbacks required for full transaction.
Before required RCPT and DATA callbacks were omitted, causing assertion failures
when the fuzzer reached the RCPT stage.
Stephan Bosch [Mon, 12 Apr 2021 19:14:07 +0000 (21:14 +0200)]
lib-test: fuzzer - Fix FD-based fuzzing to only shutdown input FD upon end of data.
Before, it closed the whole socket once the data input ended. This for
example caused the SMTP server fuzzer to end before all replies were sent. This
shortened the test and could have hidden bugs that occur later in the SMTP
transaction.
Stephan Bosch [Mon, 12 Apr 2021 19:12:27 +0000 (21:12 +0200)]
lib-smtp: smtp-reply - Add debug message for reply send error.
This makes it a little clearer at what point the connection loss or error was
noticed and for which command/reply.
Timo Sirainen [Wed, 14 Apr 2021 08:57:39 +0000 (11:57 +0300)]
lib-lua: Fix compiler warning with dlua_pcall_yieldable()
Markus Valentin [Fri, 9 Apr 2021 09:35:05 +0000 (11:35 +0200)]
lib-storage: Make sure listescape can work correctly with shared namespaces
This makes sure that if storage_name_escape_char is set, shared mailboxes
do not return the invalid/unescaped mailbox storage_name internally which
could result in failures like "Invalid mailbox name: Name must not have '/'
character" even when using the listescape plugin.
Broken by
5fd5ad3a2be6708e81f8dcfcbb06a3957dddd276
Timo Sirainen [Thu, 1 Apr 2021 18:42:02 +0000 (21:42 +0300)]
lib: Fix buffer_t aliasing problems with LTO
This changes the buffer_t slightly, which requires adding extra braces
when buffer_t contents are directly defined.
This changes Dovecot to require C11 compatible compiler, because it uses
anonymous union and struct. GNU99 extensions are also enough.
Timo Sirainen [Thu, 1 Apr 2021 18:37:27 +0000 (21:37 +0300)]
lib: buffer - Change real_buffer.r_buffer type to const void *
Timo Sirainen [Thu, 1 Apr 2021 09:47:15 +0000 (12:47 +0300)]
imap: Fix accessing uninitialized variable warning with LTO
There doesn't seem to be any other way to quiet this warning, although
it's wrong.
Timo Sirainen [Thu, 1 Apr 2021 09:45:39 +0000 (12:45 +0300)]
doveadm dict: Handle missing parameters without crashing
Timo Sirainen [Thu, 1 Apr 2021 09:20:46 +0000 (12:20 +0300)]
global: Fix accessing uninitialized variables on unit test failures
Timo Sirainen [Thu, 1 Apr 2021 09:33:33 +0000 (12:33 +0300)]
lib-imap: imap_envelope_parse() - Refactor to avoid LTO warnings
The original code was correct, but gcc with LTO still gave warnings about
potentially uninitialized envlp_r and error_r.
Timo Sirainen [Thu, 1 Apr 2021 09:22:37 +0000 (12:22 +0300)]
lib: test-array - Fix LTO compiler warnings
-flto correctly realizes that the source buffer size is 1, while memcpy() is
trying to copy UINT_MAX. Try to hide this by allocating the source buffer
dynamically. The intention is to assert-crash anyway before the memcpy() is
reached.
Aki Tuomi [Tue, 13 Apr 2021 09:45:45 +0000 (12:45 +0300)]
lib-compression: ostream-zstd - Do not return 0 as default
This is accepted by the library but does complicate things with dovecot.
Aki Tuomi [Tue, 13 Apr 2021 09:45:23 +0000 (12:45 +0300)]
lib-compression: ostream-zstd - Fix assert on value range
Arjen de Korte [Sat, 10 Apr 2021 11:52:15 +0000 (13:52 +0200)]
doc/openssl.cnf: Increase default_bits to 2048
NIST guidelines mandate that all SSL certificates must be of at least 2048 key length
Aki Tuomi [Fri, 26 Mar 2021 12:10:37 +0000 (14:10 +0200)]
global: Update default TLS protocol to TLSv1.2
Aki Tuomi [Tue, 6 Apr 2021 12:42:22 +0000 (15:42 +0300)]
lib-ssl-iostream: Accept TLS version case-insensitive
Aki Tuomi [Fri, 26 Mar 2021 12:11:48 +0000 (14:11 +0200)]
lib-ssl-iostream: Add additional supported protocols
ANY - Any protocol version accepted
TLSv1.3 - Self-explanatory
LATEST - The newest protocol only
Aki Tuomi [Fri, 26 Mar 2021 10:08:40 +0000 (12:08 +0200)]
lib-master: Add ssl_cipher_suites
Aki Tuomi [Thu, 1 Apr 2021 09:41:40 +0000 (12:41 +0300)]
imap-zlib: Support per-algorithm compression level
Aki Tuomi [Tue, 30 Mar 2021 16:05:42 +0000 (19:05 +0300)]
zlib: Check that compression level is within supported range
Aki Tuomi [Tue, 30 Mar 2021 16:04:31 +0000 (19:04 +0300)]
imap-zlib: Check that compression level is within supported range
Aki Tuomi [Tue, 30 Mar 2021 16:03:30 +0000 (19:03 +0300)]
fs-compress: Check that compression range is within supported range
Aki Tuomi [Thu, 1 Apr 2021 06:26:10 +0000 (09:26 +0300)]
lib-compression: Implement min/default/max getters
Aki Tuomi [Tue, 30 Mar 2021 16:01:20 +0000 (19:01 +0300)]
lib-compression: Add compression level range to handlers
Aki Tuomi [Tue, 30 Mar 2021 15:54:42 +0000 (18:54 +0300)]
lib-compression: Use designated initializers for compression handlers
Aki Tuomi [Thu, 1 Apr 2021 06:51:09 +0000 (09:51 +0300)]
m4: want_zstd.m4 - Detect is ZSTD_minCLevel is present
Josef 'Jeff' Sipek [Fri, 5 Feb 2021 19:48:52 +0000 (14:48 -0500)]
lib-compression: Be explicit about xz magic number including a \0
Stephan Bosch [Thu, 8 Apr 2021 23:49:21 +0000 (01:49 +0200)]
lib-smtp: test-smtp-server-errors - Add actual HELO tests to "bad HELO" test.
Before, it only tested the EHLO command.