]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agodict-client: Server can now send command replies in any order.
Timo Sirainen [Mon, 21 Nov 2016 17:05:49 +0000 (19:05 +0200)] 
dict-client: Server can now send command replies in any order.

This way one slow lookup doesn't block all the other ones.

This change keeps backwards compatibility in the dict protocol for both
client and server.

8 years agodict: Make sure iterate doesn't add to ostream when it's already full.
Timo Sirainen [Mon, 21 Nov 2016 17:04:26 +0000 (19:04 +0200)] 
dict: Make sure iterate doesn't add to ostream when it's already full.

8 years agodict: Moved iterate's corking to more correct location.
Timo Sirainen [Mon, 21 Nov 2016 16:52:25 +0000 (18:52 +0200)] 
dict: Moved iterate's corking to more correct location.

Commands' input handling already corks ostream in connection.c.

8 years agodict-client: Include reconnection-status in slow dict lookup messages.
Timo Sirainen [Mon, 21 Nov 2016 16:46:48 +0000 (18:46 +0200)] 
dict-client: Include reconnection-status in slow dict lookup messages.

8 years agodict-client: Add warn_slow_msecs setting
Timo Sirainen [Mon, 21 Nov 2016 14:55:45 +0000 (16:55 +0200)] 
dict-client: Add warn_slow_msecs setting

This allows configuring the default 5 seconds "slow dict lookup" warning.

8 years agodict-client: Add time spent in dict-server to "slow dict lookup" messages.
Timo Sirainen [Mon, 21 Nov 2016 14:45:55 +0000 (16:45 +0200)] 
dict-client: Add time spent in dict-server to "slow dict lookup" messages.

This way you can see if the slowness was due to some communication problem
between dict-client/server or internally in dict server.

This change keeps backwards compatibility in the dict protocol for both
client and server.

8 years agodict-client: Code cleanup - handle tab-unescaping before callbacks.
Timo Sirainen [Mon, 21 Nov 2016 14:44:38 +0000 (16:44 +0200)] 
dict-client: Code cleanup - handle tab-unescaping before callbacks.

8 years agolib-index: Revert log flooding prevention / 3c014db6f
Timo Sirainen [Mon, 21 Nov 2016 11:29:12 +0000 (13:29 +0200)] 
lib-index: Revert log flooding prevention / 3c014db6f

This was intended only for mmap() errors.

8 years agofts: Fixed potential crash when indexing mails.
Timo Sirainen [Sat, 19 Nov 2016 02:04:02 +0000 (04:04 +0200)] 
fts: Fixed potential crash when indexing mails.

Normally it seems like compilers had built code that had added a NULL
after the array, but there was no guarantee for that.

8 years agoimap: Fix recent flags importing when un-hibernating
Timo Sirainen [Fri, 18 Nov 2016 14:03:00 +0000 (16:03 +0200)] 
imap: Fix recent flags importing when un-hibernating

The initial RECENT counter that was sent didn't include pre-hibernation
\Recent flags.

\Recent flags were also added for mails that were already expunged, which
could have caused recent counter to be wrong later on, and possibly
assert-crash with:

Panic: file index-status.c: line 130 (index_storage_get_open_status): assertion failed: (status_r->recent <= status_r->messages)

8 years agolib-index: Improve errors - return reason in mail_transaction_log_refresh()
Timo Sirainen [Fri, 18 Nov 2016 14:58:00 +0000 (16:58 +0200)] 
lib-index: Improve errors - return reason in mail_transaction_log_refresh()

8 years agolib-index: Improve errors - return reason in mail_transaction_log_file_open()
Timo Sirainen [Fri, 18 Nov 2016 14:52:31 +0000 (16:52 +0200)] 
lib-index: Improve errors - return reason in mail_transaction_log_file_open()

8 years agolib-index: Add more information to "Missing middle file" error.
Timo Sirainen [Fri, 18 Nov 2016 14:41:18 +0000 (16:41 +0200)] 
lib-index: Add more information to "Missing middle file" error.

8 years agolib-index: mail_transaction_log_find_file() - remove wrong optimization.
Timo Sirainen [Fri, 18 Nov 2016 14:27:33 +0000 (16:27 +0200)] 
lib-index: mail_transaction_log_find_file() - remove wrong optimization.

When opening the index, it's possible that:

process A: .log is opened with seq=1
process B: Rotates the .log and writes a new dovecot.index with
  log_file_seq=2
process A: dovecot.index is opened. mail_transaction_log_view_set() now
  wants to file log_file_seq=2 with mail_transaction_log_find_file(), but
  because open_count==0, the .log isn't refreshed.

8 years agolib-index: Compiler warning fix
Timo Sirainen [Fri, 18 Nov 2016 14:15:59 +0000 (16:15 +0200)] 
lib-index: Compiler warning fix

8 years agolib-index: If mmap() fails, include the attempted size in the error.
Timo Sirainen [Fri, 18 Nov 2016 13:46:39 +0000 (15:46 +0200)] 
lib-index: If mmap() fails, include the attempted size in the error.

8 years agolib-storage: Fix checking stub_seq failure in mailbox_save_set_uid()
Timo Sirainen [Fri, 18 Nov 2016 13:39:45 +0000 (15:39 +0200)] 
lib-storage: Fix checking stub_seq failure in mailbox_save_set_uid()

8 years agosdbox: Implement support for mail stubs
Timo Sirainen [Fri, 18 Nov 2016 13:17:08 +0000 (15:17 +0200)] 
sdbox: Implement support for mail stubs

8 years agolib-storage: Add support for storing "mail stubs"
Timo Sirainen [Fri, 18 Nov 2016 13:16:27 +0000 (15:16 +0200)] 
lib-storage: Add support for storing "mail stubs"

These allow treating a storage backend as a cache where the mail bodies
don't necessarily exist.

8 years agolib-storage: Fixed a boolean expression.
Stephan Bosch [Thu, 20 Oct 2016 13:54:40 +0000 (15:54 +0200)] 
lib-storage: Fixed a boolean expression.

Problem found with clang -Wstrict-bool.

8 years agolib-storage: treat empty root_dir as an empty string
Josef 'Jeff' Sipek [Mon, 17 Oct 2016 13:13:21 +0000 (09:13 -0400)] 
lib-storage: treat empty root_dir as an empty string

8 years agoimapc: %zu isn't standard, use PRIuSIZE_T instead.
Timo Sirainen [Fri, 18 Nov 2016 12:10:02 +0000 (14:10 +0200)] 
imapc: %zu isn't standard, use PRIuSIZE_T instead.

8 years agoimapc: don't mix positional and designated initialization
Josef 'Jeff' Sipek [Wed, 12 Oct 2016 18:32:51 +0000 (14:32 -0400)] 
imapc: don't mix positional and designated initialization

8 years agolib: Add connection.allow_empty_args_input
Timo Sirainen [Tue, 15 Nov 2016 16:39:08 +0000 (18:39 +0200)] 
lib: Add connection.allow_empty_args_input

This simplifies input_args() callbacks since they don't always have to check
for args[0] == NULL. This is enabled by default, because none of the current
users want it and it's somewhat unlikely there even will be those in future.

8 years agolib-storage: fix index_mail_get_headers return value
Josef 'Jeff' Sipek [Thu, 17 Nov 2016 20:59:02 +0000 (15:59 -0500)] 
lib-storage: fix index_mail_get_headers return value

And make it more obvious that we're not setting the actual return value in
index_mail_get_first_header.

8 years agolib-index: Fix detecting whether caller synced everything in mailbox.
Timo Sirainen [Thu, 17 Nov 2016 23:23:13 +0000 (01:23 +0200)] 
lib-index: Fix detecting whether caller synced everything in mailbox.

When mailbox_index_sync_begin() was followed by _commit(), without _next()s
in the middle actually syncing the mailbox, the tail_offset was updated to
indicate that the mailbox was fully synced. Existing code didn't rely on
this, so it probably didn't break anything.

This code hasn't worked for a long time, because log_view is always read
fully to the end in _sync_begin().

8 years agolib-storage: Add mail_storage_service_user_get_pool()
Timo Sirainen [Mon, 14 Nov 2016 23:42:27 +0000 (00:42 +0100)] 
lib-storage: Add mail_storage_service_user_get_pool()

8 years agoglobal: Replace some settings_parse_line() calls with settings_parse_keyvalue()
Timo Sirainen [Mon, 14 Nov 2016 23:41:38 +0000 (00:41 +0100)] 
global: Replace some settings_parse_line() calls with settings_parse_keyvalue()

8 years agolib-settings: Add settings_parse_keyvalue()
Timo Sirainen [Mon, 14 Nov 2016 23:36:57 +0000 (00:36 +0100)] 
lib-settings: Add settings_parse_keyvalue()

8 years agolib-settings: Avoid duplicating settings' values when not needed
Timo Sirainen [Mon, 14 Nov 2016 22:32:05 +0000 (23:32 +0100)] 
lib-settings: Avoid duplicating settings' values when not needed

8 years agoimapc: Use struct mail_namespace.user_set
Timo Sirainen [Mon, 14 Nov 2016 21:57:41 +0000 (22:57 +0100)] 
imapc: Use struct mail_namespace.user_set

8 years agolib-storage: Add mail_namespace_get_driver_settings() and use it.
Timo Sirainen [Mon, 14 Nov 2016 21:43:07 +0000 (22:43 +0100)] 
lib-storage: Add mail_namespace_get_driver_settings() and use it.

It obsoletes mail_storage_get_driver_settings().

8 years agoimapc: use serialized settings as unique_root_dir
Josef 'Jeff' Sipek [Mon, 17 Oct 2016 13:18:27 +0000 (09:18 -0400)] 
imapc: use serialized settings as unique_root_dir

Without this, it is not possible to instantiate multiple imapc storages.
Any attempts to will result in multiple namespaces sharing the same storage,
regardless of if that was the intention.

8 years agolib-storage: Add struct mail_namespace.user_set
Timo Sirainen [Mon, 14 Nov 2016 21:32:42 +0000 (22:32 +0100)] 
lib-storage: Add struct mail_namespace.user_set

8 years agolib-storage: Use mail_namespace_alloc() for mail_namespaces_init_location()
Timo Sirainen [Mon, 14 Nov 2016 17:34:02 +0000 (18:34 +0100)] 
lib-storage: Use mail_namespace_alloc() for mail_namespaces_init_location()

Based on patch by Jeff Sipek

8 years agolib-storage: Add mail_namespace_alloc()
Timo Sirainen [Mon, 14 Nov 2016 17:33:37 +0000 (18:33 +0100)] 
lib-storage: Add mail_namespace_alloc()

This makes it easier to create new namespaces.
Based on patch by Jeff Sipek

8 years agolib-storage: Add asserts to make sure mailbox_header_lookup_ctx is used correctly.
Timo Sirainen [Thu, 10 Nov 2016 11:19:05 +0000 (13:19 +0200)] 
lib-storage: Add asserts to make sure mailbox_header_lookup_ctx is used correctly.

8 years agolib-index: Added mail_index_transaction_get_highest_modseq()
Timo Sirainen [Mon, 14 Nov 2016 16:41:23 +0000 (17:41 +0100)] 
lib-index: Added mail_index_transaction_get_highest_modseq()

8 years agolib-index: Added internal mail_index_transaction_finish_so_far()
Timo Sirainen [Mon, 14 Nov 2016 16:37:31 +0000 (17:37 +0100)] 
lib-index: Added internal mail_index_transaction_finish_so_far()

This can be called multiple times before mail_index_transaction_finish().
It's going to perform all the work of reordering mails and dropping
unnecessary changes that can be done before changing sequences to UIDs.

This will be needed for the following patch that implements
mail_index_transaction_get_highest_modseq().

8 years agolib-index: Assert if mail_index_transaction_sort_appends() sees any uid==0
Timo Sirainen [Mon, 14 Nov 2016 16:22:53 +0000 (17:22 +0100)] 
lib-index: Assert if mail_index_transaction_sort_appends() sees any uid==0

Every mail must have an UID at this stage.

8 years agoconfigure: Fix build with old OpenSSL without SSL_clear_options
Paul Howarth [Mon, 31 Oct 2016 10:49:38 +0000 (10:49 +0000)] 
configure: Fix build with old OpenSSL without SSL_clear_options

SSL_clear_options was introduced in OpenSSL 0.9.8m but may be
backported to older versions in "enterprise" OS releases, so a version
check is insufficient here.

It was originally implemented as a macro but is a function in more
recent OpenSSL versions, so a test that works for both cases is needed.

8 years agolib-index: Make sure an already-corrupted index/log isn't written
Timo Sirainen [Thu, 17 Nov 2016 15:13:09 +0000 (17:13 +0200)] 
lib-index: Make sure an already-corrupted index/log isn't written

8 years agoimapc: Fix assert-crash when deleting mailbox triggers mailbox_get_open_status().
Timo Sirainen [Thu, 17 Nov 2016 00:48:20 +0000 (02:48 +0200)] 
imapc: Fix assert-crash when deleting mailbox triggers mailbox_get_open_status().

For example vsize header updating triggers this.

Fixes:
Panic: file mail-storage.c: line 1683: unreached

8 years agolib-storage: Fix compiler warnings about enum mismatches
Timo Sirainen [Wed, 16 Nov 2016 19:40:37 +0000 (21:40 +0200)] 
lib-storage: Fix compiler warnings about enum mismatches

8 years agoLAYOUT=index: Try to rename corrupted mailbox name during mailbox open.
Timo Sirainen [Wed, 16 Nov 2016 01:11:30 +0000 (03:11 +0200)] 
LAYOUT=index: Try to rename corrupted mailbox name during mailbox open.

8 years agolib-storage: Added struct mailbox.corrupted_mailbox_name
Timo Sirainen [Wed, 16 Nov 2016 01:10:10 +0000 (03:10 +0200)] 
lib-storage: Added struct mailbox.corrupted_mailbox_name

This allows backends that are adding lost mailboxes to mailbox list index to
indicate that they don't actually know the name of the mailbox, and the
mailbox list index should try to figure it out and rename the mailbox to its
proper name.

8 years agoLAYOUT=index: Don't write corrupted mailbox names to box-name header.
Timo Sirainen [Wed, 16 Nov 2016 01:06:31 +0000 (03:06 +0200)] 
LAYOUT=index: Don't write corrupted mailbox names to box-name header.

This way when opening a mailbox the box-name header isn't overwritten by
a corrupted name.

Keep track of the corrupted names with MAILBOX_LIST_INDEX_FLAG_CORRUPTED_NAME
flag in list index records. The flag isn't removed until the mailbox is
renamed.

8 years agolib-storage: Preserve box-name header when rebuilding index.
Timo Sirainen [Wed, 16 Nov 2016 01:01:22 +0000 (03:01 +0200)] 
lib-storage: Preserve box-name header when rebuilding index.

8 years agodoveadm dump: Add support for the new box-name index header.
Timo Sirainen [Tue, 15 Nov 2016 23:44:58 +0000 (01:44 +0200)] 
doveadm dump: Add support for the new box-name index header.

8 years agoLAYOUT=index: Update mailbox name to mailbox index's header when opening.
Timo Sirainen [Tue, 15 Nov 2016 23:43:34 +0000 (01:43 +0200)] 
LAYOUT=index: Update mailbox name to mailbox index's header when opening.

This way if the mailbox list index gets lost, a recent mailbox name is still
available.

8 years agolib-storage: Prevent renaming mailbox under itself.
Timo Sirainen [Tue, 15 Nov 2016 23:09:57 +0000 (01:09 +0200)] 
lib-storage: Prevent renaming mailbox under itself.

This resulted earlier in a loop, which broke the mailbox index.
Note that IMAP already prevented this, so it could only be triggered by
other tools, like doveadm.

8 years agolib-storage: Prevent parent loops in mailbox list index
Timo Sirainen [Tue, 15 Nov 2016 23:04:18 +0000 (01:04 +0200)] 
lib-storage: Prevent parent loops in mailbox list index

8 years agolib-storage: Fix invalid parents in LAYOUT=index
Timo Sirainen [Tue, 15 Nov 2016 23:03:20 +0000 (01:03 +0200)] 
lib-storage: Fix invalid parents in LAYOUT=index

Previously it just kept complaining without fixing the errors.

8 years agolib-storage: Improve mailbox list index corruption errors
Timo Sirainen [Tue, 15 Nov 2016 23:01:58 +0000 (01:01 +0200)] 
lib-storage: Improve mailbox list index corruption errors

8 years agolib-storage: If LAYOUT=index loses mailbox names, write the generated ones to index.
Timo Sirainen [Tue, 15 Nov 2016 22:57:06 +0000 (00:57 +0200)] 
lib-storage: If LAYOUT=index loses mailbox names, write the generated ones to index.

Previously it just kept complaining and regenerating new names, without
actually fixing up the situation.

8 years agolib-storage: Fix handling LAYOUT=index losing mailbox names
Timo Sirainen [Tue, 15 Nov 2016 22:55:38 +0000 (00:55 +0200)] 
lib-storage: Fix handling LAYOUT=index losing mailbox names

It lost all the mailbox names.

8 years agoconfig: Match local_name using dns-util
Aki Tuomi [Fri, 11 Nov 2016 11:40:55 +0000 (13:40 +0200)] 
config: Match local_name using dns-util

This way it correctly handles wildcards.

8 years agolib-dns: Add tests for dns-util
Aki Tuomi [Fri, 11 Nov 2016 11:36:23 +0000 (13:36 +0200)] 
lib-dns: Add tests for dns-util

8 years agolib-dns: Add DNS specific matching algorithms
Aki Tuomi [Fri, 11 Nov 2016 11:13:29 +0000 (13:13 +0200)] 
lib-dns: Add DNS specific matching algorithms

RFC4343 and RFCRFC4592 compare and match algorithms

8 years agomaster: Fix compiling with systemd after /dev/null changes
Timo Sirainen [Wed, 16 Nov 2016 19:36:17 +0000 (21:36 +0200)] 
master: Fix compiling with systemd after /dev/null changes

8 years agoconfigure: Removed AC_CONFIG_MACRO_DIR([m4]) for now
Timo Sirainen [Wed, 16 Nov 2016 15:36:03 +0000 (17:36 +0200)] 
configure: Removed AC_CONFIG_MACRO_DIR([m4]) for now

Fixes:
libtoolize: AC_CONFIG_MACRO_DIR([m4]) conflicts with ACLOCAL_AMFLAGS=-I ..

8 years agoimap: Use correct format specifier for highestmodseq
Aki Tuomi [Wed, 16 Nov 2016 10:47:59 +0000 (12:47 +0200)] 
imap: Use correct format specifier for highestmodseq

8 years agoMakefile: Add -I . to ACLOCAL_AMFLAGS
Timo Sirainen [Wed, 16 Nov 2016 11:45:28 +0000 (13:45 +0200)] 
Makefile: Add -I . to ACLOCAL_AMFLAGS

Without this when aclocal is automatically run it doesn't generate a working
configure.

8 years agolib-index: Fix flushing NFS if minimum wanted transaction log file is lost
Timo Sirainen [Wed, 16 Nov 2016 11:29:49 +0000 (13:29 +0200)] 
lib-index: Fix flushing NFS if minimum wanted transaction log file is lost

8 years agoimap: Add details why unhibernation failed
Aki Tuomi [Tue, 15 Nov 2016 16:55:36 +0000 (18:55 +0200)] 
imap: Add details why unhibernation failed

This can help understanding why client
failed to unhibernate.

8 years agoglobal: Use fd_close_maybe_stdio()
Timo Sirainen [Wed, 16 Nov 2016 09:41:42 +0000 (11:41 +0200)] 
global: Use fd_close_maybe_stdio()

8 years agolib: Add fd_close_maybe_stdio()
Timo Sirainen [Wed, 16 Nov 2016 09:40:35 +0000 (11:40 +0200)] 
lib: Add fd_close_maybe_stdio()

The idea is that this should be used whenever closing fds that may be 0 or
1. If they are closed normally, the following code may end up using 0/1 fd
for other purposes, which could cause problems.

8 years agoglobal: use dev_null_fd instead of opening /dev/null
Timo Sirainen [Wed, 16 Nov 2016 09:37:34 +0000 (11:37 +0200)] 
global: use dev_null_fd instead of opening /dev/null

8 years agomaster: Don't unlink login sockets at startup if someone is listening to them.
Timo Sirainen [Wed, 16 Nov 2016 09:35:42 +0000 (11:35 +0200)] 
master: Don't unlink login sockets at startup if someone is listening to them.

The original check there never worked, because null_fd was always set.

Normally the master.pid file would prevent this happening, but if it didn't
exist, the sockets would be unlinked and usually also created back.

8 years agolib-master: Revert redundant stdin/stdout/stderr fd checks
Timo Sirainen [Wed, 16 Nov 2016 09:17:27 +0000 (11:17 +0200)] 
lib-master: Revert redundant stdin/stdout/stderr fd checks

This is now done by lib_init() in a bit nicer way.

Reverts 08923d2c956ece3dc604d5842ba152c2bdb11fb9

8 years agolib: Make sure stdin/stdout/stderr have fd at startup and keep /dev/null always open
Timo Sirainen [Wed, 16 Nov 2016 09:09:01 +0000 (11:09 +0200)] 
lib: Make sure stdin/stdout/stderr have fd at startup and keep /dev/null always open

This guarantees we will always have a fd that can be used as /dev/null.
It works even inside chroots.

8 years agoFix -Wstrict-bool compiler warnings.
Timo Sirainen [Tue, 15 Nov 2016 21:56:19 +0000 (23:56 +0200)] 
Fix -Wstrict-bool compiler warnings.

8 years agodoveadm-save: Check stream errno before save
Aki Tuomi [Thu, 3 Nov 2016 13:30:58 +0000 (15:30 +0200)] 
doveadm-save: Check stream errno before save

This is to ensure the file has been really opened.

8 years agoManually cleanup OpenSSL from dovecot_openssl_common_global_unref()
Apollon Oikonomopoulos [Sun, 13 Nov 2016 18:04:27 +0000 (20:04 +0200)] 
Manually cleanup OpenSSL from dovecot_openssl_common_global_unref()

OpenSSL 1.1 features a cleanup function that is automatically run on shutdown
using atexit(3). This function frees all OpenSSL-allocated resources.

In dovecot, OpenSSL is loaded indirectly using dlopen(3) against the relevant
dovecot crypto module and is finally unloaded using dlclose(3). Until
OpenSSL 1.0.1c this worked fine, however OpenSSL 1.0.1c makes sure[1] that the
library stays loaded after the initial dlclose() so that the atexit(3)
handlers can run on shutdown. This, together with the fact that dovecot
uses custom allocation functions for OpenSSL and has already partially
free()'d some of OpenSSL's resources in module_free(), leads to a
segfault at process shutdown[2].

We fix this by explicitly calling OPENSSL_cleanup() during module unload. This
is safe to do, as long as we will never want to subsequently re-initialize
OpenSSL.

[1] https://github.com/openssl/openssl/commit/4af9f7fe79ff82b90c16969b7e5871435056377b
[2] https://buildd.debian.org/status/fetch.php?pkg=dovecot&arch=amd64&ver=1:2.2.26.0-2&stamp=1478873022

Signed-off-by: Apollon Oikonomopoulos <apoikos@debian.org>
8 years agossl: fix reference to SSLv2 and disable SSLv3
Apollon Oikonomopoulos [Tue, 15 Nov 2016 11:55:44 +0000 (12:55 +0100)] 
ssl: fix reference to SSLv2 and disable SSLv3

This is driven by the fact that OpenSSL 1.1 does not know about SSLv2 at
all and dovecot's defaults simply make OpenSSL error out with "Unknown
protocol 'SSLv2'"[1]. So we change the defaults to refer to SSLv2 iff OpenSSL
seems to know something about it.

While at it, it's also a good idea to disable SSLv3 by default as well.

[1] https://bugs.debian.org/844347

Signed-off-by: Apollon Oikonomopoulos <apoikos@debian.org>
8 years agolib-http: Use io_wait_timer for tracking wait times.
Timo Sirainen [Tue, 15 Nov 2016 10:42:47 +0000 (11:42 +0100)] 
lib-http: Use io_wait_timer for tracking wait times.

The previous code was completely incorrect, since it wasn't even tracking
the HTTP request's start usecs.

8 years agodict-client: Use io_wait_timer for tracking wait times.
Timo Sirainen [Tue, 15 Nov 2016 10:41:53 +0000 (11:41 +0100)] 
dict-client: Use io_wait_timer for tracking wait times.

This way the "dict wait" time includes all ioloop waits that wait on the
dict-client, not just in dict_wait().

8 years agolib: Added io_wait_timer
Timo Sirainen [Tue, 15 Nov 2016 10:21:56 +0000 (11:21 +0100)] 
lib: Added io_wait_timer

This allows easier tracking of how much time the io_wait_timer has been
spending on (multiple) ioloops.

8 years agolib: Code cleanup - move code to ioloop_add_wait_time()
Timo Sirainen [Tue, 15 Nov 2016 10:20:41 +0000 (11:20 +0100)] 
lib: Code cleanup - move code to ioloop_add_wait_time()

8 years agolib: Fix ioloop wait times when io_loop_time_refresh() is used
Timo Sirainen [Tue, 15 Nov 2016 10:11:37 +0000 (11:11 +0100)] 
lib: Fix ioloop wait times when io_loop_time_refresh() is used

8 years agodoveadm: Put doveadm_mail_iter_init parameters to right order
Aki Tuomi [Tue, 15 Nov 2016 18:10:43 +0000 (20:10 +0200)] 
doveadm: Put doveadm_mail_iter_init parameters to right order

8 years agolib-storage: Add vsize hdr on empty mailbox
Aki Tuomi [Tue, 15 Nov 2016 11:40:54 +0000 (13:40 +0200)] 
lib-storage: Add vsize hdr on empty mailbox

8 years agodoveadm-director: Include tag in add line
Aki Tuomi [Tue, 15 Nov 2016 11:17:05 +0000 (13:17 +0200)] 
doveadm-director: Include tag in add line

8 years agodoveadm-import: Open source boxes read-only
Aki Tuomi [Tue, 15 Nov 2016 07:33:15 +0000 (09:33 +0200)] 
doveadm-import: Open source boxes read-only

This allows importing emails from read-only locations,
such as backups.

8 years agodoveadm: Add open read-only parameter to mailbox iterator
Aki Tuomi [Tue, 15 Nov 2016 07:32:31 +0000 (09:32 +0200)] 
doveadm: Add open read-only parameter to mailbox iterator

This allows iterating mailboxes so that they
are opened for read-only.

8 years agostats: Add support for carbon-server
Aki Tuomi [Sun, 6 Nov 2016 00:50:52 +0000 (02:50 +0200)] 
stats: Add support for carbon-server

Allows admin to specify stats_carbon_server=ip:port.
Stats are delivered in "key value" format
to specified port. Can be received with e.g.
metronome.

8 years agolib: Add net_ipport2str
Aki Tuomi [Wed, 9 Nov 2016 13:17:01 +0000 (15:17 +0200)] 
lib: Add net_ipport2str

Converts struct ip_addr + port into either
127.0.0.1:6000 or [::1]:6000.

8 years agodoveadm: Fix error reporting for doveadm-dump-dcrypt
Aki Tuomi [Mon, 14 Nov 2016 08:52:22 +0000 (10:52 +0200)] 
doveadm: Fix error reporting for doveadm-dump-dcrypt

8 years agolib: Assert-crash in i_close_fd() if fd == 0
Timo Sirainen [Mon, 14 Nov 2016 13:54:37 +0000 (14:54 +0100)] 
lib: Assert-crash in i_close_fd() if fd == 0

lib-master now guarantees that fd==0 doesn't normally happen.

8 years agomaster: Remove redundant check to guarantee stdin/stdout/stderr fd existence.
Timo Sirainen [Mon, 14 Nov 2016 13:51:45 +0000 (14:51 +0100)] 
master: Remove redundant check to guarantee stdin/stdout/stderr fd existence.

The previous method also wasn't correct, since it was setting close-on-exec
flag for the fds. Although this didn't normally make any difference, since
stdin & stdout was explicitly dup2()ed to /dev/null and for all except the
log process stderr was also being dup2()ed.

8 years agolib-master: Make sure stdin/stdout/stderr fds are open.
Timo Sirainen [Mon, 14 Nov 2016 13:48:20 +0000 (14:48 +0100)] 
lib-master: Make sure stdin/stdout/stderr fds are open.

We'll just open /dev/null for them if they don't already exist.

8 years agolib: Mark istream with eof=TRUE on all errors
Aki Tuomi [Mon, 14 Nov 2016 14:45:24 +0000 (16:45 +0200)] 
lib: Mark istream with eof=TRUE on all errors

Previously only i_stream_read() did this, but i_stream_seek(), _stat(),
_get_size() and _create() didn't. This caused assert-crashes on error
conditions in code which assumed that when stream_errno != 0, eof==TRUE.

8 years agolib-program-client: Do not call callback when destroying
Aki Tuomi [Wed, 9 Nov 2016 13:40:48 +0000 (15:40 +0200)] 
lib-program-client: Do not call callback when destroying

8 years agodict-client: When dict-server times out, log ioloop/lock waits.
Timo Sirainen [Mon, 14 Nov 2016 12:22:06 +0000 (13:22 +0100)] 
dict-client: When dict-server times out, log ioloop/lock waits.

8 years agodict-client: Code cleanup to timeout handling.
Timo Sirainen [Mon, 14 Nov 2016 12:18:13 +0000 (13:18 +0100)] 
dict-client: Code cleanup to timeout handling.

No functional changes.

8 years agodict-client: Dict server timeout may have occurred too early.
Timo Sirainen [Mon, 14 Nov 2016 12:14:25 +0000 (13:14 +0100)] 
dict-client: Dict server timeout may have occurred too early.

8 years agolib-index: Improve error messages when transaction log is unexpectedly lost
Timo Sirainen [Fri, 11 Nov 2016 15:00:39 +0000 (17:00 +0200)] 
lib-index: Improve error messages when transaction log is unexpectedly lost

8 years agodict-client: Forward dict_iterate_set_limit() to dict server
Timo Sirainen [Thu, 10 Nov 2016 21:00:59 +0000 (23:00 +0200)] 
dict-client: Forward dict_iterate_set_limit() to dict server

8 years agodict-client: Code cleanup - remember all iteration flags
Timo Sirainen [Thu, 10 Nov 2016 21:23:39 +0000 (23:23 +0200)] 
dict-client: Code cleanup - remember all iteration flags

8 years agolib-dict: Fix infinite loop when row limit is reached.
Timo Sirainen [Thu, 10 Nov 2016 20:57:22 +0000 (22:57 +0200)] 
lib-dict: Fix infinite loop when row limit is reached.

If dict_iterate_has_more() keeps returning TRUE, the caller keeps calling
dict_iterate().