]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-http: client: Flush and check output for errors after uncorking.
Stephan Bosch [Sat, 17 Feb 2018 00:25:50 +0000 (01:25 +0100)] 
lib-http: client: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-http: server: Simplified return code handling in http_server_response_send_real().
Stephan Bosch [Sat, 17 Feb 2018 14:37:20 +0000 (15:37 +0100)] 
lib-http: server: Simplified return code handling in http_server_response_send_real().

7 years agolib-http: server: Make sure output is used only when valid in http_server_response_se...
Stephan Bosch [Sat, 17 Feb 2018 14:29:20 +0000 (15:29 +0100)] 
lib-http: server: Make sure output is used only when valid in http_server_response_send_real().

This avoids the need to hold a reference to it.

7 years agolib-http: server: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:26:02 +0000 (01:26 +0100)] 
lib-http: server: Perform output stream error handling in one place.

7 years agolib-http: server: Flush and check output for errors after uncorking.
Stephan Bosch [Sat, 17 Feb 2018 13:44:49 +0000 (14:44 +0100)] 
lib-http: server: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-http: server: Handle output stream errors in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 13:28:36 +0000 (14:28 +0100)] 
lib-http: server: Handle output stream errors in a separate function.

7 years agolib-smtp: client: Uncork and flush the output stream explicitly after sending commands.
Stephan Bosch [Sat, 17 Feb 2018 09:26:30 +0000 (10:26 +0100)] 
lib-smtp: client: Uncork and flush the output stream explicitly after sending commands.

This allows detecting any output stream errors.

7 years agolib-smtp: client: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:46:15 +0000 (01:46 +0100)] 
lib-smtp: client: Perform output stream error handling in one place.

7 years agolib-smtp: client: Flush and check output for errors after uncorking.
Stephan Bosch [Fri, 16 Feb 2018 22:49:31 +0000 (23:49 +0100)] 
lib-smtp: client: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-smtp: client: Handle output stream errors in a separate function.
Stephan Bosch [Fri, 16 Feb 2018 22:40:29 +0000 (23:40 +0100)] 
lib-smtp: client: Handle output stream errors in a separate function.

7 years agolib-smtp: server: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:46:25 +0000 (01:46 +0100)] 
lib-smtp: server: Perform output stream error handling in one place.

7 years agolib-smtp: server: Remove undefined smtp_server_reply_send_more() from smtp-server...
Stephan Bosch [Sat, 17 Feb 2018 09:37:55 +0000 (10:37 +0100)] 
lib-smtp: server: Remove undefined smtp_server_reply_send_more() from smtp-server-private.h.

7 years agolib-smtp: server: Flush and check output for errors after uncorking.
Stephan Bosch [Fri, 16 Feb 2018 09:05:26 +0000 (10:05 +0100)] 
lib-smtp: server: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-smtp: server: STARTTLS command: Properly handle output stream flush error.
Stephan Bosch [Fri, 16 Feb 2018 09:13:35 +0000 (10:13 +0100)] 
lib-smtp: server: STARTTLS command: Properly handle output stream flush error.

7 years agolib-smtp: server: Handle output stream errors in a separate function.
Stephan Bosch [Fri, 16 Feb 2018 09:11:01 +0000 (10:11 +0100)] 
lib-smtp: server: Handle output stream errors in a separate function.

7 years agolib-smtp: server: Use the stream_errno to evaluate output stream errors.
Stephan Bosch [Fri, 16 Feb 2018 08:34:48 +0000 (09:34 +0100)] 
lib-smtp: server: Use the stream_errno to evaluate output stream errors.

Code was using global errno.

7 years agolib: Add o_stream_uncork_flush() to both uncork and flush
Timo Sirainen [Fri, 16 Feb 2018 12:26:11 +0000 (14:26 +0200)] 
lib: Add o_stream_uncork_flush() to both uncork and flush

7 years agoipc: Change ipc socket's owner to $default_internal_user
Timo Sirainen [Wed, 7 Feb 2018 14:48:28 +0000 (16:48 +0200)] 
ipc: Change ipc socket's owner to $default_internal_user

This is mainly used by director process, which runs as
$default_internal_user. This setting change is always required for director
installations. Also the ipc process itself is already running as
$default_internal_user so this should be a rather safe change.

7 years agolib-mail: message_address_write() - don't crash with NULL address
Timo Sirainen [Tue, 6 Mar 2018 10:14:25 +0000 (12:14 +0200)] 
lib-mail: message_address_write() - don't crash with NULL address

message_address_parse() can return NULL on empty address, so writing it
should produce empty address as well. Broken by
15581297511b658a29c707c6031a258bab7bf1a5

7 years agoostream-zlib: Ignore missing finish if parent stream is ignoring errors
Timo Sirainen [Sat, 6 Jan 2018 19:22:11 +0000 (21:22 +0200)] 
ostream-zlib: Ignore missing finish if parent stream is ignoring errors

This fixes panic with imap_zlib plugin when client enables the IMAP COMPRESS
extension and disconnects:

Panic: file ostream-zlib.c: line 36 (o_stream_zlib_close): assertion failed: (zstream->ostream.finished || zstream->ostream.ostream.stream_errno != 0)

7 years agodoveadm dump: Fix imapzlib to handle input traffic
Timo Sirainen [Sat, 6 Jan 2018 20:11:30 +0000 (22:11 +0200)] 
doveadm dump: Fix imapzlib to handle input traffic

This has been broken with newer Dovecot versions for a while now.

7 years agolib-storage: Rename .vsize.lock file to dovecot-vsize.lock
Aki Tuomi [Wed, 24 Jan 2018 12:48:36 +0000 (14:48 +0200)] 
lib-storage: Rename .vsize.lock file to dovecot-vsize.lock

.vsize.lock can break maildir++ because it looks like a maildir folder,
so rename it to dovecot-vsize.lock.

Introduced in 9963bef6

7 years agolib: array_idx_modifiable changed not to allocate space.
Sergey Kitov [Thu, 7 Dec 2017 09:34:57 +0000 (11:34 +0200)] 
lib: array_idx_modifiable changed not to allocate space.

7 years agoglobal: Change calls to array_idx_modifiable to array_idx_get_space.
Sergey Kitov [Thu, 7 Dec 2017 09:00:50 +0000 (11:00 +0200)] 
global: Change calls to array_idx_modifiable to array_idx_get_space.

Only calls that require space allocation are to be changed.

7 years agolib: array_idx_get_space is defined as alias to array_idx_modifiable
Sergey Kitov [Thu, 7 Dec 2017 08:51:27 +0000 (10:51 +0200)] 
lib: array_idx_get_space is defined as alias to array_idx_modifiable

7 years agolib-http: server: Recreate connection IO after streams change.
Stephan Bosch [Fri, 9 Feb 2018 22:57:29 +0000 (23:57 +0100)] 
lib-http: server: Recreate connection IO after streams change.

7 years agolib-http: client: Recreate connection IO after streams change.
Stephan Bosch [Fri, 9 Feb 2018 22:56:55 +0000 (23:56 +0100)] 
lib-http: client: Recreate connection IO after streams change.

7 years agolib-smtp: server: Recreate connection IO after streams change.
Stephan Bosch [Fri, 9 Feb 2018 23:07:37 +0000 (00:07 +0100)] 
lib-smtp: server: Recreate connection IO after streams change.

7 years agolib-http: server: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:29:44 +0000 (10:29 +0100)] 
lib-http: server: Use the new connection_input_halt/resume() functions.

7 years agolib-http: client: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:27:19 +0000 (10:27 +0100)] 
lib-http: client: Use the new connection_input_halt/resume() functions.

7 years agolib-smtp: server: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:07:28 +0000 (10:07 +0100)] 
lib-smtp: server: Use the new connection_input_halt/resume() functions.

7 years agolib-smtp: client: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:01:20 +0000 (10:01 +0100)] 
lib-smtp: client: Use the new connection_input_halt/resume() functions.

7 years agolib-ssl-iostream: ostream-openssl: Fix behavior of o_stream_flush() so that 1 is...
Stephan Bosch [Fri, 9 Feb 2018 16:24:28 +0000 (17:24 +0100)] 
lib-ssl-iostream: ostream-openssl: Fix behavior of o_stream_flush() so that 1 is only returned when buffer is empty.

7 years agolib-ssl-iostream: ostream-openssl: Create local variable for sstream->ssl_io->plain_o...
Stephan Bosch [Thu, 15 Feb 2018 14:47:48 +0000 (15:47 +0100)] 
lib-ssl-iostream: ostream-openssl: Create local variable for sstream->ssl_io->plain_output in o_stream_ssl_flush().

7 years agolib: connection: Add connection_input_halt() and connection_input_resume().
Stephan Bosch [Sat, 10 Feb 2018 08:55:43 +0000 (09:55 +0100)] 
lib: connection: Add connection_input_halt() and connection_input_resume().

These are convenience functions that remove and add conn->io respectively.

7 years agolib-smtp: client: Moved smtp_client_init_ssl_ctx() from smtp-client.h to smtp-client...
Stephan Bosch [Sat, 10 Feb 2018 08:37:32 +0000 (09:37 +0100)] 
lib-smtp: client: Moved smtp_client_init_ssl_ctx() from smtp-client.h to smtp-client-private.h.

7 years agolib-http: client: Use conn->conn.ioloop rather than cctx->ioloop in connection.
Stephan Bosch [Sat, 10 Feb 2018 09:46:45 +0000 (10:46 +0100)] 
lib-http: client: Use conn->conn.ioloop rather than cctx->ioloop in connection.

This leads to somewhat simpler code, and makes having connections on different
ioloops easier in the future.

7 years agolib: connection: Record the ioloop the connection was last switched to.
Stephan Bosch [Sat, 10 Feb 2018 09:20:18 +0000 (10:20 +0100)] 
lib: connection: Record the ioloop the connection was last switched to.

7 years agolib-http: client: Move connection to shared context's ioloop, rather than the current...
Stephan Bosch [Sat, 10 Feb 2018 09:53:00 +0000 (10:53 +0100)] 
lib-http: client: Move connection to shared context's ioloop, rather than the current_ioloop.

This is an omission.

7 years agodoveadm: dsync: Switch ioloop for input/output streams while making TCP connection.
Stephan Bosch [Mon, 29 Jan 2018 18:10:38 +0000 (19:10 +0100)] 
doveadm: dsync: Switch ioloop for input/output streams while making TCP connection.

This task is performed in a sub-ioloop, and when returning from that ioloop, the
output stream would sometimes still have an object on the sub-ioloop that was
just destroyed.

7 years agolib-ssl-iostream: openssl: Make verbose logging robust against i_debug() writing...
Stephan Bosch [Mon, 29 Jan 2018 17:28:25 +0000 (18:28 +0100)] 
lib-ssl-iostream: openssl: Make verbose logging robust against i_debug() writing to stream itself.

In dsync, i_debug() is overridden to write to the SSL stream itself through a
multiplexed data stream. So, during the i_debug() call all kinds of things can
happen to the persisted error string in the stream, which caused problems.

7 years agolib-http: client: Make sure all ioloop objects are created on the ioloop that the...
Stephan Bosch [Tue, 16 Jan 2018 01:02:11 +0000 (02:02 +0100)] 
lib-http: client: Make sure all ioloop objects are created on the ioloop that the client/context is switched to.

7 years agolib-dns: Allow setting the ioloop that the dns_lookup/dns_client is started on.
Stephan Bosch [Tue, 16 Jan 2018 23:37:37 +0000 (00:37 +0100)] 
lib-dns: Allow setting the ioloop that the dns_lookup/dns_client is started on.

7 years agolib: connection: Allow switching to a specific ioloop.
Stephan Bosch [Wed, 17 Jan 2018 01:50:05 +0000 (02:50 +0100)] 
lib: connection: Allow switching to a specific ioloop.

7 years agolib: ostream: Allow switching to a specific ioloop.
Stephan Bosch [Wed, 17 Jan 2018 01:49:44 +0000 (02:49 +0100)] 
lib: ostream: Allow switching to a specific ioloop.

7 years agolib: istream: Allow switching to a specific ioloop.
Stephan Bosch [Wed, 17 Jan 2018 01:48:43 +0000 (02:48 +0100)] 
lib: istream: Allow switching to a specific ioloop.

7 years agolib: iostream: Record the ioloop that the iostream was last switched to.
Stephan Bosch [Wed, 24 Jan 2018 22:02:03 +0000 (23:02 +0100)] 
lib: iostream: Record the ioloop that the iostream was last switched to.

7 years agolib: ioloop: Add functions for adding/moving timeouts and ios to a specific ioloop.
Stephan Bosch [Tue, 16 Jan 2018 18:37:46 +0000 (19:37 +0100)] 
lib: ioloop: Add functions for adding/moving timeouts and ios to a specific ioloop.

7 years agolib-http: test-http-client: Free the ssl_iostream_context cache.
Stephan Bosch [Wed, 3 Jan 2018 01:11:19 +0000 (02:11 +0100)] 
lib-http: test-http-client: Free the ssl_iostream_context cache.

7 years agolib-http: test-http-payload: Added test with clients using shared global context.
Stephan Bosch [Fri, 29 Dec 2017 02:19:34 +0000 (03:19 +0100)] 
lib-http: test-http-payload: Added test with clients using shared global context.

7 years agolib-http: client: Implicitly switch ioloop for global shared client context.
Stephan Bosch [Fri, 29 Dec 2017 00:17:15 +0000 (01:17 +0100)] 
lib-http: client: Implicitly switch ioloop for global shared client context.

If the new ioloop is NULL, close the shared client context. In that case all
shared hosts, peers and idle connetions are closed and destroyed. The context
just remains as a container for settings and shared context. This is only
allowed when there are no clients left.

7 years agolib-http: client: Use merged DNS settings from all clients connected to a shared...
Stephan Bosch [Fri, 29 Dec 2017 01:15:06 +0000 (02:15 +0100)] 
lib-http: client: Use merged DNS settings from all clients connected to a shared context for DNS lookups.

7 years agolib-http: client: Base forcing shared context debug logging on the settings of the...
Stephan Bosch [Fri, 29 Dec 2017 00:47:16 +0000 (01:47 +0100)] 
lib-http: client: Base forcing shared context debug logging on the settings of the context itself and each associated client.

7 years agolib-http: client: Register client objects in the associated client shared context.
Stephan Bosch [Thu, 28 Dec 2017 23:48:32 +0000 (00:48 +0100)] 
lib-http: client: Register client objects in the associated client shared context.

7 years agolib-http: client: Call switching ioloop for shared peer from shared client context.
Stephan Bosch [Thu, 28 Dec 2017 23:30:27 +0000 (00:30 +0100)] 
lib-http: client: Call switching ioloop for shared peer from shared client context.

Before, it was called from the client peer.

7 years agolib-http: client: Set req->client to NULL once the request is destroyed.
Stephan Bosch [Fri, 29 Dec 2017 00:05:21 +0000 (01:05 +0100)] 
lib-http: client: Set req->client to NULL once the request is destroyed.

The http_client_request_destroy() function does not free the request
immediately, as long as it is still referenced. It can still be referenced by a
connection that has sent it and is waiting for a reply (payload). In the mean
time the actual client can be gone, so we want to make sure nothing is pointing
to that anymore.

This change adds a few extra assertions to make sure nothing tries to use a
NULL client later on. Some direct references to req->client are replaced with a
local client variable if there is one.

7 years agolib-http: client: Merge socket buffer size settings with settings from shared context.
Stephan Bosch [Thu, 28 Dec 2017 23:21:01 +0000 (00:21 +0100)] 
lib-http: client: Merge socket buffer size settings with settings from shared context.

While using the default global context, per-client socket buffer size settings were ignored.

7 years agolib-http: client: Merge max_idle_time_msecs setting with setting from shared context.
Stephan Bosch [Thu, 28 Dec 2017 23:16:30 +0000 (00:16 +0100)] 
lib-http: client: Merge max_idle_time_msecs setting with setting from shared context.

While using the default global context, per-client max_idle_time_msecs setting was ignored.

7 years agodoveadm: Unref header search context after use
Aki Tuomi [Fri, 29 Dec 2017 14:19:53 +0000 (16:19 +0200)] 
doveadm: Unref header search context after use

Fixes memory leak, found by valgrind

7 years agoconfig: Fix ssl_params.dat conversion warning
Aki Tuomi [Thu, 8 Feb 2018 13:34:53 +0000 (15:34 +0200)] 
config: Fix ssl_params.dat conversion warning

The command is dhparam, not dh.

7 years agoglobal: Call rfc822_parser_deinit() wherever possible
Timo Sirainen [Fri, 22 Dec 2017 16:58:11 +0000 (18:58 +0200)] 
global: Call rfc822_parser_deinit() wherever possible

7 years agolib-mail: Refactor code to make the next commit smaller
Timo Sirainen [Tue, 9 Jan 2018 16:33:59 +0000 (11:33 -0500)] 
lib-mail: Refactor code to make the next commit smaller

7 years agolib-mail: Add rfc822_parser_deinit()
Timo Sirainen [Fri, 22 Dec 2017 16:56:53 +0000 (18:56 +0200)] 
lib-mail: Add rfc822_parser_deinit()

It's not a strict requirement to call this, but it assert-crashes if the
state isn't valid.

7 years agolib-mail: Make sure parsers don't accidentally go much beyond end pointer
Timo Sirainen [Fri, 22 Dec 2017 16:42:53 +0000 (18:42 +0200)] 
lib-mail: Make sure parsers don't accidentally go much beyond end pointer

7 years agolib-mail: Fix out-of-bounds read when parsing an invalid email address
Timo Sirainen [Fri, 22 Dec 2017 16:36:55 +0000 (18:36 +0200)] 
lib-mail: Fix out-of-bounds read when parsing an invalid email address

The included unit test doesn't fail, but running it with valgrind shows
"Invalid read of size 1" error.

Broken in d6737a17a27402e7a262f7ba8a2ed588d576f23c

Discovered by Aleksandar Nikolic of Cisco Talos

7 years agolib-mail: test-message-address - Add TEST_MESSAGE_ADDRESS_FLAG_SKIP_LIST flag
Timo Sirainen [Fri, 22 Dec 2017 16:36:09 +0000 (18:36 +0200)] 
lib-mail: test-message-address - Add TEST_MESSAGE_ADDRESS_FLAG_SKIP_LIST flag

This commit just adds the flag and sets it to 0 for all existing tests.

7 years agolib-mail: rfc822-parser - Add asserts to make sure parser state is correct
Timo Sirainen [Fri, 22 Dec 2017 16:31:52 +0000 (18:31 +0200)] 
lib-mail: rfc822-parser - Add asserts to make sure parser state is correct

7 years agolib-dns: Move before lib-master
Aki Tuomi [Mon, 19 Feb 2018 12:19:08 +0000 (14:19 +0200)] 
lib-dns: Move before lib-master

7 years agolib-master: Fix dns_match_wildcard result value check
Aki Tuomi [Mon, 26 Feb 2018 10:53:19 +0000 (12:53 +0200)] 
lib-master: Fix dns_match_wildcard result value check

It returns 0, not TRUE.

7 years agolib-master: Check local_name only if both filter and input have it
Aki Tuomi [Fri, 23 Feb 2018 13:31:11 +0000 (15:31 +0200)] 
lib-master: Check local_name only if both filter and input have it

Broken in cedc777a1acf830af4cf0b6e9b0f343c81e20adc

7 years agologin-common: Enable config filtering by local name
Aki Tuomi [Thu, 30 Nov 2017 18:52:11 +0000 (20:52 +0200)] 
login-common: Enable config filtering by local name

Prevents servername misuse.

7 years agolib-master: Support validating config filters against requests
Aki Tuomi [Thu, 30 Nov 2017 13:47:25 +0000 (15:47 +0200)] 
lib-master: Support validating config filters against requests

Validation will sanitize the input request and drop any fields
that have no filter in config. E.g. if you have a local block
with name, and nothing else, then lip/rip will be dropped
from the request.

7 years agoconfig: Add command to request all filters
Aki Tuomi [Thu, 30 Nov 2017 13:46:52 +0000 (15:46 +0200)] 
config: Add command to request all filters

7 years agoconfig: Add config_filter_get_all
Aki Tuomi [Thu, 30 Nov 2017 13:46:40 +0000 (15:46 +0200)] 
config: Add config_filter_get_all

Returns all filters

7 years agocharset-alias: Don't return value from void functions
Martti Rannanjärvi [Mon, 5 Mar 2018 12:55:04 +0000 (14:55 +0200)] 
charset-alias: Don't return value from void functions

7 years agolib-smtp: server: Fix reporting of XCLIENT capability in EHLO response.
Stephan Bosch [Wed, 14 Feb 2018 00:30:14 +0000 (01:30 +0100)] 
lib-smtp: server: Fix reporting of XCLIENT capability in EHLO response.

The trusted connection check logic was inverted.

7 years agolib-smtp: server: Fix segfault occurring when XCLIENT command is handled.
Stephan Bosch [Wed, 14 Feb 2018 21:20:20 +0000 (22:20 +0100)] 
lib-smtp: server: Fix segfault occurring when XCLIENT command is handled.

Occurs only when the application (in this case LMTP) has a
conn_proxy_data_updated() callback. The context parameter was the struct
smtp_server_connection object itself, rather than the application context. This
caused the connection object to be overwritten.

7 years agolib-smtp: server: Fix segfault occurring during XCLIENT when no extension fields...
Stephan Bosch [Tue, 13 Feb 2018 19:42:30 +0000 (20:42 +0100)] 
lib-smtp: server: Fix segfault occurring during XCLIENT when no extension fields are configured.

7 years agolib-imap-storage: imap-msgpart-url: Perform the check for a proper messagepart URL...
Stephan Bosch [Tue, 13 Feb 2018 20:19:18 +0000 (21:19 +0100)] 
lib-imap-storage: imap-msgpart-url: Perform the check for a proper messagepart URL in imap_msgpart_url_create().

Before, this was an assert in imap_msgpart_url_create(). The actual check was
performed only in imap_msgpart_url_parse(), meaning that
imap_msgpart_url_create() would fail with an assertion when provided with an
inappropriate URL.

This surfaced as a problem for the submission BURL command.

7 years agom4: Use -U and -D in cc_fortify
Aki Tuomi [Sun, 25 Feb 2018 07:35:43 +0000 (09:35 +0200)] 
m4: Use -U and -D in cc_fortify

Not just -D. This is to test the same thing
that gets used.

7 years agom4: Remove pthread from tests
Aki Tuomi [Sun, 25 Feb 2018 07:35:19 +0000 (09:35 +0200)] 
m4: Remove pthread from tests

7 years agoreplication: Don't trigger replication on changes not visible to dsync
Timo Sirainen [Thu, 8 Feb 2018 15:19:24 +0000 (17:19 +0200)] 
replication: Don't trigger replication on changes not visible to dsync

For example if there's a write to .cache file, it doesn't require
replication.

7 years agolib-storage: Replace mail_transaction_commit_changes.changed with changes_mask
Timo Sirainen [Thu, 8 Feb 2018 15:17:59 +0000 (17:17 +0200)] 
lib-storage: Replace mail_transaction_commit_changes.changed with changes_mask

This allows better finding out what changed in the transaction.

7 years agolib-storage: Include mail-index.h from mail-storage.h
Timo Sirainen [Thu, 8 Feb 2018 15:14:53 +0000 (17:14 +0200)] 
lib-storage: Include mail-index.h from mail-storage.h

This makes it a bit more acceptable to use mail-index.h API, without having
to go through the lib-storage layer. This is also needed by the next patch
to avoid duplicating the same enum in both lib-index and lib-storage layer.

7 years agolib-storage: Remove mailbox_transaction_context.nontransactional_changes
Timo Sirainen [Thu, 8 Feb 2018 15:00:38 +0000 (17:00 +0200)] 
lib-storage: Remove mailbox_transaction_context.nontransactional_changes

Nothing cares about them. It was only set for POP3 UIDL change with
Maildir. In theory dsync replication would want to replicate such a change,
but it doesn't actually support changing UIDLs for existing mails. Other
mailbox formats don't support it anyway.

7 years agolib-index: Add mail_index_transaction_commit_result.changes_mask
Timo Sirainen [Thu, 8 Feb 2018 14:53:15 +0000 (16:53 +0200)] 
lib-index: Add mail_index_transaction_commit_result.changes_mask

This can be used to determine what type of changes were committed in a
transaction.

7 years agolib-index: Cleanup - return bool in log_append_keyword_updates()
Timo Sirainen [Thu, 8 Feb 2018 14:50:58 +0000 (16:50 +0200)] 
lib-index: Cleanup - return bool in log_append_keyword_updates()

Simplifies the next commit.

7 years agolmtp: local: Don't deliver more than once to the same recipient.
Stephan Bosch [Sat, 13 Jan 2018 10:53:43 +0000 (11:53 +0100)] 
lmtp: local: Don't deliver more than once to the same recipient.

Duplicate RCPT TO commands for local recipients are now mostly ignored,
by repeating the reply for the first instance of that RCPT TO command.

7 years agolmtp: Add recipient type to struct lmtp_recipient.
Stephan Bosch [Sat, 13 Jan 2018 12:34:47 +0000 (13:34 +0100)] 
lmtp: Add recipient type to struct lmtp_recipient.

7 years agolmtp: Move common recipient handling code to separate file.
Stephan Bosch [Sat, 13 Jan 2018 12:25:01 +0000 (13:25 +0100)] 
lmtp: Move common recipient handling code to separate file.

7 years agolib-smtp: server: Use smtp_server_reply_submit_duplicate() in smtp_server_reply_allv().
Stephan Bosch [Sat, 13 Jan 2018 12:10:53 +0000 (13:10 +0100)] 
lib-smtp: server: Use smtp_server_reply_submit_duplicate() in smtp_server_reply_allv().

This is more efficient, since it doesn't need to compose new content for each
reply.

7 years agolib-smtp: server: Add function that allows submitting duplicate replies.
Stephan Bosch [Sat, 13 Jan 2018 12:08:53 +0000 (13:08 +0100)] 
lib-smtp: server: Add function that allows submitting duplicate replies.

The smtp_server_reply_submit_duplicate() function submits a new reply at the
specified index with content duplicated from an existing earlier reply.

7 years agolib-smtp: server: Move allocation of command replies to a separate function.
Stephan Bosch [Sat, 13 Jan 2018 12:03:48 +0000 (13:03 +0100)] 
lib-smtp: server: Move allocation of command replies to a separate function.

7 years agolib-smtp: server: Put reply content in a separate struct.
Stephan Bosch [Sat, 13 Jan 2018 11:43:08 +0000 (12:43 +0100)] 
lib-smtp: server: Put reply content in a separate struct.

This allows duplicate replies to share content for a multi-reply command.

7 years agolib-smtp: server: Allow part of the replies to be already sent in smtp_server_reply_a...
Stephan Bosch [Sat, 13 Jan 2018 11:56:59 +0000 (12:56 +0100)] 
lib-smtp: server: Allow part of the replies to be already sent in smtp_server_reply_allv().

This is not something observed to happen in existing code, but it is best to
deal with this properly, as it could happen in the future.

7 years agolib-smtp: server: transaction: Add function that finds duplicate recipients.
Stephan Bosch [Sat, 13 Jan 2018 11:26:57 +0000 (12:26 +0100)] 
lib-smtp: server: transaction: Add function that finds duplicate recipients.

Duplicate means that both the path and parameters are equal.

7 years agolib-smtp: server: Add RCPT parameters directly in smtp_server_transaction_add_rcpt().
Stephan Bosch [Sat, 13 Jan 2018 11:20:34 +0000 (12:20 +0100)] 
lib-smtp: server: Add RCPT parameters directly in smtp_server_transaction_add_rcpt().

This makes more sense. Before, these were added to the recipient in
smtp-server-cmd-rcpt.c, after the recipient was added.

7 years agolib-smtp: params: Add function that allows checking whether RCPT parameters are equal.
Stephan Bosch [Sat, 13 Jan 2018 10:52:31 +0000 (11:52 +0100)] 
lib-smtp: params: Add function that allows checking whether RCPT parameters are equal.

7 years agolib-smtp: params: Add functions to evaluate any extra (non-standard) MAIL and RCPT...
Stephan Bosch [Sat, 13 Jan 2018 11:07:46 +0000 (12:07 +0100)] 
lib-smtp: params: Add functions to evaluate any extra (non-standard) MAIL and RCPT parameters.

These allow looking up the parameter based on its name.

7 years agolib-smtp: address: Consistently allow address values to be NULL.
Stephan Bosch [Sat, 13 Jan 2018 10:51:24 +0000 (11:51 +0100)] 
lib-smtp: address: Consistently allow address values to be NULL.

If the address pointer is NULL or the localpart field is NULL or empty, it
signifies that it is the NULL address "<>".

In the case of smtp_address_equals(), this also likely fixes crashes at places
where it may be used to compare "<>".