Karl Fleischmann [Wed, 15 Dec 2021 08:19:40 +0000 (09:19 +0100)]
login-common: Explicitly null client auth fields on proxy pool unref
Explicitly setting `client_id` and `forward_fields` to null in the
client may reveal use-after-free issues when trying to access these
fields on a client proxy.
Karl Fleischmann [Fri, 10 Dec 2021 10:04:06 +0000 (11:04 +0100)]
login-common: Use base index for aliases
Define a base index for aliases in the login variable table. Assign
values via offset of that base index. This allows adding more values
later without updating any subsequent index.
Marco Bettini [Mon, 6 Dec 2021 10:54:16 +0000 (11:54 +0100)]
auth: userdb-ldap - Avoid early dereferencing
userdb_ldap_iterate_callback() is still invoked after dereferencing
auth_request in userdb_ldap_iterate_deinit().
Normally this happens only on teardown, but it may happens also
in case of auth disconnecting from auth-worker during iteration.
(which shouldn't happen unless the auth process crashes)
Timo Sirainen [Mon, 19 Apr 2021 16:48:09 +0000 (18:48 +0200)]
lib-storage: Optimize behavior when building THREAD tree with empty cache
Although it's possible that Date, Subject or received-date isn't actually
needed for all mails, it's much more efficient behavior to add all of these
to cache at the same time if they're not there already. Otherwise the same
mail could be opened and parsed up to 3 times.
Marco Bettini [Tue, 23 Nov 2021 15:03:07 +0000 (16:03 +0100)]
lib-storage: fail_mailbox_exists() - Return not found as a success instead of an error
GETMETADATA sometimes responds with “NO [SERVERBUG] BUG: Unknown internal error returned”,
instead of “NO Mailbox doesn't exist”, depending on the actual configuration.
This can happen with the shared namespace.
Stephan Bosch [Fri, 25 Sep 2020 01:48:09 +0000 (03:48 +0200)]
lib-smtp: smtp-client-transaction - Always drop MAIL/RCPT state data before calling callbacks.
This prevents problems with callbacks destroying the transaction, the
connection, or commands involved in the transaction. This at least fixes a
segmentation fault occurring in the submission service when STARTTLS fails
during login.
Stephan Bosch [Mon, 19 Jul 2021 09:53:41 +0000 (11:53 +0200)]
lib-http: http-client-connection - Fix crash in http_client_connection_server_close().
The conn->peer member is only not NULL when the connection is associated with a
peer object. If it is not, http_client_connection_server_close() will crash.
Fixed by doing the peer->client operations only when there is an associated peer.
sergey.kitov [Fri, 29 Oct 2021 11:06:39 +0000 (14:06 +0300)]
lib: Fix event filtering for unnamed events with optional event name
For example event filter "event=ev_name OR field1=value1" wouldn't previously match
if the event didn't have any name, even if it did have field1=value1.
Timo Sirainen [Tue, 26 Oct 2021 13:59:29 +0000 (16:59 +0300)]
lib-fts: Fix address tokenizer to handle large input properly
Previously it could have used excessive amounts of memory if the input
didn't contain separator characters.
The fix changes a bit how the address-tokenizer works: Previously large
email addresses were saved as truncated tokens. Now they're skipped
entirely by the address tokenizer. Similarly when searching long email
addresses they're no longer searched as truncated tokens, but instead
simply fed to the parent tokenizer which (likely) searches them in
smaller pieces.
Note that this also sometimes changes the order in which tokens are
returned, e.g. "foo", "example", "foo@example.com", "com" instead of
returning "com" before the email address. This isn't ideal, but fixing it
seems annoyingly complicated and practically it doesn't matter right now.
Timo Sirainen [Tue, 26 Oct 2021 13:34:25 +0000 (16:34 +0300)]
lib-fts: Implement support for parent tokenizer "streaming"
By default parent tokenizer is further tokenizing the token strings returned
by child tokenizer. When streaming is enabled, the parent tokenizers are
instead tokenizing a stream of data sent by the child tokenizer. This
effectively makes the parent tokenizer return the same tokens as if the
child tokenizer didn't exist (assuming child tokenizer feeds the parent
all the same input).
Arguably this should be the only way tokenizers work, but at least for now
lets keep both ways.
Stephan Bosch [Wed, 27 Jan 2021 12:39:23 +0000 (13:39 +0100)]
lib-master: master-auth - Add support for MAIL_AUTH_REQUEST_FLAG_IMPLICIT flag.
It signals that this login is implicit; no command reply is expected. This is
going to be used by the Submission service to implicitly login a user using the
EXTERNAL SASL mechanism when the first MAIL command is issued. In that case
sending a reply for the implicit AUTH command would break the protocol and this
new flag is used to signal the post-login submission service to not send an
initial reply.