]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agoimap: Fix FETCH SNIPPET
Timo Sirainen [Sat, 17 Feb 2018 22:53:12 +0000 (00:53 +0200)] 
imap: Fix FETCH SNIPPET

1) _BUFFERED flag wasn't set, which caused a missing space before the "SNIPPET".
2) It caused \Seen flag to be added to the mail

7 years agodoveadm sync/backup: Don't override BROKENCHAR if it's already set
Timo Sirainen [Fri, 16 Feb 2018 14:03:46 +0000 (16:03 +0200)] 
doveadm sync/backup: Don't override BROKENCHAR if it's already set

This allows migrating invalid mailbox names by specifying BROKENCHAR.
Previously it would always try to use \003 control character, which isn't
valid character in mailbox names so the mailbox creation would fail.

7 years agocharset-alias: Fix keyvalues iteration
Martti Rannanjärvi [Fri, 16 Feb 2018 14:59:35 +0000 (16:59 +0200)] 
charset-alias: Fix keyvalues iteration

charset-alias-plugin.c:113:27: error: comparison between pointer and zero
character constant [-Werror=pointer-compare]
  for (i = 0; keyvalues[i] != '\0'; i++) {
                           ^~
charset-alias-plugin.c:113:14: note: did you mean to dereference the pointer?
  for (i = 0; keyvalues[i] != '\0'; i++) {

7 years agocharset-alias: Cleanup whitespace
Martti Rannanjärvi [Fri, 16 Feb 2018 14:53:04 +0000 (16:53 +0200)] 
charset-alias: Cleanup whitespace

Remove \r from end of lines and remove trailing whitespace.

7 years agolib-http: client: Simplified return code handling in http_client_request_send_real().
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().

7 years agolib-http: client: Make sure output is used only when valid in http_client_request_sen...
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().

7 years agolib-http: client: Uncork and flush the output stream explicitly after continuing...
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.

7 years agolib-http: client: Hold reference to the connection while continuing request payload.
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.

7 years agolib-http: client: Continue sending request payload in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 11:01:47 +0000 (12:01 +0100)] 
lib-http: client: Continue sending request payload in a separate function.

7 years agolib-http: client: Hold reference to the connection while sending the next request.
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.

7 years agolib-http: client: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 10:32:37 +0000 (11:32 +0100)] 
lib-http: client: Perform output stream error handling in one place.

7 years agolib-http: client: Make http_client_connection_lost() available outside http-client...
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.

7 years agolib-http: client: Handle output stream errors in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 10:08:20 +0000 (11:08 +0100)] 
lib-http: client: Handle output stream errors in a separate function.

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-smtp: server: Remove inappropriate assert from MAIL command.
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.

7 years agoimap: Don't enforce sending SNIPPET reply as literal
Timo Sirainen [Fri, 16 Feb 2018 12:49:59 +0000 (14:49 +0200)] 
imap: Don't enforce sending SNIPPET reply as literal

Also change it to use "cur_str" since the reply is never very long.

7 years agoimap: Add parenthesis to FETCH SNIPPET (FUZZY text) response
Timo Sirainen [Fri, 16 Feb 2018 12:46:36 +0000 (14:46 +0200)] 
imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response

Otherwise it violates the RFC 3501 text about FETCH responses.

7 years agoimap: Don't set storage callbacks before namespaces are created
Timo Sirainen [Thu, 15 Feb 2018 16:16:15 +0000 (18:16 +0200)] 
imap: Don't set storage callbacks before namespaces are created

This fixes sending untagged OK/NO notifications from storage (e.g. lock
waits/override notifications). It was broken by
e031d9aaae59a9f79710dc1138b76b69272615a3

7 years agoimap: Add client_create_finish() to finish namespace creation.
Timo Sirainen [Thu, 15 Feb 2018 16:15:16 +0000 (18:15 +0200)] 
imap: Add client_create_finish() to finish namespace creation.

7 years agoimap: When running standalone, delay initializing namespaces until PREAUTH is sent
Timo Sirainen [Thu, 15 Feb 2018 16:13:20 +0000 (18:13 +0200)] 
imap: When running standalone, delay initializing namespaces until PREAUTH is sent

Most importantly this makes the code paths similar for standalone and
non-standalone clients, which is needed by the following commits.

7 years agolib: Fix compiler warning when arc4random_buf() is used for random_fill()
Timo Sirainen [Fri, 16 Feb 2018 12:33:33 +0000 (14:33 +0200)] 
lib: Fix compiler warning when arc4random_buf() is used for random_fill()

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 agocharset-alias-plugin
Hideo Yoshizane [Thu, 25 Jan 2018 00:36:22 +0000 (19:36 -0500)] 
charset-alias-plugin

7 years agolib-mail: message-parser: Fixed Clang 6.0 compiler warning.
Stephan Bosch [Thu, 15 Feb 2018 22:41:25 +0000 (23:41 +0100)] 
lib-mail: message-parser: Fixed Clang 6.0 compiler warning.

Warning was:

index-mail.c:1182:3: warning: arithmetic on a null pointer treated as a cast
from integer to pointer is a GNU extension [-Wnull-pointer-arithmetic]
                message_parser_parse_body(data->parser_ctx,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/lib-mail/message-parser.h:95:28: note: expanded from macro
'message_parser_parse_body'
                (void *)((char *)context + CALLBACK_TYPECHECK(callback, \
                         ~~~~~~~~~~~~~~~ ^

7 years agolib-master: Don't dup errors to service->set_pool in master_service_settings_read
Martti Rannanjärvi [Thu, 15 Feb 2018 15:50:43 +0000 (17:50 +0200)] 
lib-master: Don't dup errors to service->set_pool in master_service_settings_read

Use t_strdup() instead.

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 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 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 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 agolib: Fix usec comparison in timeout_update_next
Aki Tuomi [Tue, 13 Feb 2018 07:14:37 +0000 (09:14 +0200)] 
lib: Fix usec comparison in timeout_update_next

When tv_usec is exactly 1000000, call to kevent() will fail
because tv_sec does not get incremented.

Found by Adrian Gonzalez <adrianglz@globalpc.net>

7 years agoglobal: Flip MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT to ..._ALLOW_ROOT
Martti Rannanjärvi [Wed, 13 Dec 2017 17:05:30 +0000 (19:05 +0200)] 
global: Flip MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT to ..._ALLOW_ROOT

7 years agolib-storage: Flip disallow_root in service_drop_privileges()
Martti Rannanjärvi [Fri, 29 Sep 2017 11:16:52 +0000 (14:16 +0300)] 
lib-storage: Flip disallow_root in service_drop_privileges()

7 years agomaster: Flip disallow_root in drop_privileges()
Martti Rannanjärvi [Fri, 29 Sep 2017 10:47:22 +0000 (13:47 +0300)] 
master: Flip disallow_root in drop_privileges()

7 years agolib: Add restrict_access_flags enum to use with restrict_access[_by_env]()
Martti Rannanjärvi [Fri, 29 Sep 2017 10:40:12 +0000 (13:40 +0300)] 
lib: Add restrict_access_flags enum to use with restrict_access[_by_env]()

Swap parameter locations in the functions to make sure plugins are
updated to use the new api.

7 years agolib: Flip drop_setuid_root in restrict_access_settings
Martti Rannanjärvi [Mon, 18 Dec 2017 09:35:27 +0000 (11:35 +0200)] 
lib: Flip drop_setuid_root in restrict_access_settings

7 years agolib-program-client: Remove extra drop_setuid_root flag copy
Martti Rannanjärvi [Mon, 18 Dec 2017 10:44:14 +0000 (12:44 +0200)] 
lib-program-client: Remove extra drop_setuid_root flag copy

7 years agolib-program-client: Run local client tests with valgrind --trace-children=no.
Stephan Bosch [Fri, 2 Feb 2018 17:35:49 +0000 (18:35 +0100)] 
lib-program-client: Run local client tests with valgrind --trace-children=no.

Before, valgrind was omitted entirely.

7 years agoAdd support for running valgrind tests with --trace-children=no.
Stephan Bosch [Fri, 2 Feb 2018 17:33:49 +0000 (18:33 +0100)] 
Add support for running valgrind tests with --trace-children=no.

7 years agolib-program-client: test-program-client-local: Properly deallocate all streams for...
Stephan Bosch [Fri, 2 Feb 2018 17:37:23 +0000 (18:37 +0100)] 
lib-program-client: test-program-client-local: Properly deallocate all streams for big I/O test.

7 years agoauth: Set correct context type when bypassing reporting in auth_success
Aki Tuomi [Mon, 12 Feb 2018 10:28:37 +0000 (12:28 +0200)] 
auth: Set correct context type when bypassing reporting in auth_success

Broken in 41ff6e6a4a085786d4c15a58c7c50a28e2110c3f

7 years agoglobal: Set extra_groups=$default_internal_group for various services
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.

7 years agolib: restrict_access_by_env() - Preserve RESTRICT_SETEXTRAGROUPS if root isn't dropped
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)

7 years agoimap-hibernate: Change imap-hibernate default socket permissions to allow default_int...
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.

7 years agostats: Change stats-writer default socket permissions to allow default_internal_group
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.

7 years agodict: Change dict and dict-async default socket permissions to allow default_internal...
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.

7 years agomaster: Add default_internal_group setting, defaulting to "dovecot"
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.

7 years agoauth: Support standard auth variables in LDAP subqueries
Aki Tuomi [Thu, 8 Feb 2018 13:45:55 +0000 (15:45 +0200)] 
auth: Support standard auth variables in LDAP subqueries

7 years agoold-stats: Set process dumpable during stats gathering
Aki Tuomi [Thu, 8 Feb 2018 11:04:48 +0000 (13:04 +0200)] 
old-stats: Set process dumpable during stats gathering

/proc/self/io is not accessible otherwise

7 years agolib: Add restrict_access_get/set_dumpable
Aki Tuomi [Thu, 8 Feb 2018 11:03:37 +0000 (13:03 +0200)] 
lib: Add restrict_access_get/set_dumpable

7 years agolib: Clarify restrict_access_allow_coredumps
Aki Tuomi [Thu, 8 Feb 2018 11:01:50 +0000 (13:01 +0200)] 
lib: Clarify restrict_access_allow_coredumps

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 agolib-http: client: Fix using non-context SSL settings
Timo Sirainen [Thu, 8 Feb 2018 11:27:25 +0000 (13:27 +0200)] 
lib-http: client: Fix using non-context SSL settings

The SSL settings were used for the SSL context, but they weren't used for
individual SSL streams. This broke stream-only settings, like
allow_invalid_cert=TRUE.

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-ssl-iostream: Assert-crash if input stream has IO already set
Timo Sirainen [Thu, 8 Feb 2018 00:26:23 +0000 (02:26 +0200)] 
lib-ssl-iostream: Assert-crash if input stream has IO already set

7 years agolib: Add i_stream_get_root_io() and use it to deduplicate code
Timo Sirainen [Thu, 8 Feb 2018 00:22:18 +0000 (02:22 +0200)] 
lib: Add i_stream_get_root_io() and use it to deduplicate code

7 years agolib-smtp: Recreate connection IO after streams change
Timo Sirainen [Thu, 8 Feb 2018 08:53:50 +0000 (10:53 +0200)] 
lib-smtp: Recreate connection IO after streams change

This fixes hangs after STARTTLS.

Originally by Stephan Bosch

7 years agolib: Add connection_streams_changed()
Timo Sirainen [Thu, 8 Feb 2018 08:52:57 +0000 (10:52 +0200)] 
lib: Add connection_streams_changed()

Originally by Stephan Bosch

7 years agodoveadm: client: Set IO only after enabling SSL
Timo Sirainen [Thu, 8 Feb 2018 00:38:23 +0000 (02:38 +0200)] 
doveadm: client: Set IO only after enabling SSL

io_add_istream() needs to be used with the SSL istream, otherwise it can
cause hangs.

7 years agolib-imap-client: Fix IO after enabling SSL
Timo Sirainen [Thu, 8 Feb 2018 00:28:54 +0000 (02:28 +0200)] 
lib-imap-client: Fix IO after enabling SSL

io_add_istream() needs to be used with the SSL istream, otherwise it can
cause hangs.

7 years agodsync: Log a warning if copying a mail fails unexpectedly
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.

7 years agolib-storage: Lock mailbox_list for mailbox create/delete/rename
Timo Sirainen [Tue, 9 Jan 2018 20:37:25 +0000 (15:37 -0500)] 
lib-storage: Lock mailbox_list for mailbox create/delete/rename

This is only required for mailbox creation to fix a race condition with
LAYOUT=index: If INBOX doesn't exist it will rescan the mailboxes to
find out if there are any missing ones. If INBOX creation isn't locked,
it's possible that the first process hasn't finished creating INBOX
before the second process find it and attempts to open it.

The delete and rename locking are probably useful to guard against race
conditions when clients intentionally issues create/delete/rename commands
concurrently.

7 years agolib-storage: Add mailbox_list_[un]lock()
Timo Sirainen [Tue, 9 Jan 2018 20:36:58 +0000 (15:36 -0500)] 
lib-storage: Add mailbox_list_[un]lock()

7 years agolib-storage: mailbox_delete() - Fix cleanup in error handling
Timo Sirainen [Tue, 9 Jan 2018 20:35:13 +0000 (15:35 -0500)] 
lib-storage: mailbox_delete() - Fix cleanup in error handling

If removing index deletion mark failed, box->deleting wasn't set to FALSE
and the mailbox was left opened.

7 years agolib-storage: mailbox_rename() - Use source storage for errors
Timo Sirainen [Tue, 9 Jan 2018 20:33:26 +0000 (15:33 -0500)] 
lib-storage: mailbox_rename() - Use source storage for errors

It was documented to use source storage for errors, but some of the errors
were set to destination storage.

7 years agolib-storage: Fix mailbox rename checking child mailbox name lengths
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.