]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-storage: mail-storage-settings: Pre-parse postmaster_address as an SMTP address.
Stephan Bosch [Tue, 6 Mar 2018 22:11:32 +0000 (23:11 +0100)] 
lib-storage: mail-storage-settings: Pre-parse postmaster_address as an SMTP address.

The pre-parsed address is not currently used anywhere, but this does check that
the postmaster address can successfully be converted to an SMTP address, which
is important for Pigeonhole.

7 years agolib-smtp: address: Add source syntax check for conversion from RFC5322 addresses.
Stephan Bosch [Tue, 6 Mar 2018 20:43:22 +0000 (21:43 +0100)] 
lib-smtp: address: Add source syntax check for conversion from RFC5322 addresses.

The message-address parser (for RFC 5322) allows UTF-8 characters in the
localpart, which is not acceptable for SMTP addresses. This change adds a check
that determines whether the source RFC5222 address can be converted into a
SMTP address.

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-master: Copy settings_parser_get_error() string so it's usable as error_r
Martti Rannanjärvi [Fri, 12 Jan 2018 13:28:52 +0000 (15:28 +0200)] 
lib-master: Copy settings_parser_get_error() string so it's usable as error_r

Also convert t_strdup()s in master_service_settings_read() into p_strdup()s
using service->set_pool.

7 years agolmtp: proxy: Use proxy_not_trusted field if returned from passdb.
Stephan Bosch [Wed, 28 Feb 2018 18:16:36 +0000 (19:16 +0100)] 
lmtp: proxy: Use proxy_not_trusted field if returned from passdb.

Before, this field was ignored. Now, if this field is set, no XCLIENT command is
ever sent to the remote proxy.

7 years agolmtp: proxy: Use ssl/starttls fields if returned from passdb.
Stephan Bosch [Wed, 28 Feb 2018 09:22:33 +0000 (10:22 +0100)] 
lmtp: proxy: Use ssl/starttls fields if returned from passdb.

Before, these fields were ignored. Now, these are used to determine whether the
proxy connection to the backend should be secured by SSL and how.

7 years agologin-common: Use client SSL certificate and key settings from lib-master.
Stephan Bosch [Wed, 28 Feb 2018 17:58:42 +0000 (18:58 +0100)] 
login-common: Use client SSL certificate and key settings from lib-master.

7 years agolib-master: Initialize key and certificate for client SSL settings.
Stephan Bosch [Wed, 28 Feb 2018 17:14:33 +0000 (18:14 +0100)] 
lib-master: Initialize key and certificate for client SSL settings.

This uses the ssl_client_cert and ssl_client_key settings.

7 years agologin-common: Remove unused ssl_require_crl setting.
Stephan Bosch [Wed, 28 Feb 2018 18:01:17 +0000 (19:01 +0100)] 
login-common: Remove unused ssl_require_crl setting.

7 years agolib-smtp: client: Add smtp_client_connection_create_ip().
Stephan Bosch [Sat, 10 Mar 2018 18:13:24 +0000 (19:13 +0100)] 
lib-smtp: client: Add smtp_client_connection_create_ip().

This allows making SMTP client connections without performing a DNS lookup. The
optional hostname parameter is used to verify the hostname in the SSL
certificate from the server, if any.

7 years agolib-smtp: client: smtp_client_connection_create(): ATTR_NULL() pointed to wrong param...
Stephan Bosch [Sat, 10 Mar 2018 18:07:26 +0000 (19:07 +0100)] 
lib-smtp: client: smtp_client_connection_create(): ATTR_NULL() pointed to wrong parameter.

7 years agolib-smtp: client: connection: Perform IP lookup in a separate function.
Stephan Bosch [Sat, 10 Mar 2018 18:05:40 +0000 (19:05 +0100)] 
lib-smtp: client: connection: Perform IP lookup in a separate function.

7 years agolib: net: Avoid comparing the content of unassigned IPs in net_ip_cmp().
Stephan Bosch [Sat, 10 Mar 2018 18:22:19 +0000 (19:22 +0100)] 
lib: net: Avoid comparing the content of unassigned IPs in net_ip_cmp().

7 years agolmtp: proxy: Use source_ip proxy field if it is returned from passdb.
Stephan Bosch [Tue, 27 Feb 2018 21:56:20 +0000 (22:56 +0100)] 
lmtp: proxy: Use source_ip proxy field if it is returned from passdb.

Before, it was ignored. Now, it is used as the source IP for the outgoing LMTP
client connection.

7 years agolib-smtp: client: Add support for connecting from an explicit source IP.
Stephan Bosch [Tue, 27 Feb 2018 20:58:17 +0000 (21:58 +0100)] 
lib-smtp: client: Add support for connecting from an explicit source IP.

7 years agolib: connection: Added support for connecting from an explicit source IP.
Stephan Bosch [Tue, 27 Feb 2018 20:56:55 +0000 (21:56 +0100)] 
lib: connection: Added support for connecting from an explicit source IP.

7 years agoimapc: Fix crash when handling empty mailboxes.
Timo Sirainen [Mon, 9 Apr 2018 13:41:19 +0000 (16:41 +0300)] 
imapc: Fix crash when handling empty mailboxes.

Broken by c05b4ac76c4c6012958f1cc37e2fccf7a7d31c33

7 years agoimapc: Fix local state if mailbox is empty after reconnection
Timo Sirainen [Sun, 25 Mar 2018 20:15:58 +0000 (23:15 +0300)] 
imapc: Fix local state if mailbox is empty after reconnection

If local indexes had more than 0 mails, but after reconnection the remote
IMAP server replied with "* 0 EXISTS", the mails in local index weren't
expunged. This could have resulted in:

Panic: file imapc-sync.c: line 328 (imapc_initial_sync_check): assertion failed: (mail_index_is_expunged(view, lseq) || seq_range_exists(&ctx->mbox->delayed_expunged_uids, luid))

7 years agoimapc: If SELECT INBOX fails with NO, treat it as temporary failure
Timo Sirainen [Wed, 11 Apr 2018 11:19:06 +0000 (14:19 +0300)] 
imapc: If SELECT INBOX fails with NO, treat it as temporary failure

If it's treated as "mailbox doesn't exist", the INBOX autocreation code
will attempt to CREATE INBOX. This is very unlikely to work.

7 years agoimapc: Fix crash when untagged FETCH reply doesn't have key-value pairs
Timo Sirainen [Tue, 27 Feb 2018 10:26:09 +0000 (12:26 +0200)] 
imapc: Fix crash when untagged FETCH reply doesn't have key-value pairs

The last key with the missing value is just silently ignored.

7 years agoimapc: Ignore fetch-msn-workarounds/no-msn-updates during initial FETCH
Timo Sirainen [Sun, 25 Mar 2018 21:01:26 +0000 (00:01 +0300)] 
imapc: Ignore fetch-msn-workarounds/no-msn-updates during initial FETCH

Otherwise duplicate UIDs aren't detected and it causes an assert-crash:

Panic: file imapc-mailbox.c: line 533 (imapc_untagged_fetch): assertion failed: (lseq == mbox->sync_next_lseq)

7 years agoistream-seekable: Record stream size in stat
Aki Tuomi [Fri, 16 Mar 2018 11:40:26 +0000 (13:40 +0200)] 
istream-seekable: Record stream size in stat

Otherwise the size is shown 0

7 years agoistream-mail: Move pos back when bailing out on error
Aki Tuomi [Fri, 16 Mar 2018 11:39:40 +0000 (13:39 +0200)] 
istream-mail: Move pos back when bailing out on error

Fixes
Panic: file istream.c: line 276 (i_stream_read): assertion failed: ((_stream->pos - _stream->skip) == (prev_pos - prev_skip))

7 years agologin-common: Indicate TLS secured transport on proxied TLS too
Aki Tuomi [Tue, 27 Mar 2018 13:12:46 +0000 (16:12 +0300)] 
login-common: Indicate TLS secured transport on proxied TLS too

7 years agolib-smtp: test-smtp-server-errors: Add test for DATA command erroneously used with...
Stephan Bosch [Thu, 15 Mar 2018 21:36:45 +0000 (22:36 +0100)] 
lib-smtp: test-smtp-server-errors: Add test for DATA command erroneously used with BODY=BINARYMIME.

7 years agolib-smtp: test-smtp-server-errors: Add tests for missing MAIL and RCPT commands befor...
Stephan Bosch [Thu, 15 Mar 2018 21:34:34 +0000 (22:34 +0100)] 
lib-smtp: test-smtp-server-errors: Add tests for missing MAIL and RCPT commands before DATA command.

7 years agolib-smtp: server: Check that BINARYMIME is not used without CHUNKING.
Stephan Bosch [Thu, 15 Mar 2018 21:36:16 +0000 (22:36 +0100)] 
lib-smtp: server: Check that BINARYMIME is not used without CHUNKING.

7 years agosubmission: Add 8BITMIME and BINARYMIME back to supported capabilities.
Stephan Bosch [Wed, 14 Mar 2018 00:54:20 +0000 (01:54 +0100)] 
submission: Add 8BITMIME and BINARYMIME back to supported capabilities.

These are supported when the backend provides support. These were erroneously
disabled earlier by 3bf0c0e211ba1e4ee9977a9dfea32e14ebc50aab.

7 years agolib-master: Fix dns_wildcard_match usage
Arkadiusz Miśkiewicz [Wed, 21 Mar 2018 09:29:26 +0000 (11:29 +0200)] 
lib-master: Fix dns_wildcard_match usage

Broken by 446c0b02a7802b676e893ccc4934fc7318d950ea

7 years agoNEWS: Update to 2.3.0.1
Aki Tuomi [Mon, 19 Mar 2018 09:34:49 +0000 (11:34 +0200)] 
NEWS: Update to 2.3.0.1

7 years agolib-dcrypt: test-stream - Ensure more is read when buffer becomes empty
Aki Tuomi [Mon, 12 Mar 2018 12:50:32 +0000 (14:50 +0200)] 
lib-dcrypt: test-stream - Ensure more is read when buffer becomes empty

7 years agolib-dcrypt: istream-decrypt - Read more if buffer is empty
Aki Tuomi [Mon, 12 Mar 2018 12:48:41 +0000 (14:48 +0200)] 
lib-dcrypt: istream-decrypt - Read more if buffer is empty

If there is no more buffered data, try to decrypt more.

- Fixes Panic: file istream.c: line 192 (i_stream_read): assertion failed: (!stream->blocking)
- Fixes infinite loop when stream is not blocking

7 years agoimapc: Update mail size also when RFC822.SIZE is smaller than fetched header size
Timo Sirainen [Thu, 15 Mar 2018 11:19:53 +0000 (13:19 +0200)] 
imapc: Update mail size also when RFC822.SIZE is smaller than fetched header size

If this isn't done, istream-mail will detect that the fetched header is
larger than RFC822.SIZE and fail with "Cached message size smaller than
expected"

7 years agoimapc: Update mail size also when istream_opened() hook is called
Timo Sirainen [Thu, 15 Mar 2018 10:20:14 +0000 (12:20 +0200)] 
imapc: Update mail size also when istream_opened() hook is called

When fetching a message body the cached message size was set. However,
if istream_opened() hook was used this wasn't done. If a client had
fetched both (RFC822.SIZE BODY.PEEK[]) and the server sent a wrong
RFC822.SIZE, that size was used for the message body size, which resulted
in "Cached message size larger than expected" errors.

7 years agosdbox: Delete .temp* files on when save/copy transaction is rolled back
Timo Sirainen [Thu, 1 Mar 2018 10:17:16 +0000 (12:17 +0200)] 
sdbox: Delete .temp* files on when save/copy transaction is rolled back

For example when copying was aborted due to user being over quota, temp
files were left behind.

7 years agonotify: Fix crash if NO_NOTIFY transaction is rolled back during commit
Timo Sirainen [Wed, 7 Mar 2018 09:24:30 +0000 (11:24 +0200)] 
notify: Fix crash if NO_NOTIFY transaction is rolled back during commit

Fixes: Panic: no notify_mail_txn found
7 years agolib-master: Correctly match when local_name has multiple names
Aki Tuomi [Tue, 6 Mar 2018 13:15:01 +0000 (15:15 +0200)] 
lib-master: Correctly match when local_name has multiple names

Reported by J. Nick Koston <nick@cpanel.net>

7 years agolib-master: Reply from config process is tabescaped
Aki Tuomi [Tue, 6 Mar 2018 08:33:27 +0000 (10:33 +0200)] 
lib-master: Reply from config process is tabescaped

Found by J. Nick Koston <nick@cpanel.net>

7 years agoconfig: tabescape local name and service
Aki Tuomi [Sat, 10 Mar 2018 17:43:27 +0000 (19:43 +0200)] 
config: tabescape local name and service

7 years agoconfig: Make local_name comparison faster
Aki Tuomi [Tue, 6 Mar 2018 08:31:51 +0000 (10:31 +0200)] 
config: Make local_name comparison faster

Based on patch by J. Nick Koston <nick@cpanel.net>

7 years agoimapc: Don't try to add mails to index if they already exist there
Timo Sirainen [Mon, 12 Mar 2018 13:06:13 +0000 (15:06 +0200)] 
imapc: Don't try to add mails to index if they already exist there

Broken by 259a4ca5943123915a019799623d2e4a4ef7fd15 when imapc was used
with (not in-memory) index files.

This caused errors like "Append with UID 200, but next_uid = 201"

7 years agolmtp: Provide hidden support for ORCPT RCPT parameter.
Stephan Bosch [Fri, 9 Mar 2018 15:09:16 +0000 (16:09 +0100)] 
lmtp: Provide hidden support for ORCPT RCPT parameter.

This is normally only available with the DSN capability, but we use it to
forward the original recipient in proxy setups.

This feature was available in the original Dovecot v2.2 LMTP, but it got lost in
the new lib-smtp implementation.

7 years agolmtp: proxy: Use per-connection SMTP client settings.
Stephan Bosch [Tue, 27 Feb 2018 22:13:33 +0000 (23:13 +0100)] 
lmtp: proxy: Use per-connection SMTP client settings.

This is needed for setting source IP in later change. The peer_trusted setting
must me moved, since this setting is overriden by per-connection settings,
rather than merged.

7 years agolib-smtp: client: Add support for forcibly enabling support for a capability.
Stephan Bosch [Fri, 9 Mar 2018 15:03:23 +0000 (16:03 +0100)] 
lib-smtp: client: Add support for forcibly enabling support for a capability.

Then it is enabled even when the server does not list it in the EHLO response.

7 years agolib-smtp: params: Make ORCPT parameter available separately if hidden capability...
Stephan Bosch [Fri, 9 Mar 2018 15:01:50 +0000 (16:01 +0100)] 
lib-smtp: params: Make ORCPT parameter available separately if hidden capability is enabled.

7 years agolib-smtp: common: Use the BIT() macro for defining the capability flags.
Stephan Bosch [Fri, 9 Mar 2018 14:47:06 +0000 (15:47 +0100)] 
lib-smtp: common: Use the BIT() macro for defining the capability flags.

7 years agolib-smtp: client: Fix rawlog input stream inconsistency by updating streams right...
Stephan Bosch [Sun, 24 Dec 2017 13:35:15 +0000 (14:35 +0100)] 
lib-smtp: client: Fix rawlog input stream inconsistency by updating streams right after initializing TLS.

Restructured the code to call a new function called smtp_client_connection_streams_changed() which performs all the necessary updates.
Before, enabling rawlog could break the TLS handshake.

7 years agoauth: Include tls=true/false in policy server request
Aki Tuomi [Fri, 1 Dec 2017 11:46:10 +0000 (13:46 +0200)] 
auth: Include tls=true/false in policy server request

7 years agoauth: Support secured=tls
Aki Tuomi [Fri, 1 Dec 2017 11:30:43 +0000 (13:30 +0200)] 
auth: Support secured=tls

7 years agologin-common: Pass SSL protocol details to auth
Aki Tuomi [Mon, 11 Dec 2017 09:16:02 +0000 (11:16 +0200)] 
login-common: Pass SSL protocol details to auth

7 years agologin-common: Indicate TLS encryption if haproxy says it was
Aki Tuomi [Fri, 1 Dec 2017 11:16:34 +0000 (13:16 +0200)] 
login-common: Indicate TLS encryption if haproxy says it was

7 years agolib-auth: Include ssl protocol details in request when present
Aki Tuomi [Mon, 11 Dec 2017 09:08:08 +0000 (11:08 +0200)] 
lib-auth: Include ssl protocol details in request when present

7 years agolib-auth: Add AUTH_REQUEST_FLAG_TLS
Aki Tuomi [Fri, 1 Dec 2017 11:16:07 +0000 (13:16 +0200)] 
lib-auth: Add AUTH_REQUEST_FLAG_TLS

Indicates whether connection is over TLS encryption.

7 years agolib-ssl-iostream: Add accessors for additional SSL protocol details
Aki Tuomi [Mon, 11 Dec 2017 09:00:41 +0000 (11:00 +0200)] 
lib-ssl-iostream: Add accessors for additional SSL protocol details

This is needed in order to send these details as fields to auth process

7 years agom4: Check for SSL_CIPHER_get_kx_nid
Aki Tuomi [Wed, 13 Dec 2017 07:52:16 +0000 (09:52 +0200)] 
m4: Check for SSL_CIPHER_get_kx_nid

7 years agoauth: Ensure crypt schemes match with samples
Aki Tuomi [Thu, 11 Jan 2018 14:10:48 +0000 (16:10 +0200)] 
auth: Ensure crypt schemes match with samples

7 years agoauth: Fix crypt scheme detection
Aki Tuomi [Thu, 11 Jan 2018 13:22:30 +0000 (15:22 +0200)] 
auth: Fix crypt scheme detection

Broken by 1ebb6094e5105ba7ef521a0177c42d3ea81243f0

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 agolib-http: client: Assert that req->client != NULL in http_client_request_send_error().
Stephan Bosch [Sun, 28 Jan 2018 20:39:07 +0000 (21:39 +0100)] 
lib-http: client: Assert that req->client != NULL in http_client_request_send_error().

Applies when blocking payload output API is being used.
Addresses a report by scan-build.

7 years agolib-http: test-http-payload: Initialize http_context in test_client_create_clients().
Stephan Bosch [Sat, 20 Jan 2018 17:48:00 +0000 (18:48 +0100)] 
lib-http: test-http-payload: Initialize http_context in test_client_create_clients().

Fixes complaint from scan-build.

7 years agolib-smtp: address: Remove useless local variable initialization in smtp_address_clone().
Stephan Bosch [Sat, 20 Jan 2018 15:48:03 +0000 (16:48 +0100)] 
lib-smtp: address: Remove useless local variable initialization in smtp_address_clone().

Fixes complaint from scan-build.

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 agolib: Remove ostream.get_used_size()
Timo Sirainen [Thu, 8 Mar 2018 12:10:42 +0000 (14:10 +0200)] 
lib: Remove ostream.get_used_size()

Removes backwards compatibility.

7 years agolib-test: test-ostream - Implement the new ostream.get_buffer_used_size() API
Timo Sirainen [Thu, 8 Mar 2018 12:08:50 +0000 (14:08 +0200)] 
lib-test: test-ostream - Implement the new ostream.get_buffer_used_size() API

It's implemented the same way as the old get_used_size(). The default
implementation for get_buffer_avail_size() also works with this.

7 years agolib: ostream-buffer - Implement the new ostream.get_buffer_used_size() API
Timo Sirainen [Thu, 8 Mar 2018 12:08:43 +0000 (14:08 +0200)] 
lib: ostream-buffer - Implement the new ostream.get_buffer_used_size() API

It's implemented the same way as the old get_used_size(). The default
implementation for get_buffer_avail_size() also works with this.

7 years agolib: ostream-file - Implement the new ostream.get_buffer_used_size() API
Timo Sirainen [Thu, 8 Mar 2018 12:07:34 +0000 (14:07 +0200)] 
lib: ostream-file - Implement the new ostream.get_buffer_used_size() API

It's implemented the same way as the old get_used_size(). The default
implementation for get_buffer_avail_size() also works with this.

7 years agolib-compression: Implement the new ostream.get_buffer_used/avail_size() APIs
Timo Sirainen [Sat, 24 Feb 2018 20:04:49 +0000 (22:04 +0200)] 
lib-compression: Implement the new ostream.get_buffer_used/avail_size() APIs

The avail_size() implementation isn't fully correct for bzlib/zlib/lzma.
Fixing it requires larger changes though.

7 years agolib-ssl-iostream: Implement the new ostream.get_buffer_used/avail_size() APIs
Timo Sirainen [Sat, 24 Feb 2018 20:04:27 +0000 (22:04 +0200)] 
lib-ssl-iostream: Implement the new ostream.get_buffer_used/avail_size() APIs

7 years agolib: ostream-multiplex - Implement the new get_buffer_used/avail_size() APIs
Timo Sirainen [Sat, 24 Feb 2018 20:04:11 +0000 (22:04 +0200)] 
lib: ostream-multiplex - Implement the new get_buffer_used/avail_size() APIs

7 years agolib: Remove ostream-escaped
Timo Sirainen [Mon, 26 Feb 2018 13:17:36 +0000 (15:17 +0200)] 
lib: Remove ostream-escaped

It can't implement o_stream_get_buffer_avail_size() correctly with its
current API. Nothing uses it currently, so easier to just remove it
entirely.

7 years agolib: Change/clarify o_stream_get_buffer_used/avail_size() APIs
Timo Sirainen [Sat, 24 Feb 2018 20:03:10 +0000 (22:03 +0200)] 
lib: Change/clarify o_stream_get_buffer_used/avail_size() APIs

ostream.get_used_size() is deprecated and replaced by get_buffer_used_size()
and get_buffer_avail_size().

7 years agoauth: db-lua - Do not assert-crash if given parameter was not auth_request
Aki Tuomi [Sat, 20 Jan 2018 13:44:56 +0000 (15:44 +0200)] 
auth: db-lua - Do not assert-crash if given parameter was not auth_request

Use luaL_error instead that will back out more gracefully.

Fixes Panic: file db-lua.c: line 279 (auth_lua_check_auth_request): assertion failed: (lua_istable(script->L, arg))

7 years agoauth: db-lua - Use luaL_error correctly
Aki Tuomi [Sat, 20 Jan 2018 18:33:01 +0000 (20:33 +0200)] 
auth: db-lua - Use luaL_error correctly

7 years agolib-auth: Require being connected before adding requests
Aki Tuomi [Thu, 8 Jun 2017 09:18:30 +0000 (12:18 +0300)] 
lib-auth: Require being connected before adding requests

7 years agolib-auth: Prevent double-disconnect
Aki Tuomi [Mon, 5 Jun 2017 09:44:06 +0000 (12:44 +0300)] 
lib-auth: Prevent double-disconnect

When disconnecting, it's possible that
disconnect gets called twice by some callback,
so protect it with a boolean.

Fixes Panic: file hash.c: line 152 (hash_table_clear): assertion failed: (table->frozen == 0)

7 years agolib-lda: Do not convert "From:" message address to STMP address, just to make a strin...
Stephan Bosch [Tue, 6 Mar 2018 21:11:34 +0000 (22:11 +0100)] 
lib-lda: Do not convert "From:" message address to STMP address, just to make a string for logging.

This leads to problems when the message address (RFC5322) has UTF-8 code points
in the local part, which is (currently) allowed for message addresses, but not
for SMTP addresses (RFC5321).

7 years agomaster: Strip '\n' from suid_dumpable read buffer before str_to_uint()
Martti Rannanjärvi [Tue, 6 Mar 2018 11:27:17 +0000 (13:27 +0200)] 
master: Strip '\n' from suid_dumpable read buffer before str_to_uint()

7 years agomaster: Improve "core not dumped" error messages with Linux
Timo Sirainen [Thu, 1 Mar 2018 16:38:43 +0000 (18:38 +0200)] 
master: Improve "core not dumped" error messages with Linux

Recommend setting /proc/fs/suid_dumpable to 2 and
/proc/sys/kernel/core_pattern to absolute path, if they already aren't.

7 years agomaster: Add explanation URL to "core dumps disabled" and "core not dumped" errors
Timo Sirainen [Thu, 1 Mar 2018 16:37:43 +0000 (18:37 +0200)] 
master: Add explanation URL to "core dumps disabled" and "core not dumped" errors

7 years agoglobal: Use unix_socket capability in connection.c
Aki Tuomi [Mon, 19 Feb 2018 17:22:42 +0000 (19:22 +0200)] 
global: Use unix_socket capability in connection.c

This is more reliably way to correctly create input stream
with unix socket capability for passing fd's around

7 years agolib: connection - only switch created iostreams
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

7 years agosubmission: Properly handle omission of required authentication for relay connection.
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.

7 years agolib-smtp: server: Fix overwriting a previously submitted reply.
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.

7 years agosubmission: Limit the set of capabilities to those that are actually supported.
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.

7 years agolib-smtp: server: Only accept XCLIENT command when the XCLIENT capability is active.
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.

7 years agolib-smtp: client: Make clear that XCLIENT is not sent if the server has no support.
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.

7 years agolib-smtp: client: Add assertion to smtp_client_command_write().
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.

7 years agolib-smtp: client: Fix smtp_client_command_name_equals() to work properly after the...
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.

7 years agolib-smtp: client: Make smtp_client_connection_commands_abort() more reliable by copyi...
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.

7 years agolib-smtp: client: Make smtp_client_connection_commands_fail_reply() more reliable...
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.

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 agosubmission-login: Only send HELO domain to post-login service when it is valid.
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.

7 years agolib-smtp: server: Fix application of pre-login HELO domain when no post-login HELO...
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'.

7 years agolib-smtp: server: RCPT command: Make sure conn->state.pending_rcpt_cmds cannot decrem...
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.

7 years agolib-smtp: server: MAIL command: Make sure conn->state.pending_mail_cmds cannot decrem...
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.

7 years agolib-smtp: server: Fix double decrement of RCPT pending counter upon error.
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)

7 years agolib-lda: Parse Return-Path header using RFC5322 (IMF) "path" syntax, rather than...
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.

7 years agolib-mail: message-address: Add support for parsing RFC5322 "path" syntax.
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.

7 years agoFixup "lib-mail: message_address_write() - don't crash with NULL address"
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

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.