]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
6 years agolib: net_*() - Make sure sockaddr_union is always cleared
Timo Sirainen [Thu, 9 May 2019 16:22:28 +0000 (19:22 +0300)] 
lib: net_*() - Make sure sockaddr_union is always cleared

Fixes scan-build warnings

6 years agolib: data-stack - Make STACK_BLOCK_DATA() behavior clearer
Timo Sirainen [Thu, 9 May 2019 16:19:42 +0000 (19:19 +0300)] 
lib: data-stack - Make STACK_BLOCK_DATA() behavior clearer

Otherwise scan-build thinks that it's pointing outside valid memory in the
struct and gives an error:

"Memory set function accesses out-of-bound array element"

6 years agoglobal: Change CALLBACK_TYPECHECK() to used with subtraction
Timo Sirainen [Thu, 9 May 2019 12:29:34 +0000 (15:29 +0300)] 
global: Change CALLBACK_TYPECHECK() to used with subtraction

This is because clang's -Wstring-plus-int gave warnings when using
"string" + CALLBACK_TYPECHECK(), but there are no warnings when using
"string" - CALLBACK_TYPECHECK(). It would have been enough to change
only the string parameters to use "-", but for consistency this commit
changes all of them.

6 years agolmtp: local: Make the local_deliver client vfunc responsible for submitting the reply.
Stephan Bosch [Mon, 24 Dec 2018 14:02:58 +0000 (15:02 +0100)] 
lmtp: local: Make the local_deliver client vfunc responsible for submitting the reply.

This gives plugins more power to override delivery behavior.

6 years agolmtp: Load all globally-defined mail_plugins at client connect.
Stephan Bosch [Sat, 10 Nov 2018 14:26:51 +0000 (15:26 +0100)] 
lmtp: Load all globally-defined mail_plugins at client connect.

Before, this was not performed until after a user lookup was performed for a
recipient. That is not acceptable when plugins need to modify the LMTP protocol
itself.

6 years agolmtp: Install header files.
Stephan Bosch [Sat, 10 Nov 2018 12:58:37 +0000 (13:58 +0100)] 
lmtp: Install header files.

This allows creating external lmtp plugins.

6 years agolmtp: Rename commands.h to lmtp-commands.h.
Stephan Bosch [Sat, 10 Nov 2018 12:48:56 +0000 (13:48 +0100)] 
lmtp: Rename commands.h to lmtp-commands.h.

6 years agolmtp: Rename client.h to lmtp-client.h.
Stephan Bosch [Sat, 10 Nov 2018 12:52:28 +0000 (13:52 +0100)] 
lmtp: Rename client.h to lmtp-client.h.

6 years agolmtp: Make include directory available to external plugins.
Stephan Bosch [Sat, 10 Nov 2018 12:41:27 +0000 (13:41 +0100)] 
lmtp: Make include directory available to external plugins.

6 years agolmtp: local: Create a client vfunc for local delivery.
Stephan Bosch [Sat, 3 Nov 2018 12:34:20 +0000 (13:34 +0100)] 
lmtp: local: Create a client vfunc for local delivery.

This way,for example, the struct mail_deliver_context passed to mail_deliver()
can be adjusted by plugins.

6 years agolib-smtp: server: Add support for adding (non-standard) extra capabilities.
Stephan Bosch [Sat, 3 Nov 2018 10:18:46 +0000 (11:18 +0100)] 
lib-smtp: server: Add support for adding (non-standard) extra capabilities.

6 years agolib-smtp: syntax: Add new smtp_ehlo_params_are_valid().
Stephan Bosch [Sat, 10 Nov 2018 12:27:52 +0000 (13:27 +0100)] 
lib-smtp: syntax: Add new smtp_ehlo_params_are_valid().

This new version checks whether the parameters contained in the provided string
array are all valid EHLO parameters.

6 years agolib-smtp: syntax: Remame smtp_ehlo_params_are_valid() to smtp_ehlo_params_str_is_valid().
Stephan Bosch [Sat, 10 Nov 2018 12:22:52 +0000 (13:22 +0100)] 
lib-smtp: syntax: Remame smtp_ehlo_params_are_valid() to smtp_ehlo_params_str_is_valid().

Moves it out of the way for a function that is better suited for this name;
i.e., it operates on an array of parameters.

6 years agolib-smtp: server: Add smtp_server_reply_ehlo_add_params().
Stephan Bosch [Sat, 3 Nov 2018 10:18:10 +0000 (11:18 +0100)] 
lib-smtp: server: Add smtp_server_reply_ehlo_add_params().

6 years agolib-smtp: server: EHLO command: Move composition of individual reply lines to separat...
Stephan Bosch [Sat, 3 Nov 2018 08:55:41 +0000 (09:55 +0100)] 
lib-smtp: server: EHLO command: Move composition of individual reply lines to separate functions.

6 years agolib-smtp: server: EHLO command: Move composition of default EHLO reply to a separate...
Stephan Bosch [Sat, 3 Nov 2018 08:27:48 +0000 (09:27 +0100)] 
lib-smtp: server: EHLO command: Move composition of default EHLO reply to a separate public function.

6 years agolmtp: Add support for module contexts to recipient.
Stephan Bosch [Sat, 3 Nov 2018 00:00:13 +0000 (01:00 +0100)] 
lmtp: Add support for module contexts to recipient.

6 years agolmtp: Add support for module contexts to client.
Stephan Bosch [Fri, 2 Nov 2018 23:54:50 +0000 (00:54 +0100)] 
lmtp: Add support for module contexts to client.

6 years agolmtp: Implement client vfuncs for transaction start and free.
Stephan Bosch [Fri, 2 Nov 2018 23:49:32 +0000 (00:49 +0100)] 
lmtp: Implement client vfuncs for transaction start and free.

6 years agolmtp: Implement client vfuncs for SMTP transaction commands.
Stephan Bosch [Fri, 2 Nov 2018 23:33:31 +0000 (00:33 +0100)] 
lmtp: Implement client vfuncs for SMTP transaction commands.

6 years agolmtp: RCPT command: Allocate lmtp_recipient object immediately.
Stephan Bosch [Sat, 3 Nov 2018 13:26:24 +0000 (14:26 +0100)] 
lmtp: RCPT command: Allocate lmtp_recipient object immediately.

6 years agolmtp: DATA command: Add data size to client state.
Stephan Bosch [Fri, 2 Nov 2018 23:41:03 +0000 (00:41 +0100)] 
lmtp: DATA command: Add data size to client state.

6 years agolmtp: DATA command: Put the data input stream in the client state rather than the...
Stephan Bosch [Fri, 2 Nov 2018 23:37:52 +0000 (00:37 +0100)] 
lmtp: DATA command: Put the data input stream in the client state rather than the transaction context.

6 years agolmtp: Implement basic client vfuncs.
Stephan Bosch [Fri, 2 Nov 2018 22:48:48 +0000 (23:48 +0100)] 
lmtp: Implement basic client vfuncs.

Currently, only client_destroy can be overriden.

6 years agolmtp: Add hook for client_create().
Stephan Bosch [Sat, 3 Nov 2018 11:56:30 +0000 (12:56 +0100)] 
lmtp: Add hook for client_create().

6 years agolmtp: Remove obsolete declaration from lmtp-common.h.
Stephan Bosch [Sat, 3 Nov 2018 11:47:00 +0000 (12:47 +0100)] 
lmtp: Remove obsolete declaration from lmtp-common.h.

6 years agolmtp: Make lmtp-common.h the primary include.
Stephan Bosch [Sat, 3 Nov 2018 11:45:19 +0000 (12:45 +0100)] 
lmtp: Make lmtp-common.h the primary include.

This better matches other services.

6 years agolmtp: Rename main.h to lmtp-common.h.
Stephan Bosch [Sat, 3 Nov 2018 11:34:02 +0000 (12:34 +0100)] 
lmtp: Rename main.h to lmtp-common.h.

This better matches other services.

6 years agolmtp: Rename lmtp-common to lmtp-recipient.
Stephan Bosch [Sat, 3 Nov 2018 11:26:51 +0000 (12:26 +0100)] 
lmtp: Rename lmtp-common to lmtp-recipient.

6 years agofts-solr: Remove obsolete break-imap-search setting
Martti Rannanjärvi [Thu, 28 Jun 2018 11:36:51 +0000 (14:36 +0300)] 
fts-solr: Remove obsolete break-imap-search setting

6 years agolib-program-client: Add more detailed debug logging.
Stephan Bosch [Mon, 26 Feb 2018 22:12:03 +0000 (23:12 +0100)] 
lib-program-client: Add more detailed debug logging.

6 years agolib-program-client: Use event logging.
Stephan Bosch [Mon, 26 Feb 2018 21:27:40 +0000 (22:27 +0100)] 
lib-program-client: Use event logging.

This also makes the overall log messages better match similar messages produced
by other parts of Dovecot.

6 years agolib-program-client: Use i_close_fd() rather than close() when error is not supposed...
Stephan Bosch [Thu, 15 Mar 2018 23:08:17 +0000 (00:08 +0100)] 
lib-program-client: Use i_close_fd() rather than close() when error is not supposed to happen.

6 years agolib-program-client: Make debug mode for test suite optional.
Stephan Bosch [Mon, 26 Feb 2018 22:26:50 +0000 (23:26 +0100)] 
lib-program-client: Make debug mode for test suite optional.

It is now disabled by default.

6 years agolib-program-client: local: Cleanup any kill timeout while program client is destroyed.
Stephan Bosch [Mon, 26 Feb 2018 17:58:37 +0000 (18:58 +0100)] 
lib-program-client: local: Cleanup any kill timeout while program client is destroyed.

6 years agolib-program-client: local: Make sure the child is dead once the program client is...
Stephan Bosch [Mon, 26 Feb 2018 17:32:32 +0000 (18:32 +0100)] 
lib-program-client: local: Make sure the child is dead once the program client is destroyed.

6 years agolib-program-client: Simplify disconnect handling.
Stephan Bosch [Mon, 26 Feb 2018 17:01:23 +0000 (18:01 +0100)] 
lib-program-client: Simplify disconnect handling.

Perform all of the cleanups in a separate shared function.
Always close all fds, since there is nothing left to be read or written at
disconnect.

6 years agolib-program-client: remote: Don't try to read remaining input at disconnect.
Stephan Bosch [Mon, 26 Feb 2018 17:21:04 +0000 (18:21 +0100)] 
lib-program-client: remote: Don't try to read remaining input at disconnect.

This code is no longer relevant. At disconnect, there is nothing left to be read
by definition.

6 years agolib-program-client: Use iostream-pump for streaming data from program.
Stephan Bosch [Sun, 25 Feb 2018 23:07:10 +0000 (00:07 +0100)] 
lib-program-client: Use iostream-pump for streaming data from program.

6 years agolib-program-client: Destroy timeout once client is passively disconnected.
Stephan Bosch [Mon, 26 Feb 2018 16:16:41 +0000 (17:16 +0100)] 
lib-program-client: Destroy timeout once client is passively disconnected.

6 years agolib-program-client: remote: Initialize program_client_istream with parent FD.
Stephan Bosch [Mon, 26 Feb 2018 16:15:13 +0000 (17:15 +0100)] 
lib-program-client: remote: Initialize program_client_istream with parent FD.

This way, io_add_istream() works as expected.

6 years agolib-program-client: local: Stop immediately when child program without I/O ends.
Stephan Bosch [Mon, 26 Feb 2018 16:12:29 +0000 (17:12 +0100)] 
lib-program-client: local: Stop immediately when child program without I/O ends.

Particularly, don't perform this by calling the input handler.

6 years agolib-program-client: Change return type of program_client_connected() to void.
Stephan Bosch [Mon, 26 Feb 2018 15:52:18 +0000 (16:52 +0100)] 
lib-program-client: Change return type of program_client_connected() to void.

Returning an int status code is no longer useful.

6 years agolib-program-client: Use iostream-pump for streaming data towards program.
Stephan Bosch [Sun, 25 Feb 2018 16:21:47 +0000 (17:21 +0100)] 
lib-program-client: Use iostream-pump for streaming data towards program.

6 years agolib-program-client: Initialize dot streams right after the connection is established.
Stephan Bosch [Sun, 25 Feb 2018 10:43:04 +0000 (11:43 +0100)] 
lib-program-client: Initialize dot streams right after the connection is established.

This avoids creating the dot streams in the input/output handlers, which makes
the code cleaner and easier to port to using iostream-pump.

6 years agolib-program-client: Use iostream-temp rather than istream-seekable for seekable output.
Stephan Bosch [Sun, 25 Feb 2018 08:55:00 +0000 (09:55 +0100)] 
lib-program-client: Use iostream-temp rather than istream-seekable for seekable output.

This considerably simplifies the code.

6 years agolib-program-client: test-program-client-net: Read the client input stream to EOF...
Stephan Bosch [Sun, 25 Feb 2018 16:31:51 +0000 (17:31 +0100)] 
lib-program-client: test-program-client-net: Read the client input stream to EOF after the dot stream is closed.

The low-level file stream is not necessarily read to EOF when the body dot
stream sees EOF.

6 years agolib-program-client: test-program-client-unix: Properly recognize the noreply script...
Stephan Bosch [Sun, 25 Feb 2018 17:38:23 +0000 (18:38 +0100)] 
lib-program-client: test-program-client-unix: Properly recognize the noreply script protocol option.

Somehow the equivalent test-program-client-net code does not have this problem.
And somehow this test did not fail before.

6 years agolib-program-client: test-program-client-net: Destroy test client upon error.
Stephan Bosch [Sun, 25 Feb 2018 17:31:14 +0000 (18:31 +0100)] 
lib-program-client: test-program-client-net: Destroy test client upon error.

This prevents infinite input event loop when something goes wrong.

6 years agolib-program-client: test-program-client-unix: Destroy test client upon error.
Stephan Bosch [Sun, 25 Feb 2018 17:30:12 +0000 (18:30 +0100)] 
lib-program-client: test-program-client-unix: Destroy test client upon error.

This prevents infinite input event loop when something goes wrong.

6 years agolib-program-client: test-program-client-net: Handle test client connections non-blocking.
Stephan Bosch [Sun, 25 Feb 2018 17:03:04 +0000 (18:03 +0100)] 
lib-program-client: test-program-client-net: Handle test client connections non-blocking.

6 years agolib-program-client: test-program-client-unix: Handle test client connections non...
Stephan Bosch [Sun, 25 Feb 2018 17:03:51 +0000 (18:03 +0100)] 
lib-program-client: test-program-client-unix: Handle test client connections non-blocking.

6 years agolib-program-client: test-program-client-net: Create body streams only once in test_pr...
Stephan Bosch [Sun, 25 Feb 2018 16:57:59 +0000 (17:57 +0100)] 
lib-program-client: test-program-client-net: Create body streams only once in test_program_input_handle().

6 years agolib-program-client: test-program-client-unix: Create body stream only once in test_pr...
Stephan Bosch [Sun, 25 Feb 2018 16:56:15 +0000 (17:56 +0100)] 
lib-program-client: test-program-client-unix: Create body stream only once in test_program_input_handle().

6 years agolib-program-client: test-program-client-net: Match client input handling code with...
Stephan Bosch [Sun, 25 Feb 2018 17:15:59 +0000 (18:15 +0100)] 
lib-program-client: test-program-client-net: Match client input handling code with test-program-client-unix.

6 years agolib-program-client: test-program-client-unix: Further fix error handling in test_prog...
Stephan Bosch [Sun, 18 Mar 2018 02:32:19 +0000 (03:32 +0100)] 
lib-program-client: test-program-client-unix: Further fix error handling in test_program_input().

6 years agolib-program-client: remote: Always shut down the output when all is written.
Stephan Bosch [Sun, 25 Feb 2018 16:46:55 +0000 (17:46 +0100)] 
lib-program-client: remote: Always shut down the output when all is written.

Before, this step was omitted when dot streams were used. However, shutting down
the output is necessary no matter what. Otherwise, the receiving end will not
see that no more input will follow, causing deadlock.

6 years agolib-program-client: Make sure program client callback is called only once.
Stephan Bosch [Sun, 25 Feb 2018 19:21:11 +0000 (20:21 +0100)] 
lib-program-client: Make sure program client callback is called only once.

6 years agolib-program-client: remote: Use struct program_client_remote as parameter where possible.
Stephan Bosch [Mon, 26 Feb 2018 23:13:20 +0000 (00:13 +0100)] 
lib-program-client: remote: Use struct program_client_remote as parameter where possible.

Avoids the need to cast it everywhere.

6 years agolib-program-client: remote: Call program client variable "prclient" consistently.
Stephan Bosch [Mon, 26 Feb 2018 22:57:44 +0000 (23:57 +0100)] 
lib-program-client: remote: Call program client variable "prclient" consistently.

6 years agolib-program-client: local: Call program client variable "plclient" consistently.
Stephan Bosch [Mon, 26 Feb 2018 22:53:22 +0000 (23:53 +0100)] 
lib-program-client: local: Call program client variable "plclient" consistently.

6 years agolib-program-client: Reformat test-program-client-unix.c.
Stephan Bosch [Sun, 25 Feb 2018 09:39:15 +0000 (10:39 +0100)] 
lib-program-client: Reformat test-program-client-unix.c.

6 years agolib-program-client: Reformat test-program-client-net.c.
Stephan Bosch [Sun, 25 Feb 2018 09:34:16 +0000 (10:34 +0100)] 
lib-program-client: Reformat test-program-client-net.c.

6 years agolib-program-client: Reformat program-client-private.h.
Stephan Bosch [Sun, 25 Feb 2018 17:54:46 +0000 (18:54 +0100)] 
lib-program-client: Reformat program-client-private.h.

6 years agolib-program-client: Reformat test-program-client-local.c.
Stephan Bosch [Sun, 25 Feb 2018 09:21:57 +0000 (10:21 +0100)] 
lib-program-client: Reformat test-program-client-local.c.

6 years agolib-program-client: Reformat program-client-remote.c.
Stephan Bosch [Sun, 25 Feb 2018 09:20:20 +0000 (10:20 +0100)] 
lib-program-client: Reformat program-client-remote.c.

6 years agolib-program-client: Reformat program-client-local.c.
Stephan Bosch [Sun, 25 Feb 2018 09:10:17 +0000 (10:10 +0100)] 
lib-program-client: Reformat program-client-local.c.

6 years agolib-program-client: Reformat program-client.h.
Stephan Bosch [Sun, 25 Feb 2018 09:06:36 +0000 (10:06 +0100)] 
lib-program-client: Reformat program-client.h.

6 years agolib-program-client: Reformat program-client.c.
Stephan Bosch [Sun, 25 Feb 2018 09:05:33 +0000 (10:05 +0100)] 
lib-program-client: Reformat program-client.c.

6 years agolib: iostream-pump: Properly implement running a pump with one of the streams blocking.
Stephan Bosch [Sun, 25 Feb 2018 20:45:17 +0000 (21:45 +0100)] 
lib: iostream-pump: Properly implement running a pump with one of the streams blocking.

Having both streams blocking is not useful and that is now explicitly forbidden.

6 years agolib: iostream-pump: Add iostream_pump_destroy().
Stephan Bosch [Sun, 25 Feb 2018 18:24:58 +0000 (19:24 +0100)] 
lib: iostream-pump: Add iostream_pump_destroy().

This functions always stops the pump and dereferences the streams before
dereferencing the pump itself.

6 years agolib: iostream-pump: Make iostream_pump_unref() implementation match other similar...
Stephan Bosch [Sun, 25 Feb 2018 18:13:18 +0000 (19:13 +0100)] 
lib: iostream-pump: Make iostream_pump_unref() implementation match other similar code.

This also means that iostream_pump_unref(NULL) is now a no-op.

6 years agolib: iostream-pump: Use refcount as name and int as type for reference count field.
Stephan Bosch [Sun, 25 Feb 2018 18:18:47 +0000 (19:18 +0100)] 
lib: iostream-pump: Use refcount as name and int as type for reference count field.

This is what the rest of Dovecot uses.

6 years agolib: Reformat test-iostream-pump.c.
Stephan Bosch [Sun, 25 Feb 2018 20:56:55 +0000 (21:56 +0100)] 
lib: Reformat test-iostream-pump.c.

6 years agolib: Reformat iostream-pump.c.
Stephan Bosch [Sun, 25 Feb 2018 18:04:14 +0000 (19:04 +0100)] 
lib: Reformat iostream-pump.c.

6 years agolib: Reformat iostream-pump.h.
Stephan Bosch [Sun, 25 Feb 2018 18:03:49 +0000 (19:03 +0100)] 
lib: Reformat iostream-pump.h.

6 years agolib-index: Make sure tail_offset is updated after calling expunge handlers
Timo Sirainen [Tue, 5 Feb 2019 22:17:52 +0000 (14:17 -0800)] 
lib-index: Make sure tail_offset is updated after calling expunge handlers

Since it's a bit troublesome to track whether expunge handlers were actually
called, we can just assume that as long as syncing sees expunges, they were
called (and thet most likely were).

This fixes a bug where dovecot.index.cache header's record_count kept
shrinking and deleted_record_count kept increasing after each sync.
These values were only used to determine when to compress the cache, so
its only effect was that the cache could have been compressed earlier
than necessary.

6 years agolib-dict: dict-sql - Add username as parameter
Aki Tuomi [Fri, 19 Apr 2019 17:39:32 +0000 (20:39 +0300)] 
lib-dict: dict-sql - Add username as parameter

SQL statement caching works better when the username is provided
as parameter instead of part of the query, since the caching
can now cache same statements despite username changes.

6 years agolib-dns: Remove unused Valgrind disable
Martti Rannanjärvi [Thu, 27 Dec 2018 09:55:31 +0000 (11:55 +0200)] 
lib-dns: Remove unused Valgrind disable

6 years agolib: Add test-fd-util.c to test i_close() panic message
Martti Rannanjärvi [Thu, 23 May 2019 15:49:18 +0000 (18:49 +0300)] 
lib: Add test-fd-util.c to test i_close() panic message

6 years agocassandra: Handle cass_future_set_callback() calling callback immediately
Timo Sirainen [Mon, 20 May 2019 11:16:52 +0000 (14:16 +0300)] 
cassandra: Handle cass_future_set_callback() calling callback immediately

The previous code always assumed it would be called from another thread, but
due to race conditions this wasn't true always. The lookup could have
already finished by the time cass_future_set_callback() was called, in which
case it called the callback immediately.

If the callback was called from the main thread, it still wrote to the
fd_pipe. Because this was a blocking write, it was possible that the pipe
ended becoming full, which caused the whole dict process to hang.

6 years agocassandra: Move cassandra_callback_run() earlier
Timo Sirainen [Mon, 20 May 2019 11:16:08 +0000 (14:16 +0300)] 
cassandra: Move cassandra_callback_run() earlier

Simplifies the next commit.

6 years agolib: ostream-file - Use TCP_NODELAY when uncorking, not corking
Timo Sirainen [Mon, 20 May 2019 13:33:30 +0000 (16:33 +0300)] 
lib: ostream-file - Use TCP_NODELAY when uncorking, not corking

6 years agolib: ostream-file - Don't try to set TCP options after stream is closed
Timo Sirainen [Mon, 20 May 2019 20:46:43 +0000 (23:46 +0300)] 
lib: ostream-file - Don't try to set TCP options after stream is closed

Flushing the buffer could close the stream and the fd.

6 years agolib: ostream-file - Ignore ENOPROTOOPT error also when setting TCP_NODELAY
Timo Sirainen [Fri, 17 May 2019 13:13:17 +0000 (16:13 +0300)] 
lib: ostream-file - Ignore ENOPROTOOPT error also when setting TCP_NODELAY

This happens in some OSes.

6 years agolib: ostream-file - Don't use TCP_CORK or TCP_NODELAY for UNIX sockets
Timo Sirainen [Fri, 17 May 2019 13:12:24 +0000 (16:12 +0300)] 
lib: ostream-file - Don't use TCP_CORK or TCP_NODELAY for UNIX sockets

Either they fail or just don't do anything.

6 years agovirtual: Fix calling mail_add_temp_wanted_fields() before mail is set
Timo Sirainen [Fri, 27 Apr 2018 11:26:46 +0000 (14:26 +0300)] 
virtual: Fix calling mail_add_temp_wanted_fields() before mail is set

Fixes:
Panic: file virtual-mail.c: line 123 (backend_mail_get): assertion failed: (bbox != NULL)

6 years agovirtual: Fix mail.add_temp_wanted_fields() to handle headers correctly
Timo Sirainen [Fri, 27 Apr 2018 10:56:13 +0000 (13:56 +0300)] 
virtual: Fix mail.add_temp_wanted_fields() to handle headers correctly

The header that was passed to backend contained wrong index numbers, causing
wrong headers to be used.

6 years agolib-storage: Update mail_add_temp_wanted_fields() comment
Timo Sirainen [Fri, 27 Apr 2018 10:52:28 +0000 (13:52 +0300)] 
lib-storage: Update mail_add_temp_wanted_fields() comment

6 years agolib-storage: Move code to a new mailbox_header_lookup_merge()
Timo Sirainen [Fri, 27 Apr 2018 10:49:53 +0000 (13:49 +0300)] 
lib-storage: Move code to a new mailbox_header_lookup_merge()

6 years agolib: ostream-file - Don't try to set TCP_NODELAY for non-socket fds
Timo Sirainen [Wed, 15 May 2019 07:25:47 +0000 (10:25 +0300)] 
lib: ostream-file - Don't try to set TCP_NODELAY for non-socket fds

Also log if there are any unexpected errors.

6 years agolib-storage: Don't try to set attachment keywords if bodystructure wasn't parsed
Aki Tuomi [Wed, 15 May 2019 07:49:09 +0000 (10:49 +0300)] 
lib-storage: Don't try to set attachment keywords if bodystructure wasn't parsed

This was broken in 057028e3f5567e21c964005ffccda1055fa86508 as there are
code paths leading here that omit bodystructure processing.

Fixes Panic: file index-mail.c: line 1150 (index_mail_parse_body_finish): assertion failed: (mail->data.parsed_bodystructure)

6 years agolib: Make sure uncorking ostream-file flushes network output immediately
Timo Sirainen [Fri, 10 May 2019 15:06:46 +0000 (18:06 +0300)] 
lib: Make sure uncorking ostream-file flushes network output immediately

TCP_CORK and TCP_NODELAY are separate things, but we'll treat them similarly
for our ostream corking API. It was always intended that all data written
inside corking would be delayed until uncork, and immediately sent
afterwards.

This change removes unnecessary extra 40ms delays, which may happen when
proxying.

6 years agodoveadm: Add error_r to server_connection_create()
Martti Rannanjärvi [Mon, 13 May 2019 13:16:43 +0000 (16:16 +0300)] 
doveadm: Add error_r to server_connection_create()

6 years agodoveadm-dsync: Always cleanup after connection
Aki Tuomi [Fri, 10 May 2019 12:55:22 +0000 (15:55 +0300)] 
doveadm-dsync: Always cleanup after connection

Go through the same error handling path every time. Fixes
Panic: file ioloop.c: line 826 (io_loop_destroy): assertion failed: (ioloop == current_ioloop)

This happened because the ioloop wasn't destroyed
on error.

6 years agodoveadm-dsync: Move actual command execution to dsync_server_run_command
Aki Tuomi [Fri, 10 May 2019 12:54:37 +0000 (15:54 +0300)] 
doveadm-dsync: Move actual command execution to dsync_server_run_command

Simplifies next commit

6 years agolib-storage: Attachment flag detection shouldn't cause mail body to be opened
Timo Sirainen [Fri, 10 May 2019 16:16:07 +0000 (19:16 +0300)] 
lib-storage: Attachment flag detection shouldn't cause mail body to be opened

Fetching cached mail headers with
mail_attachment_detection_options=add-flags-on-save caued IMAP BODYSTRUCTURE
to be fetched as well. If it wasn't already cached, this caused opening the
mail body to generate it. Also the result wasn't added to cache, so the
inefficient behavior continued.

6 years agodict: Make sure connection IO is stopped when client is disconnected
Timo Sirainen [Fri, 10 May 2019 14:45:14 +0000 (17:45 +0300)] 
dict: Make sure connection IO is stopped when client is disconnected

I'm not sure if this fixes anything, but it makes the behavior closer to
what it was before 2ff2da52146609f4459bd0f7fd603e13400cb85e.

6 years agodict: Fix client connection reference counting
Timo Sirainen [Fri, 10 May 2019 14:44:04 +0000 (17:44 +0300)] 
dict: Fix client connection reference counting

If the client disconnected while commands were still running, the destroy
callback could have been called multiple times.

Broken by 2ff2da52146609f4459bd0f7fd603e13400cb85e

Fixes:
Panic: file dict-connection.c: line 149 (dict_connection_unref): assertion failed: (array_count(&conn->cmds) == 0)

6 years agolib-storage: maildir: maildir-copy - Fix omission of keywords while copying message...
Stephan Bosch [Fri, 11 Jan 2019 13:33:59 +0000 (14:33 +0100)] 
lib-storage: maildir: maildir-copy - Fix omission of keywords while copying message with hardlinking.