]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Aki Tuomi [Mon, 19 Feb 2018 17:09:46 +0000 (19:09 +0200)]
lib: connection - only switch created iostreams
Fixes imap-hibernate: Fatal: master: service(imap-hibernate):
child killed with signal 11 (core dumps disabled)
Broken in
086b73efd1a5812a64acc951366a499d325509a6
Stephan Bosch [Sat, 27 Jan 2018 23:14:21 +0000 (00:14 +0100)]
submission: Properly handle omission of required authentication for relay connection.
Particularly, do not forward the 530 error to the client. Instead, log the
problem and close the client connection with an internal error.
Stephan Bosch [Sat, 27 Jan 2018 23:10:11 +0000 (00:10 +0100)]
lib-smtp: server: Fix overwriting a previously submitted reply.
The submitted flag was not reset, nor was the replies_submitted counter
decreased. This caused assertion failures.
Stephan Bosch [Mon, 5 Mar 2018 20:02:49 +0000 (21:02 +0100)]
submission: Limit the set of capabilities to those that are actually supported.
Particularly, the XCLIENT capability was inappropriately enabled when the
backend MTA announced support. XCLIENT is not supported by Dovecot post-login.
Stephan Bosch [Thu, 1 Mar 2018 13:53:11 +0000 (14:53 +0100)]
lib-smtp: server: Only accept XCLIENT command when the XCLIENT capability is active.
Report "502 Unsupported command" otherwise. Before, it would complain about the
client not being trusted, which is confusing.
Stephan Bosch [Thu, 1 Mar 2018 13:52:06 +0000 (14:52 +0100)]
lib-smtp: client: Make clear that XCLIENT is not sent if the server has no support.
Stephan Bosch [Sat, 23 Dec 2017 21:51:37 +0000 (22:51 +0100)]
lib-smtp: client: Add assertion to smtp_client_command_write().
Makes sure it is not used after the command is submitted.
Stephan Bosch [Sat, 23 Dec 2017 21:49:57 +0000 (22:49 +0100)]
lib-smtp: client: Fix smtp_client_command_name_equals() to work properly after the command is submitted.
At command submission, CRLF is appended to command data. This messed up the name comparison.
This in turn caused a spurious QUIT command to be sent to the server at connection close.
Stephan Bosch [Sat, 23 Dec 2017 21:14:16 +0000 (22:14 +0100)]
lib-smtp: client: Make smtp_client_connection_commands_abort() more reliable by copying the command lists.
Copy the current lists of queued and waiting commands and reference each command before calling smtp_client_command_abort().
Aborting one command can cause other dependent commands to be aborted (in a transaction or from submission service), which could have caused trouble in this function.
Stephan Bosch [Sat, 23 Dec 2017 21:04:13 +0000 (22:04 +0100)]
lib-smtp: client: Make smtp_client_connection_commands_fail_reply() more reliable by copying the command lists.
Copy the current lists of queued and waiting commands and reference each command before calling smtp_client_command_fail_reply().
Failing one command can cause other dependent commands to be aborted (in a transaction or from submission service), which could have caused trouble in this function.
Problems would likely occur at connection disconnect.
Timo Sirainen [Thu, 1 Feb 2018 21:04:12 +0000 (23:04 +0200)]
dsync: Log a warning if copying a mail fails unexpectedly
Don't log a warning if it happens because the source message was expunged.
That's an expected failure.
Stephan Bosch [Wed, 7 Mar 2018 14:14:52 +0000 (15:14 +0100)]
submission-login: Only send HELO domain to post-login service when it is valid.
Stephan Bosch [Wed, 7 Mar 2018 14:03:42 +0000 (15:03 +0100)]
lib-smtp: server: Fix application of pre-login HELO domain when no post-login HELO is issued.
The substituted domain was not marked as valid, which caused the HELO field of
the produced received line to be set to 'unknown'.
Stephan Bosch [Sun, 4 Mar 2018 22:43:55 +0000 (23:43 +0100)]
lib-smtp: server: RCPT command: Make sure conn->state.pending_rcpt_cmds cannot decrement through zero.
Added assertion.
Stephan Bosch [Sun, 4 Mar 2018 22:42:45 +0000 (23:42 +0100)]
lib-smtp: server: MAIL command: Make sure conn->state.pending_mail_cmds cannot decrement through zero.
Added assertion.
Stephan Bosch [Sun, 4 Mar 2018 22:35:53 +0000 (23:35 +0100)]
lib-smtp: server: Fix double decrement of RCPT pending counter upon error.
The pending counter was sometimes decremented twice in specific error
conditions, leading to an assert panic in the DATA command. This was caused by
some dead code. If the MAIL command failed in a pipeline before the RCPT command,
the assert was triggered.
Panic was:
Panic: file smtp-server-cmd-data.c: line 354 (cmd_data_start): assertion failed: (conn->state.pending_mail_cmds == 0 && conn->state.pending_rcpt_cmds == 0)
Stephan Bosch [Wed, 31 Jan 2018 23:14:55 +0000 (00:14 +0100)]
lib-lda: Parse Return-Path header using RFC5322 (IMF) "path" syntax, rather than RFC5321 (SMTP) "Path" syntax.
SMTP does not allow white space, which causes all kinds of trouble when the
address is parsed from a header field.
Stephan Bosch [Wed, 31 Jan 2018 23:08:40 +0000 (00:08 +0100)]
lib-mail: message-address: Add support for parsing RFC5322 "path" syntax.
This is either a single angle-addr or just <>. This path syntax differs from the
RFC5321 "Path" syntax in that it allows whitespace, which is very important when
it is parsed from a header.
Ville Savolainen [Mon, 12 Mar 2018 10:42:46 +0000 (12:42 +0200)]
Fixup "lib-mail: message_address_write() - don't crash with NULL address"
Remove content that did not belong to
9f2fe2782224266bf2a403f430de011cf3b9da9d
Timo Sirainen [Fri, 2 Feb 2018 16:07:43 +0000 (18:07 +0200)]
lib-storage: Fix mailbox rename checking child mailbox name lengths
It was supposed to prevent allowing renames that would cause any child
mailbox name to be too long. However, the check wasn't working.
Timo Sirainen [Thu, 1 Mar 2018 15:59:34 +0000 (17:59 +0200)]
lib-storage: Fix memory leak when search accessed headers but found no mails
For example fetching headers with UID FETCH for a nonexistent UID.
Timo Sirainen [Thu, 1 Mar 2018 15:55:50 +0000 (17:55 +0200)]
lib-storage: Code cleanup - remove unnecessary temporary variable
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:43:05 +0000 (08:43 -0500)]
global: start relying on file_lock_free(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- file_lock_free(&E);
- }
+ file_lock_free(&E);
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:41:03 +0000 (08:41 -0500)]
global: start relying on mailbox_header_lookup_unref(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- mailbox_header_lookup_unref(&E);
- }
+ mailbox_header_lookup_unref(&E);
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:40:27 +0000 (08:40 -0500)]
lib-storage: mailbox_header_lookup_unref(NULL) should be a no-op
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:38:45 +0000 (08:38 -0500)]
lib-mail: start relying on mail_html2text_deinit(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- mail_html2text_deinit(&E);
- }
+ mail_html2text_deinit(&E);
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:38:16 +0000 (08:38 -0500)]
lib-mail: mail_html2text_deinit(NULL) should be a no-op
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:37:34 +0000 (10:37 -0500)]
global: start relying on ssl_iostream_destroy(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- ssl_iostream_destroy(&E);
- }
+ ssl_iostream_destroy(&E);
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:39:25 +0000 (10:39 -0500)]
ssl-iostream: ssl_iostream_destroy(NULL) should be a no-op
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:34:21 +0000 (10:34 -0500)]
global: start relying on iostream_proxy_unref(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- iostream_proxy_unref(&E);
- }
+ iostream_proxy_unref(&E);
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:36:02 +0000 (10:36 -0500)]
lib: iostream_proxy_unref(NULL) should be a no-op
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:30:51 +0000 (10:30 -0500)]
global: start relying on str_free(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- str_free(&E);
- }
+ str_free(&E);
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:32:32 +0000 (10:32 -0500)]
lib: str_free(NULL) should be a no-op
Stephan Bosch [Mon, 19 Feb 2018 12:27:39 +0000 (13:27 +0100)]
lib-http: client: Add event fields for the number of bytes sent and received for each request in the last attempt.
Stephan Bosch [Mon, 19 Feb 2018 12:24:57 +0000 (13:24 +0100)]
lib-http: response parser: Record input stream offset for the start of the last parsed response.
Stephan Bosch [Mon, 19 Feb 2018 12:20:11 +0000 (13:20 +0100)]
lib-http: message parsers: Record beginning of parsed data.
Stephan Bosch [Sun, 21 Jan 2018 14:46:49 +0000 (15:46 +0100)]
lib-http: client: Trigger special events when a request is finished, retried or redirected.
Stephan Bosch [Sun, 21 Jan 2018 15:19:41 +0000 (16:19 +0100)]
lib-http: client: Record last status code in the request object.
Stephan Bosch [Sun, 21 Jan 2018 15:08:55 +0000 (16:08 +0100)]
lib-http: client: Reset redirect counter when the request is retried.
The absence of this reset caused problems when there was a redirect limit and
the request was retried, in which case the limit is reached too soon.
Stephan Bosch [Sun, 21 Jan 2018 15:06:19 +0000 (16:06 +0100)]
lib-http: client: Add "host" and "port" fields to request event.
Stephan Bosch [Sun, 21 Jan 2018 15:00:31 +0000 (16:00 +0100)]
lib-http: client: Use the new http_url_get_port*() functions.
Stephan Bosch [Sun, 21 Jan 2018 14:54:18 +0000 (15:54 +0100)]
lib-http: url: Add functions that obtain the effective port for the URL.
When no port is set for the URL, it is set to 0. These functions substitute the
applicable default.
Stephan Bosch [Sun, 21 Jan 2018 14:50:37 +0000 (15:50 +0100)]
lib-http: Create http-common.h, which contains global definitions shared by client and server.
Currently contains only the default HTTP port definitions that used to be
private to the client.
Stephan Bosch [Fri, 23 Feb 2018 20:09:42 +0000 (21:09 +0100)]
lmtp: proxy: Do not forward 421 reply (server shutdown) from backend.
This closes the LMTP connection implicitly. Instead, translate it into a 451
4.4.0 response, just like all the other connection-related failures.
Stephan Bosch [Fri, 23 Feb 2018 19:49:48 +0000 (20:49 +0100)]
lib-smtp: client: transaction: Better document the failure handling for incomplete transactions.
Stephan Bosch [Fri, 23 Feb 2018 19:43:50 +0000 (20:43 +0100)]
lib-smtp: client: transaction: Don't call the DATA callbacks upon failure until the transaction is complete.
The transaction is not complete until smtp_client_transaction_send() is called.
Stephan Bosch [Fri, 23 Feb 2018 17:21:49 +0000 (18:21 +0100)]
lib-smtp: client: transaction: Properly advance the transaction to the DATA state once the DATA command is to be sent.
Stephan Bosch [Fri, 23 Feb 2018 17:16:57 +0000 (18:16 +0100)]
lib-smtp: client: transaction: Use the correct callback for finish timeout.
Timo Sirainen [Wed, 7 Feb 2018 14:31:12 +0000 (16:31 +0200)]
global: Set extra_groups=$default_internal_group for various services
Services with user=$default_internal_user are expected to already set the
group properly. This change is adding the group for mail processes.
Timo Sirainen [Wed, 7 Feb 2018 14:00:46 +0000 (16:00 +0200)]
lib: restrict_access_by_env() - Preserve RESTRICT_SETEXTRAGROUPS if root isn't dropped
This way service { extra_groups } is preserved for the whole duration of the
process lifetime (e.g. lmtp, doveadm)
Timo Sirainen [Wed, 7 Feb 2018 11:06:06 +0000 (13:06 +0200)]
imap-hibernate: Change imap-hibernate default socket permissions to allow default_internal_group
It would be enough to allow only imap processes access to it, but it
shouldn't really harm to allow other processes access to it also.
Timo Sirainen [Wed, 7 Feb 2018 11:05:09 +0000 (13:05 +0200)]
stats: Change stats-writer default socket permissions to allow default_internal_group
It's important that all dovecot processes can send statistics to the stats
process.
Timo Sirainen [Wed, 7 Feb 2018 11:04:03 +0000 (13:04 +0200)]
dict: Change dict and dict-async default socket permissions to allow default_internal_group
Many mail processes need to talk to dict. This makes it easier to enable
dict without having to configure permissions.
Timo Sirainen [Wed, 7 Feb 2018 11:03:23 +0000 (13:03 +0200)]
master: Add default_internal_group setting, defaulting to "dovecot"
It's expected that this is the primary group of the default_internal_user.
This group will be used to provide access to sockets that are generally
required by all Dovecot processes, but aren't safe enough to be allowed
completely open access from untrusted processes.
Stephan Bosch [Thu, 15 Feb 2018 23:44:07 +0000 (00:44 +0100)]
lib-smtp: server: Remove inappropriate assert from MAIL command.
When the MAIL command is next to reply, it is possible to have RCPT commands
that are still pending.
Stephan Bosch [Sat, 17 Feb 2018 14:02:53 +0000 (15:02 +0100)]
lib-http: client: Simplified return code handling in http_client_request_send_real().
Stephan Bosch [Sat, 17 Feb 2018 13:54:47 +0000 (14:54 +0100)]
lib-http: client: Make sure output is used only when valid in http_client_request_send_real().
Stephan Bosch [Sat, 17 Feb 2018 11:03:41 +0000 (12:03 +0100)]
lib-http: client: Uncork and flush the output stream explicitly after continuing request payload.
This allows detecting any output stream errors.
Stephan Bosch [Sat, 17 Feb 2018 14:17:06 +0000 (15:17 +0100)]
lib-http: client: Hold reference to the connection while continuing request payload.
Subsequent changes may cause the connection to be destroyed while sending.
Stephan Bosch [Sat, 17 Feb 2018 11:01:47 +0000 (12:01 +0100)]
lib-http: client: Continue sending request payload in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 14:08:44 +0000 (15:08 +0100)]
lib-http: client: Hold reference to the connection while sending the next request.
Subsequent changes may cause the connection to be destroyed while sending.
Stephan Bosch [Sat, 17 Feb 2018 10:32:37 +0000 (11:32 +0100)]
lib-http: client: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 10:10:05 +0000 (11:10 +0100)]
lib-http: client: Make http_client_connection_lost() available outside http-client-connection.c.
Stephan Bosch [Sat, 17 Feb 2018 10:08:20 +0000 (11:08 +0100)]
lib-http: client: Handle output stream errors in a separate function.
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.
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().
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.
Stephan Bosch [Sat, 17 Feb 2018 00:26:02 +0000 (01:26 +0100)]
lib-http: server: Perform output stream error handling in one place.
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.
Stephan Bosch [Sat, 17 Feb 2018 13:28:36 +0000 (14:28 +0100)]
lib-http: server: Handle output stream errors in a separate function.
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.
Stephan Bosch [Sat, 17 Feb 2018 00:46:15 +0000 (01:46 +0100)]
lib-smtp: client: Perform output stream error handling in one place.
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.
Stephan Bosch [Fri, 16 Feb 2018 22:40:29 +0000 (23:40 +0100)]
lib-smtp: client: Handle output stream errors in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 00:46:25 +0000 (01:46 +0100)]
lib-smtp: server: Perform output stream error handling in one place.
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.
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.
Stephan Bosch [Fri, 16 Feb 2018 09:13:35 +0000 (10:13 +0100)]
lib-smtp: server: STARTTLS command: Properly handle output stream flush error.
Stephan Bosch [Fri, 16 Feb 2018 09:11:01 +0000 (10:11 +0100)]
lib-smtp: server: Handle output stream errors in a separate function.
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.
Timo Sirainen [Fri, 16 Feb 2018 12:26:11 +0000 (14:26 +0200)]
lib: Add o_stream_uncork_flush() to both uncork and flush
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.
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
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)
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.
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
Sergey Kitov [Thu, 7 Dec 2017 09:34:57 +0000 (11:34 +0200)]
lib: array_idx_modifiable changed not to allocate 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.
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
Stephan Bosch [Fri, 9 Feb 2018 22:57:29 +0000 (23:57 +0100)]
lib-http: server: 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.
Stephan Bosch [Fri, 9 Feb 2018 23:07:37 +0000 (00:07 +0100)]
lib-smtp: server: Recreate connection IO after streams change.
Stephan Bosch [Sat, 10 Feb 2018 09:29:44 +0000 (10:29 +0100)]
lib-http: server: 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.
Stephan Bosch [Sat, 10 Feb 2018 09:07:28 +0000 (10:07 +0100)]
lib-smtp: server: 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.
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.
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().
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.
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.