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.
Timo Sirainen [Tue, 28 Sep 2021 21:04:29 +0000 (00:04 +0300)]
lib-storage: When search parses message headers, deinitialize the parsing properly
index_mail_parse_header() was being called only for the actual headers.
This prevented it from being called with hdr=NULL to indicate that the
parsing is finished and should be deinitialized. Move the
index_mail_parse_header() to be called earlier so it's called also with
hdr=NULL.
Not deinitilizing the parsing could have caused assert-crashes later on in
some situations.
- proxy_session_started: Emitted before connecting to remote
- proxy_session_established: Emitted after connection to remote is established
and user is successfully logged in to the backend.
- proxy_session_finished: Emitted when proxying has ended. Either successfully
or with error.
Marco Bettini [Wed, 13 Oct 2021 11:49:43 +0000 (14:49 +0300)]
imap: list_send_status() - Fixes LIST-EXTENDED doesn't return STATUS for all folders
Sending LIST .. RETURN (SUBSCRIBED STATUS (...)) did not return STATUS for folders that are not subscribed when they have a child folder that is subscribed as mandated by IMAP RFC
Timo Sirainen [Wed, 6 Oct 2021 12:43:09 +0000 (15:43 +0300)]
imap-login: proxy: Don't forward untagged BYE responses to the client
It will just cause confusion, especially when connections are retried.
It could end up looking like:
x login user pass
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
x NO [UNAVAILABLE] Account is temporarily unavailable.
This makes sure that the istream size can't grow too large and waste memory.
Previously the istream max_buffer_size was dynamically changed to be the
smallest seen max_buffer_size in chained istreams. This mostly worked, but
sometimes the istream-chain's max_buffer_size was requested before even the
first istream was added to it.
Having an explicit max_buffer_size avoids all the problems of it being
dynamic, and there's not really any need for it anyway.
Timo Sirainen [Thu, 7 Oct 2021 11:52:12 +0000 (14:52 +0300)]
virtual: Fix assert-crash when backend mbox mailbox is deleted while virtual mailbox is open
The code wrongly thought that metadata lookup couldn't fail because it was
already successfully looked up. But the backend storage could still try to
refresh the mailbox to verify whether it still exists or not, and fail if
it was deleted.
This seems to have affected only the mbox mailbox format.
This doesn't currently make a difference, since istream-concat keeps them
internally referenced. In case this changes and snapshot handling isn't
fixed similarly to istream-chain, the unit test should now fail.
Timo Sirainen [Wed, 6 Oct 2021 14:37:40 +0000 (17:37 +0300)]
lib-imap-client: test-imapc-client - Increase connect timeout for most tests
The 500ms timeout could have been too short when running with valgrind on an
overloaded system. Increase it to 5 seconds, but keep 500ms for the tests
that expect a timeout.