]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Aki Tuomi [Wed, 29 Jul 2020 08:29:12 +0000 (11:29 +0300)]
Released v2.3.11.3
Aki Tuomi [Wed, 29 Jul 2020 08:28:50 +0000 (11:28 +0300)]
NEWS: Add NEWS for 2.3.11.3
Timo Sirainen [Wed, 29 Jul 2020 07:40:17 +0000 (10:40 +0300)]
pop3: Fix assert-crash when using pop3_deleted_flag
Broken by
6d18044e1408ce98aa8ef145a9f85895829a7bc7
Fixes:
Panic: file seq-range-array.c: line 472 (seq_range_array_invert): assertion failed: (range[count-1].seq2 <= max_seq)
Timo Sirainen [Wed, 15 Jul 2020 09:42:59 +0000 (12:42 +0300)]
pop3-login: Fix handling commands that are sent in multiple IP packets
This happened especially if the commands were long, like XCLIENT.
This got broken by recent pop3-login changes.
Aki Tuomi [Tue, 28 Jul 2020 10:25:44 +0000 (13:25 +0300)]
Released v2.3.11.2
Aki Tuomi [Tue, 28 Jul 2020 08:02:06 +0000 (11:02 +0300)]
NEWS: Add NEWS for 2.3.11.2
Aki Tuomi [Fri, 10 Jul 2020 08:00:14 +0000 (11:00 +0300)]
lib-test: Rename s1, s2 to _temp_s1, _temp_s2 in test_assert_strcmp_idx
Some test code uses s1 and s2 as variable names.
Broken in
449539dc52070bebde3ae7babe96e6e272dd7101
Aki Tuomi [Thu, 9 Jul 2020 06:38:37 +0000 (09:38 +0300)]
pop3-login: Use struct client authenticating member
This is what should be used instead of introducing our own.
Broken in
6c55437036b3de11804eb68f66d84cb164c33d63
Aki Tuomi [Thu, 9 Jul 2020 06:39:48 +0000 (09:39 +0300)]
pop3-login: Consume line after mech probe
Otherwise we read next line empty and that causes -ERR.
Broken in
6c55437036b3de11804eb68f66d84cb164c33d63
Aki Tuomi [Wed, 8 Jul 2020 07:59:48 +0000 (10:59 +0300)]
lib: istream - Do not attempt read past end in i_stream_next_line_finish
Aki Tuomi [Wed, 8 Jul 2020 09:58:56 +0000 (12:58 +0300)]
lib-test: test_assert_strcmp_idx - Avoid double evaluation
Aki Tuomi [Wed, 8 Jul 2020 05:55:31 +0000 (08:55 +0300)]
pop3-login: Read command more carefully
Ensure we don't consume '\n' or '\0' when reading command, but
that we consume '\r' otherwise i_stream_read_next_line won't work properly.
Aki Tuomi [Tue, 30 Jun 2020 11:02:34 +0000 (14:02 +0300)]
pop3-login: Read SASL-IR properly
This fixes issue where login would fail if SASL-IR message would
be too long.
Aki Tuomi [Tue, 30 Jun 2020 11:01:12 +0000 (14:01 +0300)]
pop3-login: Read command separately
Simplifies next commit
Aki Tuomi [Wed, 1 Jul 2020 11:49:36 +0000 (14:49 +0300)]
auth: db-lua - Fix user iteration
The old code did not leave the stack empty after finishing up,
that would lead into stack being left dirty and accumulating
per each call.
Aki Tuomi [Wed, 1 Jul 2020 10:18:03 +0000 (13:18 +0300)]
auth: db-lua - Always set callback when iterating
Aki Tuomi [Fri, 26 Jun 2020 15:31:11 +0000 (18:31 +0300)]
lib-lua: Register panic handler
Aki Tuomi [Fri, 26 Jun 2020 15:27:18 +0000 (18:27 +0300)]
auth: db-lua - Ensure stack is empty at end
Aki Tuomi [Fri, 26 Jun 2020 15:29:46 +0000 (18:29 +0300)]
auth: db-lua - Pop dovecot after registering
Aki Tuomi [Fri, 26 Jun 2020 09:21:40 +0000 (12:21 +0300)]
auth: db-lua - Pop result after lookup
When doing lookups, the lookup result was not popped.
Aki Tuomi [Fri, 26 Jun 2020 09:16:31 +0000 (12:16 +0300)]
lib-lua: Add dlua_dump_stack
Useful for debugging why stack leaks
Aki Tuomi [Tue, 30 Jun 2020 08:50:26 +0000 (11:50 +0300)]
NEWS: Add news for 2.3.11
Timo Sirainen [Thu, 2 Jul 2020 14:31:19 +0000 (17:31 +0300)]
lib-mail: Fix handling trailing "--" in MIME boundaries
Broken by
5b8ec27fae941d06516c30476dcf4820c6d200ab
Aki Tuomi [Tue, 30 Jun 2020 08:23:53 +0000 (11:23 +0300)]
configure: Update version
Timo Sirainen [Thu, 11 Jun 2020 09:59:14 +0000 (12:59 +0300)]
imap: Fix assert-crash in COPY/MOVE when storage doesn't return UIDs
For example copying mails into virtual storage crashed.
Broken by
09413e35f764a2898cbc26cea94218eed6df5cbf
Fixes:
Panic: file cmd-copy.c: line 152 (fetch_and_copy): assertion failed: (copy_ctx->copy_count == seq_range_count(©_ctx->saved_uids))
Timo Sirainen [Tue, 9 Jun 2020 08:40:53 +0000 (11:40 +0300)]
lib-compression: istream-zstd - Fix infinite loop when istream is nonblocking
Aki Tuomi [Thu, 4 Jun 2020 10:15:11 +0000 (13:15 +0300)]
lib-oauth2: oauth-jwt - Ensure / and . are escaped in kid
Aki Tuomi [Thu, 4 Jun 2020 07:41:32 +0000 (10:41 +0300)]
dovecot-oauth2.conf.ext: Update to match code
Aki Tuomi [Thu, 4 Jun 2020 07:23:36 +0000 (10:23 +0300)]
auth: db-oauth2 - Add more performant defaults for lib-http
Aki Tuomi [Wed, 3 Jun 2020 12:40:40 +0000 (15:40 +0300)]
lib-oauth2: Use azp to find token
This validates that the token is actually for us and also allows
having multiple tokens with same ID but different issuer.
Aki Tuomi [Wed, 3 Jun 2020 12:40:04 +0000 (15:40 +0300)]
lib-oauth2: Validate signature in jwt body process
This way we can utilize fields from body with validation.
Aki Tuomi [Wed, 3 Jun 2020 12:35:48 +0000 (15:35 +0300)]
lib-oauth2: Rename algo to alg
It's the field name.
Aki Tuomi [Tue, 2 Jun 2020 12:59:37 +0000 (15:59 +0300)]
lib-oauth2: Add iss validation support
Aki Tuomi [Tue, 2 Jun 2020 12:52:34 +0000 (15:52 +0300)]
lib-oauth2: Ensure token algorithm matches with key
Otherwise we might mistakenly use key that is not intended
for the token.
Aki Tuomi [Tue, 2 Jun 2020 13:07:48 +0000 (16:07 +0300)]
lib-oauth2: oauth2-jwt - Always uppercase algorithm
Timo Sirainen [Thu, 28 May 2020 09:49:33 +0000 (12:49 +0300)]
lib-mail: message-parser - Fix assert-crash if parsing is stopped early
Some callers don't want to parse the full message.
Fixes:
Panic: file message-parser.c: line 793 (message_parser_deinit_from_parts): assertion failed: (ctx->nested_parts_count == 0)
Timo Sirainen [Wed, 27 May 2020 08:35:55 +0000 (11:35 +0300)]
lib-mail: Fix parse_too_many_nested_mime_parts()
This was originally correct, until it was "optimized" wrong and got merged.
Aki Tuomi [Wed, 27 May 2020 06:09:45 +0000 (09:09 +0300)]
auth: db-oauth2 - Remove extra oauth2 prefix from log messages
Aki Tuomi [Tue, 26 May 2020 09:46:29 +0000 (12:46 +0300)]
auth, lib-oauth2: Add local introspection mode
Local introspection attempts to decode token always.
This will also happen with password grant, saving
an extra roundtrip to oauth2 server.
Aki Tuomi [Tue, 26 May 2020 06:53:26 +0000 (09:53 +0300)]
auth: db-oauth2 - Use common code for lookup and password grant
Aki Tuomi [Tue, 26 May 2020 10:38:09 +0000 (13:38 +0300)]
auth: db-oauth2 - Clarify how introspect gets called
This should make it more obvious when introspection
actually gets called after lookup.
Introspection failure is now also moved earlier, before
the request would fail later because not all fields
are available.
Aki Tuomi [Tue, 26 May 2020 09:12:32 +0000 (12:12 +0300)]
auth: db-oauth2 - Add token parameter to db_oauth2_local_validation
Aki Tuomi [Mon, 25 May 2020 18:42:08 +0000 (21:42 +0300)]
auth: db-oauth2 - Move db_oauth2_local_validation
Simplifies next change
Aki Tuomi [Mon, 25 May 2020 18:47:35 +0000 (21:47 +0300)]
auth: db-oauth2 - Move db_oauth2_lookup_continue
Simplifies next change
Aki Tuomi [Tue, 26 May 2020 18:24:02 +0000 (21:24 +0300)]
auth: db-oauth2 - Do not fallback into remote validation anymore
It makes no sense anymore with introspection_mode=local. One should
make another passdb.
Aki Tuomi [Mon, 25 May 2020 18:18:45 +0000 (21:18 +0300)]
auth: db-oauth2 - Fix whitespace issue
Aki Tuomi [Tue, 26 May 2020 18:22:51 +0000 (21:22 +0300)]
lib-oauth2: Use hash instead of hash2
Hash2 doesn't work as we want. Fixes key caching
to actually work.
Aki Tuomi [Mon, 25 May 2020 13:19:14 +0000 (16:19 +0300)]
lib-oauth2: Allow nbf and iat to be 0
Some implementations set these intentionally to 0.
Timo Sirainen [Thu, 23 Apr 2020 14:09:33 +0000 (17:09 +0300)]
lib-mail: message-parser - Support limiting max number of MIME parts
The default is to allow 10000 MIME parts. When it's reached, no more
MIME boundary lines will be recognized, so the rest of the mail belongs
to the last added MIME part.
Timo Sirainen [Thu, 23 Apr 2020 13:59:40 +0000 (16:59 +0300)]
lib-mail: message-parser - Support limiting max number of nested MIME parts
The default is to allow 100 nested MIME parts. When the limit is reached,
the innermost MIME part's body contains all the rest of the inner bodies
until a parent MIME part is reached.
Timo Sirainen [Thu, 23 Apr 2020 13:50:56 +0000 (16:50 +0300)]
lib-mail, global: message_parser_init*() - Convert flags to settings structure
Timo Sirainen [Thu, 23 Apr 2020 12:00:57 +0000 (15:00 +0300)]
lib-mail: message-parser - Don't use memory pool for parser
This reduces memory usage when parsing many MIME parts where boundaries are
being added and removed constantly.
Timo Sirainen [Thu, 23 Apr 2020 11:53:27 +0000 (14:53 +0300)]
lib-mail: message-parser - Add boundary_remove_until() helper function
Timo Sirainen [Thu, 23 Apr 2020 10:06:02 +0000 (13:06 +0300)]
lib-mail: message-parser - Optimize boundary lookups when exact boundary is found
When an exact boundary is found, there's no need to continue looking for
more boundaries.
Timo Sirainen [Thu, 23 Apr 2020 09:53:12 +0000 (12:53 +0300)]
lib-mail: message-parser - Truncate excessively long MIME boundaries
RFC 2046 requires that the boundaries are a maximum of 70 characters
(excluding the "--" prefix and suffix). We allow 80 characters for a bit of
extra safety. Anything longer than that is truncated and treated the same
as if it was just 80 characters.
Timo Sirainen [Thu, 23 Apr 2020 09:10:07 +0000 (12:10 +0300)]
lib-mail: message-parser - Minor code cleanup to finding the end of boundary line
Timo Sirainen [Thu, 23 Apr 2020 09:00:38 +0000 (12:00 +0300)]
lib-mail: message-parser - Optimize appending new part to linked list
Timo Sirainen [Thu, 23 Apr 2020 08:36:48 +0000 (11:36 +0300)]
lib-mail: message-parser - Optimize updating children_count
Timo Sirainen [Thu, 23 Apr 2020 08:34:22 +0000 (11:34 +0300)]
lib-mail: message-parser - Change message_part_append() to do all work internally
Timo Sirainen [Thu, 23 Apr 2020 08:33:31 +0000 (11:33 +0300)]
lib-mail: message-parser - Add a message_part_finish() helper function
Timo Sirainen [Thu, 23 Apr 2020 08:47:18 +0000 (11:47 +0300)]
lib-mail: Move message_parser_init_from_parts() handling to its own file
This helps to see what code they have in common.
Timo Sirainen [Thu, 23 Apr 2020 08:27:14 +0000 (11:27 +0300)]
lib-mail: test-message-parser - Test that children_count is correct
Timo Sirainen [Thu, 23 Apr 2020 08:14:04 +0000 (11:14 +0300)]
lib-mail: test-message-parser - Add another test for boundary matching
Timo Sirainen [Tue, 19 May 2020 16:11:34 +0000 (19:11 +0300)]
lib-storage: mail_search_args_init() - Expand "*" in SEARCH_SEQSET
This is now required by the IMAP MOVE code to correctly handle
"MOVE * folder".
Timo Sirainen [Tue, 19 May 2020 15:31:31 +0000 (18:31 +0300)]
imap: imap_search_seqset_iter_next() - Assert-crash if iteration doesn't progress
This can be done easily with seq_range_array_remove_seq_range(). This is
cleaner to use than invert+intersect. I originally didn't notice that
this function existed.
Timo Sirainen [Tue, 19 May 2020 16:10:59 +0000 (19:10 +0300)]
lib: Add unit test for seq_range_array_remove_range()
Timo Sirainen [Mon, 18 May 2020 09:01:44 +0000 (12:01 +0300)]
lib-storage: mail_search_args_init() - Fix converting UIDSET * to SEQSET on empty mailbox
The "*" caused seq=0 to be added to the seqset. This could have caused
unexpected issues.
Fixes at least UID MOVE on empty mailbox:
Panic: file seq-range-array.c: line 471 (seq_range_array_invert): assertion failed: (range[0].seq1 >= min_seq)
Before
1a5d89d2bfa031903e88af9aff7eafc1b373d521 this assert-crash didn't
happen, but it went to infinite loop.
Aki Tuomi [Mon, 18 May 2020 10:08:45 +0000 (13:08 +0300)]
auth: test-mech - Add tests for RPA and NTLM bug
Aki Tuomi [Mon, 18 May 2020 09:33:39 +0000 (12:33 +0300)]
lib-ntlm: Check buffer length on responses
Add missing check for buffer length.
If this is not checked, it is possible to send message which
causes read past buffer bug.
Broken in
c7480644202e5451fbed448508ea29a25cffc99c
Aki Tuomi [Wed, 6 May 2020 10:40:36 +0000 (13:40 +0300)]
auth: mech-rpa - Fail on zero len buffer
Timo Sirainen [Mon, 11 May 2020 16:00:25 +0000 (19:00 +0300)]
pop3: Use separate search queries for expunging and setting \Seen flags
Using a single shared search query causes mail prefetching to behave
inefficiently. Especially lazy_expunge plugin could have done refcount
prefetch for non-deleted mails as well.
Timo Sirainen [Mon, 11 May 2020 16:00:04 +0000 (19:00 +0300)]
pop3: Split off pop3_search_build_seqset()
Timo Sirainen [Mon, 11 May 2020 15:50:18 +0000 (18:50 +0300)]
pop3: Minor optimization to unexpected client disconnections
There's no need to build deleted messages seqset if it's not used.
Timo Sirainen [Thu, 14 May 2020 19:55:05 +0000 (22:55 +0300)]
dict: When client is disconnected, make sure its input IO is removed
Just in case it takes a while to fully unreference the client, make sure its
input callback won't be called rapidly.
Timo Sirainen [Thu, 14 May 2020 19:52:34 +0000 (22:52 +0300)]
dict: Fix deinitializing dict iteration if client disconnects
If the client's ostream was full at the disconnection time, the iteration
wasn't aborted. Instead, the connection was kept forever and its input
callback was kept being called rapidly, causing 100% CPU usage.
Timo Sirainen [Thu, 14 May 2020 19:52:08 +0000 (22:52 +0300)]
dict: Split off cmd_iterate_flush_finish()
Stephan Bosch [Fri, 20 Mar 2020 12:38:41 +0000 (13:38 +0100)]
lmtp: lmtp-commands - Explicity prohibit empty RCPT path.
The empty path <""> will yield an empty username.
Stephan Bosch [Fri, 20 Mar 2020 12:37:04 +0000 (13:37 +0100)]
lib-smtp: smtp-address - Only produce a <> address in smtp_address_clone() when that is the input.
It also produced an effective null address when the localpart was empty.
Stephan Bosch [Fri, 20 Mar 2020 12:35:19 +0000 (13:35 +0100)]
lib-smtp: smtp-address - Don't recognize an address with empty localpart as <>.
Depending on context, the addresses <""@domain.tld> and <""> are potentially
valid non-null addresses.
Stephan Bosch [Sun, 22 Mar 2020 17:14:44 +0000 (18:14 +0100)]
lib-smtp: smtp-address - Don't return NULL from smtp_address_clone*() unless the input is NULL.
Stephan Bosch [Tue, 24 Mar 2020 11:59:15 +0000 (12:59 +0100)]
lib-smtp: test-smtp-server-errors - Add tests for large series of empty and bad commands.
Stephan Bosch [Tue, 24 Mar 2020 11:25:03 +0000 (12:25 +0100)]
lib-smtp: smtp-server-connection - Hold a command reference while executing a command.
This fixes a use-after-free problem at the end of
smtp_server_connection_handle_command().
Stephan Bosch [Tue, 24 Mar 2020 11:23:32 +0000 (12:23 +0100)]
lib-smtp: smtp-server-command - Perform initial command execution in separate function.
Stephan Bosch [Tue, 24 Mar 2020 11:13:43 +0000 (12:13 +0100)]
lib-smtp: smtp-server-command - Guarantee that non-destroy hooks aren't called for an ended command.
Stephan Bosch [Tue, 24 Mar 2020 21:33:45 +0000 (22:33 +0100)]
lib-smtp: test-smtp-server-errors - Add tests for VRFY and NOOP commands with invalid parameters.
Stephan Bosch [Tue, 24 Mar 2020 21:24:20 +0000 (22:24 +0100)]
lib-smtp: Add tests for smtp_string_parse() and smtp_string_write().
Stephan Bosch [Tue, 24 Mar 2020 21:42:15 +0000 (22:42 +0100)]
lib-smtp: smtp-syntax - Return 0 for smtp_string_parse() with empty input.
This is what the current users of this function actually expect.
Stephan Bosch [Tue, 24 Mar 2020 20:14:34 +0000 (21:14 +0100)]
lib-smtp: smtp-syntax - Do not allow NULL return parameters for smtp_ehlo_line_parse().
Stephan Bosch [Tue, 24 Mar 2020 20:11:01 +0000 (21:11 +0100)]
lib-smtp: smtp-syntax - Do not allow NULL return parameters for smtp_xtext_parse().
Stephan Bosch [Tue, 24 Mar 2020 19:57:03 +0000 (20:57 +0100)]
lib-smtp: smtp-syntax - Do not allow NULL return parameters for smtp_string_parse().
Stephan Bosch [Tue, 24 Mar 2020 20:05:17 +0000 (21:05 +0100)]
lib-smtp: smtp-server-cmd-vrfy - Restructure parameter parsing.
Stephan Bosch [Tue, 24 Mar 2020 20:00:19 +0000 (21:00 +0100)]
lib-smtp: Reformat smtp-server-cmd-vrfy.c.
Stephan Bosch [Tue, 24 Mar 2020 20:08:37 +0000 (21:08 +0100)]
lib-smtp: Reformat smtp-server-cmd-noop.c.
Stephan Bosch [Tue, 24 Mar 2020 19:51:24 +0000 (20:51 +0100)]
lib-smtp: Reformat smtp-syntax.c.
Stephan Bosch [Tue, 24 Mar 2020 19:45:21 +0000 (20:45 +0100)]
lib-smtp: Reformat smtp-syntax.h.
Aki Tuomi [Wed, 13 May 2020 07:52:50 +0000 (10:52 +0300)]
auth: test-mech - Remove auth-token-secret.dat after test suite
Aki Tuomi [Tue, 12 May 2020 06:48:06 +0000 (09:48 +0300)]
auth: mech-digest-md5 - Do not read past buffer on right trim
If the string does not have comma at the end, do not progress
the pointer past buffer end.
Aki Tuomi [Tue, 12 May 2020 06:22:20 +0000 (09:22 +0300)]
auth: test-mech - Fix memory leaks
Forgotten in
f6bb82a222e7973e9f9b7056dfe015fe3d8632f7
Timo Sirainen [Mon, 11 May 2020 14:25:41 +0000 (17:25 +0300)]
lib-index: Index rebuilding lost fields in cache
Regression caused by
5f6d2134690e4b84d38d556e3086668e32f30b50
Timo Sirainen [Mon, 11 May 2020 14:23:19 +0000 (17:23 +0300)]
lib-index: Fix setting initial last_used for fields in mail_[always_]cache_fields
These fields had last_used=0 until the field was accessed. If cache was
purged before this access, the field was dropped. Fixed by assuming
(last_used=0, decision!=NO) is still the first time the field is being
used. This also causes it to trigger mail_cache_decision_changed event.