]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
3 years agolib-http: Reformat http-client-connection.c.
Stephan Bosch [Sat, 27 Jun 2020 15:55:58 +0000 (17:55 +0200)] 
lib-http: Reformat http-client-connection.c.

3 years agolib: Add unit tests for named events only optimization.
sergey.kitov [Fri, 29 Oct 2021 08:42:40 +0000 (11:42 +0300)] 
lib: Add unit tests for named events only optimization.

3 years agolib: Fix event filtering for unnamed events with optional event name
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.

3 years agolib-master: Whitespace cleanup.
sergey.kitov [Fri, 22 Oct 2021 09:09:24 +0000 (12:09 +0300)] 
lib-master: Whitespace cleanup.

3 years agoauth: passdb-cache - Preserve cached fields when verifying password with worker
Aki Tuomi [Tue, 9 Nov 2021 12:37:07 +0000 (14:37 +0200)] 
auth: passdb-cache - Preserve cached fields when verifying password with worker

3 years agolib-smtp: smtp-server-command - Hold a command reference while sending replies.
Stephan Bosch [Fri, 5 Nov 2021 16:11:49 +0000 (17:11 +0100)] 
lib-smtp: smtp-server-command - Hold a command reference while sending replies.

Fixes segfault at smtp-server-reply.c:652.

3 years agolib-smtp: smtp-server-command - Split off smtp_server_command_send_more_replies().
Stephan Bosch [Fri, 5 Nov 2021 15:53:48 +0000 (16:53 +0100)] 
lib-smtp: smtp-server-command - Split off smtp_server_command_send_more_replies().

3 years agolib-smtp: smtp-server-command - Split off smtp_server_command_send_replies().
Stephan Bosch [Fri, 5 Nov 2021 15:46:15 +0000 (16:46 +0100)] 
lib-smtp: smtp-server-command - Split off smtp_server_command_send_replies().

3 years agoplugins/fts: Fix memory leak when searching mail in virtual folder with fts.
sergey.kitov [Mon, 8 Nov 2021 12:36:57 +0000 (14:36 +0200)] 
plugins/fts: Fix memory leak when searching mail in virtual folder with fts.

3 years agoconfigure: Fix version macros to work with devel version
Aki Tuomi [Mon, 8 Nov 2021 12:04:07 +0000 (14:04 +0200)] 
configure: Fix version macros to work with devel version

3 years agoSECURITY.md: Add initial security policy
Aki Tuomi [Mon, 8 Nov 2021 13:24:30 +0000 (15:24 +0200)] 
SECURITY.md: Add initial security policy

3 years agolib-fts: Fix address tokenizer to handle large input properly
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.

3 years agolib-fts: Implement support for parent tokenizer "streaming"
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.

3 years agolib-fts: fts-tokenizer - Add comments explaning how it works
Timo Sirainen [Tue, 26 Oct 2021 09:33:50 +0000 (12:33 +0300)] 
lib-fts: fts-tokenizer - Add comments explaning how it works

3 years agolib-fts: test-fts-tokenizer - Add more uniqueness to the long email address
Timo Sirainen [Tue, 26 Oct 2021 08:52:22 +0000 (11:52 +0300)] 
lib-fts: test-fts-tokenizer - Add more uniqueness to the long email address

This helps at least with debugging problems.

3 years agolib: DOVECOT_PREREQ() - Add micro version
Timo Sirainen [Tue, 14 Sep 2021 16:21:09 +0000 (18:21 +0200)] 
lib: DOVECOT_PREREQ() - Add micro version

Nowadays APIs can change between micro versions as well.

3 years agolib: DOVECOT_PREREQ() - Remove surrounding if checks
Timo Sirainen [Tue, 14 Sep 2021 16:23:41 +0000 (18:23 +0200)] 
lib: DOVECOT_PREREQ() - Remove surrounding if checks

The DOVECOT_VERSION_* macros are expected to always exist.

3 years agoconfigure: Add DOVECOT_VERSION_MICRO
Timo Sirainen [Tue, 14 Sep 2021 16:21:03 +0000 (18:21 +0200)] 
configure: Add DOVECOT_VERSION_MICRO

3 years agolib: Fix building with --disable-asserts
Timo Sirainen [Tue, 2 Nov 2021 14:06:55 +0000 (16:06 +0200)] 
lib: Fix building with --disable-asserts

The #endif location was wrong.

3 years agosubmission-login: Implicitly login using EXTERNAL mechanism upon MAIL if enabled.
Stephan Bosch [Wed, 27 Jan 2021 01:20:53 +0000 (02:20 +0100)] 
submission-login: Implicitly login using EXTERNAL mechanism upon MAIL if enabled.

This is a workaround for TLS clients that present a valid client certificate,
yet don't authenticate explicitly. This is enabled by setting:

submission_client_workarounds = implicit-auth-external

3 years agosubmission-login: client-authenticate - Split off cmd_auth_set_master_data_prefix().
Stephan Bosch [Thu, 14 Oct 2021 10:47:23 +0000 (12:47 +0200)] 
submission-login: client-authenticate - Split off cmd_auth_set_master_data_prefix().

3 years agologin-common: sasl-server - Add support for implicit login.
Stephan Bosch [Wed, 27 Jan 2021 12:51:03 +0000 (13:51 +0100)] 
login-common: sasl-server - Add support for implicit login.

3 years agologin-common: sasl-server - Turn private argument of sasl_server_auth_begin() into...
Stephan Bosch [Wed, 27 Jan 2021 12:43:23 +0000 (13:43 +0100)] 
login-common: sasl-server - Turn private argument of sasl_server_auth_begin() into flag.

3 years agolib-master: master-auth - Add support for MAIL_AUTH_REQUEST_FLAG_IMPLICIT flag.
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.

3 years agolib-smtp: smtp-server - Add support for suppressing the inital greeting reply.
Stephan Bosch [Wed, 27 Jan 2021 12:40:43 +0000 (13:40 +0100)] 
lib-smtp: smtp-server - Add support for suppressing the inital greeting reply.

3 years agolib-smtp: smtp-server - Make default command functions public.
Stephan Bosch [Wed, 27 Jan 2021 01:22:10 +0000 (02:22 +0100)] 
lib-smtp: smtp-server - Make default command functions public.

3 years agolib-smtp: smtp-server-command - Allow overriding commands.
Stephan Bosch [Wed, 27 Jan 2021 01:21:50 +0000 (02:21 +0100)] 
lib-smtp: smtp-server-command - Allow overriding commands.

3 years agosubmission-login: client - Explicitly set SMTP server command and auth line limits.
Stephan Bosch [Fri, 29 Oct 2021 22:43:55 +0000 (00:43 +0200)] 
submission-login: client - Explicitly set SMTP server command and auth line limits.

This way, it will always use the same limits as all other login services.

3 years agolib-smtp: smtp-command-parser - Make parser suitable for input stream with small...
Stephan Bosch [Fri, 29 Oct 2021 18:41:42 +0000 (20:41 +0200)] 
lib-smtp: smtp-command-parser - Make parser suitable for input stream with small buffer.

3 years agolib-smtp: smtp-command - Use size_t for command line limits.
Stephan Bosch [Fri, 29 Oct 2021 21:44:01 +0000 (23:44 +0200)] 
lib-smtp: smtp-command - Use size_t for command line limits.

3 years agolib-smtp: test-smtp-server-errors - Add tests for very long AUTH response lines.
Stephan Bosch [Fri, 29 Oct 2021 17:37:16 +0000 (19:37 +0200)] 
lib-smtp: test-smtp-server-errors - Add tests for very long AUTH response lines.

3 years agolib-smtp: test-smtp-command-parser - Add test for very long AUTH response line.
Stephan Bosch [Fri, 29 Oct 2021 17:36:18 +0000 (19:36 +0200)] 
lib-smtp: test-smtp-command-parser - Add test for very long AUTH response line.

3 years agolib-smtp: Reformat smtp-command-parser.c.
Stephan Bosch [Fri, 29 Oct 2021 21:52:05 +0000 (23:52 +0200)] 
lib-smtp: Reformat smtp-command-parser.c.

3 years agolib-smtp: Reformat smtp-command-parser.h.
Stephan Bosch [Fri, 29 Oct 2021 21:47:57 +0000 (23:47 +0200)] 
lib-smtp: Reformat smtp-command-parser.h.

3 years agomaster: Use MASTER_SERVICE_FLAG_DISABLE_SSL_SET
Timo Sirainen [Mon, 1 Nov 2021 12:33:49 +0000 (08:33 -0400)] 
master: Use MASTER_SERVICE_FLAG_DISABLE_SSL_SET

This prevents startup failures if ssl_ca has a large number of certificates.

Broken by 36ff43f1a9aff8594d08f791e77ea13390fd569f

3 years agolib-master: Add MASTER_SERVICE_FLAG_DISABLE_SSL_SET
Timo Sirainen [Mon, 1 Nov 2021 12:33:14 +0000 (08:33 -0400)] 
lib-master: Add MASTER_SERVICE_FLAG_DISABLE_SSL_SET

3 years agolib-ssl-iostream: Fix assert-crash when OpenSSL returns syscall error without errno
Timo Sirainen [Wed, 27 Oct 2021 10:06:10 +0000 (12:06 +0200)] 
lib-ssl-iostream: Fix assert-crash when OpenSSL returns syscall error without errno

Incomplete fix in f41874b3dec541478a85275698a91f089f537df2

Fixes:
Panic: file istream-openssl.c: line 51 (i_stream_ssl_read_real): assertion failed: (errno != 0)

3 years agolib-storage: Improve mailbox_vfuncs.search_next_update_seq() comment
Timo Sirainen [Thu, 14 Oct 2021 15:31:19 +0000 (18:31 +0300)] 
lib-storage: Improve mailbox_vfuncs.search_next_update_seq() comment

3 years agoexample-config: Remove outdated object-storage conf.d file
Michael M Slusarz [Thu, 8 Aug 2019 21:35:03 +0000 (15:35 -0600)] 
example-config: Remove outdated object-storage conf.d file

3 years agodsync: Add back missing -T parameter
Timo Sirainen [Thu, 28 Oct 2021 15:07:39 +0000 (17:07 +0200)] 
dsync: Add back missing -T parameter

Broken by 5676c510bfa9217df05e9b7cb000ae3554d66f22

3 years agofts: Keep track of every backend mailbox fts index status for virtual folders.
sergey.kitov [Thu, 16 Sep 2021 08:24:31 +0000 (11:24 +0300)] 
fts: Keep track of every backend mailbox fts index status for virtual folders.

3 years agofts: Whitespace cleanup.
sergey.kitov [Fri, 22 Oct 2021 09:07:17 +0000 (12:07 +0300)] 
fts: Whitespace cleanup.

3 years agolib-storage: Move search matching into mailbox_vfuncs.search_next_match_mail()
Timo Sirainen [Thu, 14 Oct 2021 14:33:30 +0000 (17:33 +0300)] 
lib-storage: Move search matching into mailbox_vfuncs.search_next_match_mail()

3 years agolib: Use data stack frame with IO switch and destroy callbacks
Timo Sirainen [Fri, 8 Jan 2021 09:21:20 +0000 (11:21 +0200)] 
lib: Use data stack frame with IO switch and destroy callbacks

3 years agolib: Use data stack frame with IO context activate/deactive callbacks
Timo Sirainen [Fri, 8 Jan 2021 09:28:26 +0000 (11:28 +0200)] 
lib: Use data stack frame with IO context activate/deactive callbacks

These were running outside the regular ioloop data stack frames, so if the
callback used any data stack it kept increasing memory usage.

This fixes excessive memory usage with old_stats plugin when used with
long-running imap sessions. The memory got filled with UPDATE-SESSION
commands.

3 years agolib-storage: When search parses message headers, deinitialize the parsing properly
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.

Fixes:
Panic: file index-mail-headers.c: line 667 (index_mail_get_raw_headers): assertion failed: (mail->mail.mail.lookup_abort >= MAIL_LOOKUP_ABORT_NOT_IN_CACHE)
Panic: file ../../../src/lib/array.h: line 244 (array_idx_i): assertion failed: (idx < array->buffer->used / array->element_size)
Panic: file index-mail.c: line 1203 (index_mail_parse_body_finish): assertion failed: (!success)

3 years agodoveadm: Route help/usage messages on stderr rather than stdout.
Marco Bettini [Thu, 21 Oct 2021 13:45:56 +0000 (15:45 +0200)] 
doveadm: Route help/usage messages on stderr rather than stdout.

3 years agologin-common: Add proxying events
Siavash Tavakoli [Thu, 30 Sep 2021 15:19:58 +0000 (16:19 +0100)] 
login-common: Add proxying events

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

3 years agologin-common: Change login proxy message to include IP address
Siavash Tavakoli [Thu, 30 Sep 2021 11:49:31 +0000 (12:49 +0100)] 
login-common: Change login proxy message to include IP address

Will be in format "<IP> (<host>)". Host part is optional and not added
if proxy target is an IP address.

3 years agologin-proxy: Add source_port to proxy event after connection is established
Siavash Tavakoli [Tue, 5 Oct 2021 10:33:06 +0000 (11:33 +0100)] 
login-proxy: Add source_port to proxy event after connection is established

3 years agologin-common: Add more fields to login proxy event
Siavash Tavakoli [Tue, 5 Oct 2021 14:17:50 +0000 (15:17 +0100)] 
login-common: Add more fields to login proxy event

Adds
- source_ip
- dest_ip
- dest_port
- dest_host
- master_user

3 years agologin-common: Start proxying after client fields are set
Siavash Tavakoli [Thu, 7 Oct 2021 21:52:47 +0000 (22:52 +0100)] 
login-common: Start proxying after client fields are set

Allows adding more event fields in login_proxy_new().

3 years agologin-proxy: Add login_proxy_get_ip_str()
Siavash Tavakoli [Thu, 30 Sep 2021 11:48:09 +0000 (12:48 +0100)] 
login-proxy: Add login_proxy_get_ip_str()

Returns proxy IP address as string.

3 years agoclient-common: Add service field to client event
Siavash Tavakoli [Thu, 7 Oct 2021 09:29:04 +0000 (10:29 +0100)] 
client-common: Add service field to client event

3 years agoimap: list_send_status() - Fixes LIST-EXTENDED doesn't return STATUS for all folders
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

3 years agolib-index: Add mail_index_alloc_cache_find()
Timo Sirainen [Wed, 13 Oct 2021 08:45:05 +0000 (11:45 +0300)] 
lib-index: Add mail_index_alloc_cache_find()

3 years agomaildir: Fix crash when closing a mailbox that isn't open
Timo Sirainen [Thu, 7 Oct 2021 15:11:00 +0000 (18:11 +0300)] 
maildir: Fix crash when closing a mailbox that isn't open

This could have happened at least with virtual plugin.

3 years agomaster: test-auth-client - Check that authorization ID is as expected
Timo Sirainen [Fri, 8 Oct 2021 13:32:09 +0000 (16:32 +0300)] 
master: test-auth-client - Check that authorization ID is as expected

3 years agomaster: test-auth-client - Fix authenid check to be assert
Timo Sirainen [Thu, 7 Oct 2021 17:18:21 +0000 (20:18 +0300)] 
master: test-auth-client - Fix authenid check to be assert

It can never be NULL at this point.

3 years agolib-dict: dict-lua - Throw Lua error if dict key is invalid or username is missing
Timo Sirainen [Thu, 7 Oct 2021 16:59:52 +0000 (19:59 +0300)] 
lib-dict: dict-lua - Throw Lua error if dict key is invalid or username is missing

This prevents assert-crashes in the C code.

3 years agolib-dict: dict_lookup_async() - Add missing assert to check for key prefix and username
Timo Sirainen [Thu, 7 Oct 2021 16:54:41 +0000 (19:54 +0300)] 
lib-dict: dict_lookup_async() - Add missing assert to check for key prefix and username

3 years agolib-master: Prevent read buffer overflow with invalid haproxy header size
Timo Sirainen [Thu, 7 Oct 2021 16:42:41 +0000 (19:42 +0300)] 
lib-master: Prevent read buffer overflow with invalid haproxy header size

This could have happened only for connections from haproxy_trusted_networks,
so it's unlikely to cause any real security issues.

3 years agolib-dcrypt: dcrypt_openssl_decrypt_point_password_v1() - Fix crash if pbkdf2 generati...
Timo Sirainen [Thu, 7 Oct 2021 16:36:17 +0000 (19:36 +0300)] 
lib-dcrypt: dcrypt_openssl_decrypt_point_password_v1() - Fix crash if pbkdf2 generation fails

3 years agoimap: Fix handling client initialization error
Timo Sirainen [Wed, 6 Oct 2021 12:38:55 +0000 (15:38 +0300)] 
imap: Fix handling client initialization error

It should send "OK Logged in" + BYE, not PREAUTH.

Broken by 714ff4342e39e309ff184905cd2f714def6177a3

3 years agoimap: Move client_add_input() content to calling functions
Timo Sirainen [Fri, 8 Oct 2021 13:02:04 +0000 (16:02 +0300)] 
imap: Move client_add_input() content to calling functions

3 years agoimap: Move IMAPLOGINTAG environment handling
Timo Sirainen [Fri, 8 Oct 2021 12:57:50 +0000 (15:57 +0300)] 
imap: Move IMAPLOGINTAG environment handling

It can only happen with stdio clients when they don't have CLIENT_INPUT,
so it makes more sense to exist in the calling function.

3 years agoimap-login: proxy: Don't forward untagged BYE responses to the client
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.

3 years agolib-storage: mail_storage_service_lookup() - Fix memory leak when returning -2
Timo Sirainen [Fri, 8 Oct 2021 12:53:21 +0000 (15:53 +0300)] 
lib-storage: mail_storage_service_lookup() - Fix memory leak when returning -2

This was also visible as event leaks.

3 years agolib-index: Fix potential crash with debug logging when looking up cache
Timo Sirainen [Tue, 28 Sep 2021 17:46:54 +0000 (20:46 +0300)] 
lib-index: Fix potential crash with debug logging when looking up cache

3 years agolib-index: mail_cache_lookup_iter_next() - Add a warning comment about re-reading...
Timo Sirainen [Tue, 28 Sep 2021 17:45:47 +0000 (20:45 +0300)] 
lib-index: mail_cache_lookup_iter_next() - Add a warning comment about re-reading fields

3 years agomail-crypt: mail_crypt_load_global_private_key() - Drop unnecessary NULL check
Marco Bettini [Thu, 7 Oct 2021 13:52:28 +0000 (15:52 +0200)] 
mail-crypt: mail_crypt_load_global_private_key() - Drop unnecessary NULL check

3 years agolib, global: i_stream_create_chain() - Add max_buffer_size
Timo Sirainen [Tue, 28 Sep 2021 15:13:12 +0000 (18:13 +0300)] 
lib, global: i_stream_create_chain() - Add max_buffer_size

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.

3 years agovirtual: Fix assert-crash when backend mbox mailbox is deleted while virtual mailbox...
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.

Broken by 710346bcb884b464c8ed128870fdc1999c13dfd3

3 years agolib: istream-concat - Add a comment about explicit snapshot function
Timo Sirainen [Mon, 4 Oct 2021 23:03:00 +0000 (02:03 +0300)] 
lib: istream-concat - Add a comment about explicit snapshot function

3 years agolib: test-istream-concat - Unref child istreams immediately
Timo Sirainen [Mon, 4 Oct 2021 22:39:50 +0000 (01:39 +0300)] 
lib: test-istream-concat - Unref child istreams immediately

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.

3 years agolib: istream-concat - Fix snapshot handling when combining two istreams
Timo Sirainen [Mon, 4 Oct 2021 15:25:40 +0000 (18:25 +0300)] 
lib: istream-concat - Fix snapshot handling when combining two istreams

Snapshotting wasn't handled correctly when two (or more) istreams' contents
were combined into the same buffer.

3 years agolib: istream-chain - Optimize snapshot handling
Timo Sirainen [Mon, 4 Oct 2021 21:55:57 +0000 (00:55 +0300)] 
lib: istream-chain - Optimize snapshot handling

3 years agolib: istream-chain - Fix snapshot handling when link istream is destroyed
Timo Sirainen [Mon, 4 Oct 2021 22:32:22 +0000 (01:32 +0300)] 
lib: istream-chain - Fix snapshot handling when link istream is destroyed

3 years agolib: istream-chain - Fix snapshot handling when combining two istreams
Timo Sirainen [Mon, 4 Oct 2021 15:17:49 +0000 (18:17 +0300)] 
lib: istream-chain - Fix snapshot handling when combining two istreams

Snapshotting wasn't handled correctly when two (or more) istreams' contents
were combined into the same buffer.

3 years agolib: Add i_stream_memarea_detach()
Timo Sirainen [Mon, 4 Oct 2021 22:00:38 +0000 (01:00 +0300)] 
lib: Add i_stream_memarea_detach()

3 years agolib: test-istream-chain - Use more unique strings for testing
Timo Sirainen [Mon, 4 Oct 2021 14:41:27 +0000 (17:41 +0300)] 
lib: test-istream-chain - Use more unique strings for testing

DEBUG checks don't work well if the input repeats the same character.

3 years agolib: istream-seekable - Fix crash after write to temp file failed
Timo Sirainen [Sat, 14 Sep 2019 21:08:57 +0000 (00:08 +0300)] 
lib: istream-seekable - Fix crash after write to temp file failed

Fixes:
Panic: file istream-seekable.c: line 230 (read_from_buffer): assertion failed: (*ret_r > 0)

3 years agolib: istream-seekable - Don't double-close temp file fd on errors
Timo Sirainen [Sat, 14 Sep 2019 21:06:58 +0000 (00:06 +0300)] 
lib: istream-seekable - Don't double-close temp file fd on errors

Closing the fd_input stream already auto-closes the fd.

3 years agolib: istream-seekable - Fix crash if writing to temp file fails
Timo Sirainen [Sat, 14 Sep 2019 20:53:35 +0000 (23:53 +0300)] 
lib: istream-seekable - Fix crash if writing to temp file fails

3 years agolib: i_stream_try_alloc() - Add sanity check asserts
Timo Sirainen [Wed, 29 Sep 2021 10:13:53 +0000 (13:13 +0300)] 
lib: i_stream_try_alloc() - Add sanity check asserts

3 years agolib-imap-client: test-imapc-client - Increase connect timeout for most tests
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.

3 years agolib-master: master_login_auth_callback() - Add assert to guard for both errormsg...
Marco Bettini [Wed, 6 Oct 2021 09:03:08 +0000 (05:03 -0400)] 
lib-master: master_login_auth_callback() - Add assert to guard for both errormsg and auth_args being NULL

3 years agoauth: db-passwd-file - Fix using paths with %% escaped characters but no %variables
Timo Sirainen [Thu, 7 Oct 2021 00:55:59 +0000 (03:55 +0300)] 
auth: db-passwd-file - Fix using paths with %% escaped characters but no %variables

full_key might not have been NULL, causing var_expand() to read past the
array and possibly crash.

3 years agolib: t_get_bytes_available() - Move code inside DEBUG to avoid dead code warning
Timo Sirainen [Thu, 7 Oct 2021 00:46:29 +0000 (03:46 +0300)] 
lib: t_get_bytes_available() - Move code inside DEBUG to avoid dead code warning

3 years agolib-index: mail_index_sync_init_expunge_handlers() - Simplify and remove dead code
Timo Sirainen [Thu, 7 Oct 2021 00:44:46 +0000 (03:44 +0300)] 
lib-index: mail_index_sync_init_expunge_handlers() - Simplify and remove dead code

3 years agolib-index: test-mail-index-write - Fix initializing map.hdr_copy_buf
Timo Sirainen [Thu, 7 Oct 2021 00:37:29 +0000 (03:37 +0300)] 
lib-index: test-mail-index-write - Fix initializing map.hdr_copy_buf

3 years agolib-settings: test-settings-parser - Check settings_parser_check() return value
Timo Sirainen [Thu, 7 Oct 2021 00:29:09 +0000 (03:29 +0300)] 
lib-settings: test-settings-parser - Check settings_parser_check() return value

3 years agoauth: Make sure auth_request_import() doesn't unexpectedly fail
Timo Sirainen [Thu, 7 Oct 2021 00:28:56 +0000 (03:28 +0300)] 
auth: Make sure auth_request_import() doesn't unexpectedly fail

3 years agolib: Change i_unreached() to be a function
Timo Sirainen [Thu, 7 Oct 2021 00:10:28 +0000 (03:10 +0300)] 
lib: Change i_unreached() to be a function

This allows overriding the function in a Coverity model, so it can
understand that i_unreached() is intended to be unreachable code.

3 years agolib: base64 - Add asserts to check max_line_len is in valid range
Timo Sirainen [Wed, 6 Oct 2021 23:32:26 +0000 (02:32 +0300)] 
lib: base64 - Add asserts to check max_line_len is in valid range

3 years agoipc: Disable connecting to stats
Timo Sirainen [Mon, 4 Oct 2021 11:32:51 +0000 (13:32 +0200)] 
ipc: Disable connecting to stats

This avoids reconnect errors if stats process crashes.

3 years agomaster: Use relative path for stats_writer_socket_path for chrooted services
Timo Sirainen [Thu, 30 Sep 2021 22:44:35 +0000 (01:44 +0300)] 
master: Use relative path for stats_writer_socket_path for chrooted services

This allows login process to reconnect to stats-writer if it gets
disconnected.

3 years agostats: Add login/stats-writer socket
Timo Sirainen [Thu, 30 Sep 2021 22:42:43 +0000 (01:42 +0300)] 
stats: Add login/stats-writer socket

3 years agolmtp: lmtp-proxy - Use the per-recipient session ID for the "Saved" message.
Stephan Bosch [Mon, 4 Oct 2021 00:58:15 +0000 (02:58 +0200)] 
lmtp: lmtp-proxy - Use the per-recipient session ID for the "Saved" message.

3 years agolmtp: Move session_id field to generic recipient struct.
Stephan Bosch [Mon, 4 Oct 2021 00:57:25 +0000 (02:57 +0200)] 
lmtp: Move session_id field to generic recipient struct.