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.
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.