]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-smtp: address: Rename 'poo' to 'pool' in declaration of smtp_address_detail_parse().
Stephan Bosch [Sat, 13 Jan 2018 10:59:54 +0000 (11:59 +0100)] 
lib-smtp: address: Rename 'poo' to 'pool' in declaration of smtp_address_detail_parse().

7 years agolmtp: local: Fix segfault occurring when quota is exceeded.
Stephan Bosch [Wed, 17 Jan 2018 20:26:44 +0000 (21:26 +0100)] 
lmtp: local: Fix segfault occurring when quota is exceeded.

7 years agoAlways link krb5 when gssapi is requested
Martin Cyr [Sat, 13 Jan 2018 21:15:47 +0000 (16:15 -0500)] 
Always link krb5 when gssapi is requested

Since krb5_free_context is defined in libkrb5, not libgssapi, it must be
linked, even when gssapi is found.
krb5-config --libs gssapi alone will not provide -lkrb5.
Also, krb5-config --version ANYTHING will always return 0 (at least with
Heimdal).

7 years agolib: Use uintptr_t in PTR_OFFSET and POINTER_CAST
Aki Tuomi [Sun, 14 Jan 2018 17:21:36 +0000 (19:21 +0200)] 
lib: Use uintptr_t in PTR_OFFSET and POINTER_CAST

Use uintptr_t instead of pointers.

Fixes clang 6.0 warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension

7 years agolib-storage: Set keyword based on attachment presence when saving
Aki Tuomi [Sat, 11 Nov 2017 08:07:42 +0000 (10:07 +0200)] 
lib-storage: Set keyword based on attachment presence when saving

If attachment is detected, use $HasAttachment, if not
use $HasNoAttachment

7 years agolib-storage: Add attachment detection settings
Aki Tuomi [Mon, 20 Nov 2017 08:09:23 +0000 (10:09 +0200)] 
lib-storage: Add attachment detection settings

7 years agolib-mail: Add message_part_has_attachment
Aki Tuomi [Fri, 10 Nov 2017 12:32:44 +0000 (14:32 +0200)] 
lib-mail: Add message_part_has_attachment

7 years agoimapc: Fix imap_features=no-msn-updates to not fail on SELECT
Timo Sirainen [Tue, 16 Jan 2018 16:17:00 +0000 (18:17 +0200)] 
imapc: Fix imap_features=no-msn-updates to not fail on SELECT

The initial EXISTS reply shouldn't be ignored, only the following ones.

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 agolib-http: queue: Update the correct timout while dropping a request from the delay...
Stephan Bosch [Fri, 12 Jan 2018 20:03:41 +0000 (21:03 +0100)] 
lib-http: queue: Update the correct timout while dropping a request from the delay queue.

The absolute request timeout rather than the delay timeout was updated for the
removal of the request from the delay queue.

7 years ago*-login: Fix clients linked list corruption with SSL connections
Timo Sirainen [Thu, 11 Jan 2018 18:38:14 +0000 (13:38 -0500)] 
*-login: Fix clients linked list corruption with SSL connections

This could have resulted in infinite loops or some of the clients being
skipped for some operations.

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 agoimap-login: Simplify ID handling code
Timo Sirainen [Tue, 9 Jan 2018 21:01:42 +0000 (16:01 -0500)] 
imap-login: Simplify ID handling code

7 years agoimap-login: Rewrite ID parameter handling to be less fragile
Timo Sirainen [Wed, 14 Jun 2017 07:46:53 +0000 (10:46 +0300)] 
imap-login: Rewrite ID parameter handling to be less fragile

There's no longer two places that need to be kept in sync.

7 years agoimap-login: Move ID command handling to its own file.
Timo Sirainen [Wed, 14 Jun 2017 07:34:57 +0000 (10:34 +0300)] 
imap-login: Move ID command handling to its own file.

7 years agolib-mail: mail-html2text - Validate UCS4 codepoint
Aki Tuomi [Fri, 5 Jan 2018 07:51:00 +0000 (09:51 +0200)] 
lib-mail: mail-html2text - Validate UCS4 codepoint

Fixes: Panic: file unichar.c: line 160 (uni_ucs4_to_utf8_c): assertion failed: (uni_is_valid_ucs4(chr))
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 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: Add NOREPLICATE error when "noreplicate" user flag is used
Aki Tuomi [Wed, 27 Dec 2017 12:08:13 +0000 (14:08 +0200)] 
doveadm: Add NOREPLICATE error when "noreplicate" user flag is used

It will be only understood if -U flag has been used

7 years agoreplicator: Remove user from replication if NOREPLICATE error is returned
Aki Tuomi [Wed, 27 Dec 2017 12:07:30 +0000 (14:07 +0200)] 
replicator: Remove user from replication if NOREPLICATE error is returned

7 years agolib/lib-test: restore DOVECOT_SRAND feature in DEBUG builds
Phil Carmody [Mon, 11 Dec 2017 12:03:13 +0000 (14:03 +0200)] 
lib/lib-test: restore DOVECOT_SRAND feature in DEBUG builds

Add a deterministic PRNG, an ability to force its use, and an
ability to re-use the same sequence later.

Since proper random numbers have been forced into use, making
reproducable tests isn't quite as easy as it used to be, it's 3 steps
rather than 2. When seeing an intermittent test failure:
 - rerun the tests with environmental variable DOVECOT_SRAND=kiss
 - upon seeing a new failure case, note the seed logged at the failure
 - debug using DOVECOT_SRAND=<that number>

In non-DEBUG builds, there's no trace of this code, and the
randomisation that is an inherent part of many tests remains
non-reproduceable.

Works with all of the RNG preferences, getrandom/urandom/arc4.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agoauth: client protocol: Recognize empty initial response field as an absent initial...
Stephan Bosch [Wed, 3 Jan 2018 18:46:58 +0000 (19:46 +0100)] 
auth: client protocol: Recognize empty initial response field as an absent initial response for older clients.

Particularly, Exim sends an empty initial response field in the AUTH request for
an authentication command that has no initial response. Originally, Dovecot
allowed this, but this was recently changed so that the EXTERNAL SASL mechanism
works properly from ManageSieve. This commit makes it allowed again for older
authentication clients to send an empty initial response field for an
authentication command that has no initial response part. Sending '=' for an
empty initial response is still allowed in general.

7 years agoauth: client protocol: Record minor version for authentication client connection.
Stephan Bosch [Wed, 3 Jan 2018 18:26:33 +0000 (19:26 +0100)] 
auth: client protocol: Record minor version for authentication client connection.

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 agolib/printf-format-fix: fix rejection of "%.0f" as a valid string
Phil Carmody [Wed, 3 Jan 2018 13:54:15 +0000 (15:54 +0200)] 
lib/printf-format-fix: fix rejection of "%.0f" as a valid string

Sometimes you want to calculate in floats, but don't want the decimals
printed.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolog: Prevent LOG_TYPE_COUNT in client_log_ctx
Aki Tuomi [Tue, 2 Jan 2018 07:49:40 +0000 (09:49 +0200)] 
log: Prevent LOG_TYPE_COUNT in client_log_ctx

Makes static analyzers happy

7 years agodsync: Set brain->failed to TRUE when UIDVALIDITY changes
Aki Tuomi [Tue, 2 Jan 2018 11:57:45 +0000 (13:57 +0200)] 
dsync: Set brain->failed to TRUE when UIDVALIDITY changes

This happens if UIDVALIDITY changes during stateful sync.

Fixes Panic: doveadm: file dsync-brain-mailbox.c: line 377 (dsync_brain_sync_mailbox_deinit): assertion failed: (brain->failed)

7 years agoUpdated copyright notices to include the year 2018.
Stephan Bosch [Mon, 1 Jan 2018 19:04:02 +0000 (20:04 +0100)] 
Updated copyright notices to include the year 2018.

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 agoglobal: Rename timing API to stats-dist API
Timo Sirainen [Mon, 18 Dec 2017 13:21:44 +0000 (15:21 +0200)] 
global: Rename timing API to stats-dist API

The API wasn't really about timings specifically, but about statistics in
general. The new stats service was already using it for tracking statistics
for non-timing related numbers.

7 years agosubmission: EHLO command: Remove obsolete pending_ehlo handling.
Stephan Bosch [Wed, 27 Dec 2017 13:38:41 +0000 (14:38 +0100)] 
submission: EHLO command: Remove obsolete pending_ehlo handling.

This was used to wait with sending an EHLO reply until the proxy connection to the relay server completes.
The previous commit made this functionality obsolete, since command input handling is blocked entirely until the proxy connection is ready.

7 years agosubmission: Block server input handling until proxy connection to relay server completes.
Stephan Bosch [Wed, 27 Dec 2017 13:36:10 +0000 (14:36 +0100)] 
submission: Block server input handling until proxy connection to relay server completes.

This makes sure we are aware of the full extent of the backend server's capabilities, before we start handling commands.
Before, only EHLO commands were blocked this way, but this did not account for MAIL/RCPT parameters, which are equally dependent.
Fixes problems with clients that send no EHLO after AUTH, like Thunderbird.

7 years agolib-smtp: server: Add APIs for halting and resuming connection command handling.
Stephan Bosch [Wed, 27 Dec 2017 16:02:12 +0000 (17:02 +0100)] 
lib-smtp: server: Add APIs for halting and resuming connection command handling.

Also adds function to start the connection in a pending (halted) state. This way the greeting can already be sent (over SSL if needed), while deferring command handling until some external activity is completed.

7 years agolib-smtp: server: Prevent calling smtp_server_connection_login() after smtp_server_co...
Stephan Bosch [Wed, 27 Dec 2017 15:31:12 +0000 (16:31 +0100)] 
lib-smtp: server: Prevent calling smtp_server_connection_login() after smtp_server_connection_start().

Added assertion.

7 years agolib-smtp: server: Protect smpt_server_connection_start() from being called multiple...
Stephan Bosch [Wed, 27 Dec 2017 15:22:22 +0000 (16:22 +0100)] 
lib-smtp: server: Protect smpt_server_connection_start() from being called multiple times.

7 years agolib-smtp: server: Delay handling initial input (from login service) until after smtp_...
Stephan Bosch [Wed, 27 Dec 2017 15:18:16 +0000 (16:18 +0100)] 
lib-smtp: server: Delay handling initial input (from login service) until after smtp_server_connection_start().

Instead, it is now handled in normal io callback.

7 years agolib-smtp: server: Remove implicit smtp_server_connection_start() from smtp_server_con...
Stephan Bosch [Wed, 27 Dec 2017 14:56:03 +0000 (15:56 +0100)] 
lib-smtp: server: Remove implicit smtp_server_connection_start() from smtp_server_connection_login().

7 years agolib-smtp: server: Moved smtp_server_connection_start() after smtp_server_connection_l...
Stephan Bosch [Wed, 27 Dec 2017 14:59:23 +0000 (15:59 +0100)] 
lib-smtp: server: Moved smtp_server_connection_start() after smtp_server_connection_login().

Also fixes an indent problem in the header comment implicitly.

7 years agolib-smtp: server: Moved ssl_start argument from smtp_server_connection_start() to...
Stephan Bosch [Wed, 27 Dec 2017 14:52:13 +0000 (15:52 +0100)] 
lib-smtp: server: Moved ssl_start argument from smtp_server_connection_start() to smtp_server_connection_create().

This frees smtp_server_connection_start() for general use.

7 years agodsync: Add per-mailbox sync lock that is always used.
Timo Sirainen [Thu, 28 Dec 2017 12:10:23 +0000 (14:10 +0200)] 
dsync: Add per-mailbox sync lock that is always used.

Both importing and exporting gets the lock before they even sync the
mailbox. The lock is kept until the import/export finishes. This guarantees
that no matter how dsync is run, two dsyncs can't be working on the same
mailbox at the same time.

This lock is in addition to the optional per-user lock enabled by the -l
parameter. If the -l parameter is used, the same lock timeout is used for
the per-mailbox lock. Otherwise 30s timeout is used.

This should help to avoid email duplication when replication is enabled for
public namespaces, and maybe in some other rare situations as well.

7 years agolib: Make file_lock_free(NULL) no-op
Timo Sirainen [Thu, 28 Dec 2017 17:40:29 +0000 (19:40 +0200)] 
lib: Make file_lock_free(NULL) no-op

7 years agodoveconf: add hostname to output
Jarkko Mourujärvi [Thu, 28 Dec 2017 11:53:14 +0000 (13:53 +0200)] 
doveconf: add hostname to output

7 years agoauth: Use rip instead of real_rip in policy server attributes
Aki Tuomi [Fri, 1 Dec 2017 11:49:31 +0000 (13:49 +0200)] 
auth: Use rip instead of real_rip in policy server attributes

real_rip contains proxy IP, not client IP

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 agolib-http: test-http-client - Make DNS client optional
Aki Tuomi [Thu, 28 Dec 2017 09:30:00 +0000 (11:30 +0200)] 
lib-http: test-http-client - Make DNS client optional

Only use DNS client if present. Allows running the
test-http-client standalone.

7 years agolib-http: Only depend on iostream openssl lib if building with openssl
Aki Tuomi [Thu, 28 Dec 2017 08:47:28 +0000 (10:47 +0200)] 
lib-http: Only depend on iostream openssl lib if building with openssl

Fixes build without openssl

7 years agodsync: Add debug logging for .dovecot-sync.lock locking/unlocking
Timo Sirainen [Thu, 28 Dec 2017 08:27:27 +0000 (10:27 +0200)] 
dsync: Add debug logging for .dovecot-sync.lock locking/unlocking

7 years agosubmission-login: Fail CLIENT_AUTH_RESULT_MECH_SSL_REQUIRED authentication result...
Stephan Bosch [Sat, 23 Dec 2017 22:49:02 +0000 (23:49 +0100)] 
submission-login: Fail CLIENT_AUTH_RESULT_MECH_SSL_REQUIRED authentication result with 523 5.7.10 error.

Defined in RFC5248, Section 2.4.

7 years agosubmission: BURL command: Return more appropriate 554 5.7.14 error when BURL/URLAUTH...
Stephan Bosch [Wed, 27 Dec 2017 14:18:14 +0000 (15:18 +0100)] 
submission: BURL command: Return more appropriate 554 5.7.14 error when BURL/URLAUTH is not configured.

Defined in RFC5248, Section 2.4.

7 years agodovecot-config: Update lib-stats directory to lib-old-stats
Timo Sirainen [Wed, 27 Dec 2017 10:05:50 +0000 (12:05 +0200)] 
dovecot-config: Update lib-stats directory to lib-old-stats

7 years agolib-smtp: server: Fix assertion failure occurring for a second failed BDAT/BURL command.
Stephan Bosch [Mon, 25 Dec 2017 23:38:58 +0000 (00:38 +0100)] 
lib-smtp: server: Fix assertion failure occurring for a second failed BDAT/BURL command.

Assertion was:

Panic: file smtp-server-cmd-data.c: line 420 (smtp_server_connection_data_chunk_init): assertion failed: (data_cmd->chunk_first)

7 years agolib/timing - helper for arbitrary percentiles
Phil Carmody [Tue, 12 Dec 2017 13:21:17 +0000 (15:21 +0200)] 
lib/timing - helper for arbitrary percentiles

Replace fixed 95th %-ile helper with request for arbitrary
percentiles, or even arbitrary fractions of the range.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib/data-stack - in panic scenarios, use the panic memory buffer
Phil Carmody [Thu, 14 Dec 2017 22:44:51 +0000 (00:44 +0200)] 
lib/data-stack  - in panic scenarios, use the panic memory buffer

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib/datastack - remove useless thing
Phil Carmody [Thu, 14 Dec 2017 22:35:39 +0000 (00:35 +0200)] 
lib/datastack - remove useless thing

It was useless.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agoimapc: Add imapc_features=no-msn-updates
Timo Sirainen [Mon, 25 Dec 2017 09:10:19 +0000 (11:10 +0200)] 
imapc: Add imapc_features=no-msn-updates

This is a stricter version of fetch-msn-workarounds. The MSNs aren't trusted
at all. This means any new untagged EXISTS and EXPUNGE replies are ignored,
as well as untagged FETCH replies that don't include UID.

A potential downside with this feature is that UID FETCH/STORE commands
sent to expunged messages will likely fail without the IMAP client being
notified of the EXPUNGEs. New mails are also not noticed, so this should
be used only when it's known that the clients don't keep the connection
open for long.

7 years agolib-storage: mail_storage_set_index_error() - handle NULL index error
Timo Sirainen [Mon, 25 Dec 2017 16:24:35 +0000 (18:24 +0200)] 
lib-storage: mail_storage_set_index_error() - handle NULL index error

This avoids assert-crashing later on in mail*_get_last_internal_error().

This could potentially be an assert instead of setting it as "BUG", but
it looks like there are various code paths in lib-index that return -1
without setting an error. (That's to avoid duplicate error logging,
although it could now be fixed with mail_index_set_error_nolog().)

7 years agolib-storage: Set index error on transaction commit() callback
Timo Sirainen [Mon, 25 Dec 2017 16:18:14 +0000 (18:18 +0200)] 
lib-storage: Set index error on transaction commit() callback

The commit callback is setting errors to storage. However, it's being
called from mail_index_transaction_commit() whose callers are expecting
the error to be in index. If that index error was attempted to be used,
it could have been wrong or NULL. Fix this by setting the same storage
error also to the index.

7 years agolib-index: Add mail_index_set_error_nolog()
Timo Sirainen [Mon, 25 Dec 2017 16:17:57 +0000 (18:17 +0200)] 
lib-index: Add mail_index_set_error_nolog()

7 years agosubmission: Restructure handling of QUIT command.
Stephan Bosch [Sun, 24 Dec 2017 14:12:36 +0000 (15:12 +0100)] 
submission: Restructure handling of QUIT command.

- Avoid explicitly proxying QUIT command when the proxy connection is not ready: in that case the SMTP client connection will just send QUIT if appropriate, without waiting for reply.
- Add timeout for proxied QUIT command, so that there are no problems when the relay server hangs after QUIT (addresses FIXME).

7 years agosubmission: Dropped unused field from struct client.
Stephan Bosch [Sun, 24 Dec 2017 13:52:07 +0000 (14:52 +0100)] 
submission: Dropped unused field from struct client.

7 years agosubmission-login: Fix pipelining of commands beyond AUTH.
Stephan Bosch [Sun, 24 Dec 2017 11:17:48 +0000 (12:17 +0100)] 
submission-login: Fix pipelining of commands beyond AUTH.

The master_data_prefix was initialized wrong; it omitted the expected '\0' byte after the helo field.

7 years agosubmission: Initialize proxy connection before starting the SMTP server connection.
Stephan Bosch [Sun, 24 Dec 2017 11:15:29 +0000 (12:15 +0100)] 
submission: Initialize proxy connection before starting the SMTP server connection.

The smtp_server_connection_login() function gets pre-login connection data from login service, which can contain commands.
The execution of commands expects the proxy connection object to be initialized.

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 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 agosubmission-login: Fixed handling of ssl=required for trusted connections.
Stephan Bosch [Sat, 23 Dec 2017 18:40:09 +0000 (19:40 +0100)] 
submission-login: Fixed handling of ssl=required for trusted connections.

Normally, SSL is not required for trusted connections (e.g. localhost), but submission-login did not follow this standard.

7 years agodoveadm dump: Add "multiplex" dump type
Timo Sirainen [Fri, 22 Dec 2017 13:12:30 +0000 (15:12 +0200)] 
doveadm dump: Add "multiplex" dump type

This allows dumping all channels from istream-multiplex stream.

7 years agodoveadm dump: Allow doveadm_cmd_dump.test() to be NULL
Timo Sirainen [Fri, 22 Dec 2017 13:11:45 +0000 (15:11 +0200)] 
doveadm dump: Allow doveadm_cmd_dump.test() to be NULL

This means that there's no auto-detection for the dump type.

7 years agolib: istream-multiplex - Return error if the last packet wasn't fully read
Timo Sirainen [Fri, 22 Dec 2017 13:10:00 +0000 (15:10 +0200)] 
lib: istream-multiplex - Return error if the last packet wasn't fully read

7 years agodoveadm: Fix potential crash or reading garbage from doveadm-server
Timo Sirainen [Fri, 22 Dec 2017 13:07:28 +0000 (15:07 +0200)] 
doveadm: Fix potential crash or reading garbage from doveadm-server

The connection's input buffer may have been reallocated or otherwise moved
while checking for log input.

7 years agodoveadm: Don't connect to stats-writer for the "quick init" commands
Timo Sirainen [Fri, 22 Dec 2017 11:36:32 +0000 (13:36 +0200)] 
doveadm: Don't connect to stats-writer for the "quick init" commands

7 years agolib-master: Add master_service_init_stats_client()
Timo Sirainen [Fri, 22 Dec 2017 11:20:41 +0000 (13:20 +0200)] 
lib-master: Add master_service_init_stats_client()

This allows initializing the stats client after master_service_init() if
necessary.

7 years agolib-master: Hide connect(stats-writer) errors when running via CLI
Timo Sirainen [Fri, 22 Dec 2017 11:27:48 +0000 (13:27 +0200)] 
lib-master: Hide connect(stats-writer) errors when running via CLI

Only hide errors that occur if the stats process isn't running, i.e. when
socket isn't found or there's no listener. This way e.g. permission errors
are still logged, which points to a wrong configuration.

7 years agoauth: Fix password and scheme handling in Lua db
Aki Tuomi [Fri, 22 Dec 2017 11:34:45 +0000 (13:34 +0200)] 
auth: Fix password and scheme handling in Lua db

This was only partially fixed in c86575ac9776d0995355d03719c82e7ceac802e6

7 years agoimap-old-stats plugin: Finish renaming the plugin
Timo Sirainen [Fri, 22 Dec 2017 07:42:50 +0000 (09:42 +0200)] 
imap-old-stats plugin: Finish renaming the plugin

The init functions and dependency were named wrong, so it didn't work.

7 years agom4: Fix detecting libsodium to use LIBS instead of LDFLAGS
Timo Sirainen [Fri, 22 Dec 2017 07:37:53 +0000 (09:37 +0200)] 
m4: Fix detecting libsodium to use LIBS instead of LDFLAGS

Patch by Eray Aslan

7 years agom4: Avoid _FORTIFY_SOURCE redefinition warnings
Timo Sirainen [Fri, 22 Dec 2017 07:36:48 +0000 (09:36 +0200)] 
m4: Avoid _FORTIFY_SOURCE redefinition warnings

Some source based distros like Gentoo already enable -D_FORTIFY_SOURCE=2
by default resulting in the following warnings during build:

<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition

Patch by Eray Aslan

7 years agoexample-config: Fix postmaster_address comment
Timo Sirainen [Fri, 22 Dec 2017 07:59:27 +0000 (09:59 +0200)] 
example-config: Fix postmaster_address comment

The default value was wrong.

7 years agodoveadm-server: Fix potential hangs with SSL connections
Timo Sirainen [Fri, 22 Dec 2017 09:25:06 +0000 (11:25 +0200)] 
doveadm-server: Fix potential hangs with SSL connections

7 years agoauth: Don't include LIBSODIUM_LIBS in dependencies
Timo Sirainen [Mon, 18 Dec 2017 19:58:16 +0000 (21:58 +0200)] 
auth: Don't include LIBSODIUM_LIBS in dependencies

Put it into AUTH_LIBS among other libraries that are used by auth.

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