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.
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.
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.
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.
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 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 [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: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.
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.
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.
Stephan Bosch [Fri, 11 Sep 2020 19:08:03 +0000 (21:08 +0200)]
lib-smtp: smtp-server-cmd-helo - Fix panic occurring for default HELO reply.
This only fails for the HELO command; the EHLO command is unaffected. The
default reply routine is not actually used at the moment, but it is used by the
fuzzer.
Stephan Bosch [Tue, 23 Mar 2021 09:27:23 +0000 (10:27 +0100)]
lib-smtp: smtp-server-cmd-data - Fix crash occurring when BDAT is the last in a too long sequence of bad commands.
When smtp_server_reply() detects that too many replies were sent regarding
syntax errors, it will terminate the connection. Most commands will just stop
processing and exit when a reply is submitted, so no crash occurs for those.
However, BDAT will try to skip the data block, so that it will not be
interpreted as a large set of input commands, which subsequentely crashes
because the command parser is already gone after terminating the connection.
Markus Valentin [Wed, 24 Mar 2021 08:43:17 +0000 (09:43 +0100)]
imapc: imapc_list_get_fs() - Set index_pvt_dir for mailbox_list_settings
To allow using private indexes with imapc storage the index_pvt_dir must
be set when listing the mailbox. Previously this did not happen because
the index_pvt_dir was simply NULL, now the value is copied from the
imapc_mailbox_list.