fts-solr: Append '/' to URL path when missing in configuration
This fixes a crash when url parameter has empty path like
http://localhost:8080 instead of http://localhost:8080/ and makes using
url like http://localhost:8080/solr behave the same as
http://localhost:8080/solr/
Aki Tuomi [Mon, 30 Jul 2018 17:26:19 +0000 (20:26 +0300)]
lib-ssl-iostream: Make DH parameters optional
Since a lot of connections use elliptic curve
Diffie-Hellman these days, make it possible to
use dovecot without providing Diffie-Hellman
parameters. This reduces setup cost as the
parameters do not need to be generated, which
can be a time consuming task.
Stephan Bosch [Thu, 21 Jun 2018 20:55:50 +0000 (22:55 +0200)]
lib-smtp: server: data command: Hold a reference to the connection while handling input.
Makes sure connection object remains available while command is handled. Fixes a
valgrind error reported for accessing the connection object after it is freed,
which happens for the destroy debug message of the command (even when debugging
is not enabled).
Sergey Kitov [Mon, 19 Mar 2018 14:10:49 +0000 (16:10 +0200)]
global: Replace "if(auth_debug){i_debug(...)}" with e_debug(event, ...)
event is one of: global auth::auth_event,
auth_client_connection->event, auth_request->event,
login-common::event_auth. These event have category "auth".
Sergey Kitov [Mon, 19 Mar 2018 12:50:31 +0000 (14:50 +0200)]
global: Remove unnecessary checks for mail_debug and auth_request->debug
These checks are performed before calling auth_request_log_debug() and
push_notification_driver_debug(), while the same checks are performed
inside of these functions, and they return without doing anything.
lib-storage: Return correct root path for PATH_TYPE_ALT_MAILBOX
mailbox_list_set_get_root_path(..., MAILBOX_LIST_PATH_TYPE_ALT_MAILBOX, ...)
must return one of three values:
1. if there is no alt storage, return NULL
2. if there is alt storage and MAILBOXDIR is set,
return ${alt_dir}/${mailbox_dir_name}
3. if there is alt storage but MAILBOXDIR is not set, return ${alt_dir}
Case number 3 was broken, and it mistakenly returned ${root_dir} - in other
words, it behaved as MAILBOX_LIST_PATH_TYPE_MAILBOX.
This correction changes the behavior, but this shouldn't cause
incompatibilities since:
1. it affects only storages that support alternate storage
2. it affects only configurations that use empty MAILBOXDIR
The only storage that supports alternate storage setting is dbox but dbox
defaults to MAILBOXDIR=mailboxes. Additionally, it appears to be impossible
to override it to an empty string (setting it to an empty strings causes
dbox to override it with the default - "mailboxes"). Therefore, nobody
should be affected by this change.
Stephan Bosch [Tue, 27 Feb 2018 09:45:26 +0000 (10:45 +0100)]
lib-http: client: Fix request statistics text to properly report send attempts.
If the request was first sent in the same ioloop cycle in which the text is
generated, the text would claim it was not sent at all yet.
With this commit the text now explicitly makes the distinction between request
attempts and actual send attempts. The number of attempts is increased at each
retry, while the send attempts are increased each time the request is actually
being sent to a server.
Timo Sirainen [Tue, 24 Jul 2018 12:00:19 +0000 (15:00 +0300)]
lib-imap: Remove content_subtype==NULL checks
This can never happen after the previous commit. This also changes the
BODYSTRUCTURE output for invalid Content-Types, but since they're invalid
anyway it doesn't really matter what the output is.
Timo Sirainen [Wed, 25 Jul 2018 10:17:45 +0000 (13:17 +0300)]
lib-storage: Fix bodystructure parsing crash if header is parsed twice
The second parsing will recreate the parser_ctx, discarding the old parsed
message_part.data for the header. On the second parsing
save_bodystructure_header=FALSE so the message_part.data isn't filled for
the header. Later on the bodystructure parsing assumes the data is set,
and crashes.
This only happened with mail_attachment_detection_options=add-flags-on-save
and Sieve script that first accessed a non-cached header and then used the
"body" extension.
Fixes segfault and also:
Panic: file imap-bodystructure.c: line 116 (part_write_body_multipart): assertion failed: (part->data != NULL)
Timo Sirainen [Tue, 26 Jun 2018 19:33:33 +0000 (22:33 +0300)]
quota-clone: Fix assert-crash at deinit if quota_clone update fails
The timeout isn't removed on failure, so it crashed with:
Panic: file quota-clone-plugin.c: line 257 (quota_clone_mail_user_deinit_pre): assertion failed: (quser->to_quota_flush == NULL)
Timo Sirainen [Tue, 19 Jun 2018 12:00:02 +0000 (15:00 +0300)]
quota-clone: Move state tracking to user context
This way there's no need to do multiple flushes when e.g. multiple
mailboxes change.
The flush had to be removed from close(), because the code path recurses:
* mailbox_transaction_commit() when mail is saved
* quota_count() starts counting the quota, which opens and closes mailbox
* quota_clone_mailbox_close() attempts to flush quota, which again recurses
into quota_count(), which returns 0 for the quota value.
Timo Sirainen [Sun, 20 May 2018 15:20:47 +0000 (18:20 +0300)]
director: Make sure host's last_updown_change never shrinks.
Otherwise the ring might get into a loop where two HOST updates keep
fighting each others. This could probably happen if one update comes at
"desynced" state and other one in non-desynced state.
I'm not entirely sure if this is fixing such a loop or not, but it at least
shouldn't hurt.
Stephan Bosch [Tue, 20 Mar 2018 17:14:39 +0000 (18:14 +0100)]
lib-http: server: Properly handle corrupt payload while finishing a request.
The HTTP_REQUEST_PARSE_ERROR_BROKEN_REQUEST was not handled, causing an
assertion panic. This situation occurred when the chunked transfer encoding was
invalid.
Hannu Ylitalo [Tue, 29 May 2018 07:29:50 +0000 (10:29 +0300)]
dovecot.service: Update LimitNOFILE=65535
Current value of 8192 is too low for most production setups and it needs
to be changed every time something is deployed. Setting the default to
65535 is enough for most production environments so this would be one
task less when deploying a production platform.
Paul Howarth [Mon, 2 Jul 2018 10:52:14 +0000 (11:52 +0100)]
lib-compression: Fix assert-crash in test suite on 32bit systems
Fix compilation warnings in test-compression.c due to mismatches
between size_t and uoff_t, which then manifests in assert-crashes
running the test suite on 32bit systems.
Timo Sirainen [Fri, 6 Jul 2018 08:25:07 +0000 (11:25 +0300)]
lib-ssl-iostream: Shutdown connection cleanly whenever i/ostream is destroyed
Do this while both istream and ostream still exist. Fixes crash where
openssl_iostream_destroy() attempts to flush the shutdown, but ssl_input
is NULL and it crashes.
Timo Sirainen [Mon, 18 Jun 2018 16:13:30 +0000 (19:13 +0300)]
imapc: Don't trust mail stream to have correct CRLFs
It's not that expensive to just recalculate them. If they're not correct in
the stream, it can result in e.g. truncated emails due to wrong virtual_size
being used in body_size calculation. The wrong CRLFs can especially happen
if plugins modify the stream in istream_opened() hook.
Timo Sirainen [Sat, 16 Jun 2018 16:58:57 +0000 (19:58 +0300)]
lib-imap-client: Remove assert from imapc_client_mailbox_reconnect
It's possible for the assert to trigger if there are multiple reconnections.
imapc_connection_can_reconnect() checks a bit later whether the reconnection
can still be done.