]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agodirector: Use *_host.ip_str to avoid net_ip2addr() calls
Timo Sirainen [Fri, 3 Nov 2017 23:59:27 +0000 (01:59 +0200)] 
director: Use *_host.ip_str to avoid net_ip2addr() calls

7 years agodirector: Add director_host.ip_str
Timo Sirainen [Fri, 3 Nov 2017 23:51:25 +0000 (01:51 +0200)] 
director: Add director_host.ip_str

This avoids having to use net_ip2addr() all the time to convert it into a
string.

7 years agodirector: Add mail_host.ip_str
Timo Sirainen [Fri, 3 Nov 2017 23:49:29 +0000 (01:49 +0200)] 
director: Add mail_host.ip_str

This avoids having to use net_ip2addr() all the time to convert it into a
string.

7 years agodirector: Use t_strsplit_tabescaped_inplace() for director connection input
Timo Sirainen [Fri, 3 Nov 2017 23:48:41 +0000 (01:48 +0200)] 
director: Use t_strsplit_tabescaped_inplace() for director connection input

7 years agolib: net_addr2ip() - Optimize for parsing IPv4 addresses
Timo Sirainen [Fri, 3 Nov 2017 23:43:41 +0000 (01:43 +0200)] 
lib: net_addr2ip() - Optimize for parsing IPv4 addresses

7 years agolib: net_ip2addr() - Optimize by allocating destination memory immediately
Timo Sirainen [Fri, 3 Nov 2017 23:42:37 +0000 (01:42 +0200)] 
lib: net_ip2addr() - Optimize by allocating destination memory immediately

It doesn't really matter if we allocate a few extra bytes.

7 years agolib: *_strsplit() - implement more efficient version for a single separator char
Timo Sirainen [Fri, 3 Nov 2017 23:40:24 +0000 (01:40 +0200)] 
lib: *_strsplit() - implement more efficient version for a single separator char

7 years agolib: Implement t_strsplit_tabescaped_inplace()
Timo Sirainen [Fri, 3 Nov 2017 23:39:38 +0000 (01:39 +0200)] 
lib: Implement t_strsplit_tabescaped_inplace()

This is a more efficient version of t_strsplit_tabescaped(), which modifies
the input string instead of duplicating it.

7 years agolib: t_strsplit_tabescaped() - don't create unnecessary data stack mempool
Timo Sirainen [Fri, 3 Nov 2017 23:37:19 +0000 (01:37 +0200)] 
lib: t_strsplit_tabescaped() - don't create unnecessary data stack mempool

unsafe_data_stack_pool is more efficient to use

7 years agolib: str_tabunescape() - optimize initial escape char lookup
Timo Sirainen [Fri, 3 Nov 2017 23:35:44 +0000 (01:35 +0200)] 
lib: str_tabunescape() - optimize initial escape char lookup

strchr() is faster than looping ourself.

7 years agodirector: Don't recreate timeout on every user lookup
Timo Sirainen [Fri, 3 Nov 2017 23:34:02 +0000 (01:34 +0200)] 
director: Don't recreate timeout on every user lookup

Recreate it only when the timeout should change.

7 years agodirector: Fix off-by-one when checking if user weakness is stuck
Timo Sirainen [Sun, 5 Nov 2017 21:11:25 +0000 (23:11 +0200)] 
director: Fix off-by-one when checking if user weakness is stuck

When the weakness was exactly at the second, the weakness wasn't detected
and the next expiration timeout was removed entirely. This shouldn't have
caused any bigger problems, because another user lookup on the following
second would have then detected the weakness, removed the user and restored
the next expiration timeout.

7 years agodirector: Show each director connection in doveadm DIRECTOR-LIST
Timo Sirainen [Thu, 26 Oct 2017 10:56:25 +0000 (13:56 +0300)] 
director: Show each director connection in doveadm DIRECTOR-LIST

Previously the host was shown only once, regardless of how many connections
it had. This especially helps when there are just two directors, but also
can be useful when showing incoming/outgoing connections that are still
in handshaking phase.

7 years agodoveadm director ring status: Add more fields related to connection status
Timo Sirainen [Thu, 26 Oct 2017 11:10:51 +0000 (14:10 +0300)] 
doveadm director ring status: Add more fields related to connection status

7 years agodirector: Track show long the last ring sync took.
Timo Sirainen [Thu, 26 Oct 2017 11:18:50 +0000 (14:18 +0300)] 
director: Track show long the last ring sync took.

7 years agodirector: Track connections' last ping time
Timo Sirainen [Thu, 26 Oct 2017 11:07:56 +0000 (14:07 +0300)] 
director: Track connections' last ping time

7 years agodirector: Add director_connection_get_status()
Timo Sirainen [Thu, 26 Oct 2017 10:07:30 +0000 (13:07 +0300)] 
director: Add director_connection_get_status()

Can be used to access connection-specific status information.

7 years agodirector: Fix updating director connection's last_output timestamp
Timo Sirainen [Thu, 26 Oct 2017 10:02:32 +0000 (13:02 +0300)] 
director: Fix updating director connection's last_output timestamp

It was previously updated only in ostream's flush callback, which was called
only when there were a lot of output. This only caused the "last output"
timestamp in disconnection log lines to be wrong.

7 years agodoveadm director: Parse timestamp parameters with str_to_time()
Timo Sirainen [Thu, 26 Oct 2017 09:44:34 +0000 (12:44 +0300)] 
doveadm director: Parse timestamp parameters with str_to_time()

7 years agodirector: Close director connection immediately when output buffer is full
Timo Sirainen [Wed, 25 Oct 2017 14:22:42 +0000 (17:22 +0300)] 
director: Close director connection immediately when output buffer is full

Only the ostream was closed, which didn't actually cause the disconnection
until the other side closed the connection.

7 years agodirector: Add director_output_buffer_size setting
Timo Sirainen [Wed, 25 Oct 2017 14:18:03 +0000 (17:18 +0300)] 
director: Add director_output_buffer_size setting

This allows configuring the max buffer size for outgoing connections.
Previously it was hardcoded to 10 MB, which wasn't necessarily enough for
very busy directors.

7 years agolib-fs: Fix fs_wrapper_write_stream_finish() to work with async parent fs
Timo Sirainen [Mon, 16 Oct 2017 10:53:58 +0000 (13:53 +0300)] 
lib-fs: Fix fs_wrapper_write_stream_finish() to work with async parent fs

This only became a problem with the previous fs-compress change.

7 years agolib-storage: Fix assert-crash when searching header and MIMEPART
Timo Sirainen [Thu, 19 Oct 2017 11:39:01 +0000 (14:39 +0300)] 
lib-storage: Fix assert-crash when searching header and MIMEPART

For now this is just a bit kludgy workaround. The proper fix requires
larger changes, which aren't worth the effort right now.

For example:
doveadm fetch -u testuser uid MAILBOX inbox FROM foo MIMEPART FILENAME CONTAINS bar BODY baz

Crashes with:
Panic: file index-mail-headers.c: line 294 (index_mail_parse_header): assertion failed: (part != NULL)

8 years agoauth: Fix %{ldap_dn} not to leak memory
Timo Sirainen [Thu, 19 Oct 2017 12:39:28 +0000 (15:39 +0300)] 
auth: Fix %{ldap_dn} not to leak memory

8 years agoacl plugin: avoid "'struct stat' declared inside parameter list" warning
Josef 'Jeff' Sipek [Wed, 11 Oct 2017 20:33:57 +0000 (16:33 -0400)] 
acl plugin: avoid "'struct stat' declared inside parameter list" warning

8 years agoAdded "ULL" to the hex literals that needed it.
Bill Cole [Tue, 10 Oct 2017 21:40:04 +0000 (17:40 -0400)] 
Added "ULL" to the hex literals that needed it.

On 32-bit platforms with older compilers (e.g. gcc 4.2 on MacOS 10.6
running on a 1st-gen Core Duo) a 'long' is 4 bytes and the compiler does
not automatically use a 'long long' when needed, but instead generates
an error. e.g.:

libtool: compile:  /usr/bin/g++-4.2 -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/lib -I../../../src/lib-mail -I../../../src/lib-index -I../../../src/lib-storage -I../../../src/plugins/fts -I../../../src/doveadm -I/opt/local/include/openssl -I/opt/local/include -I/opt/local/include/CLucene/ext -pipe -Os -arch i386 -D__STDC_LIMIT_MACROS -MT lucene-wrapper.lo -MD -MP -MF .deps/lucene-wrapper.Tpo -c lucene-wrapper.cc  -fno-common -DPIC -o .libs/lucene-wrapper.o
In file included from ../../../src/lib/lib.h:33,
                 from lucene-wrapper.cc:4:
../../../src/lib/byteorder.h:94: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:95: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:96: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:97: error: integer constant is too large for ‘long’ type
make[4]: *** [lucene-wrapper.lo] Error 1

Adding the 'ULL' to the end of the 16-digit hex literals that are used
to test the structure of 64-bit integers fixes this and avoids any
problem which could arise from the compiler using a 32-bit type for
those literals that could fit in 32 bites.

8 years agocassandra: Support "timestamp" type fields properly
Timo Sirainen [Mon, 16 Oct 2017 12:41:56 +0000 (15:41 +0300)] 
cassandra: Support "timestamp" type fields properly

Fixes setting them with prepared statements. Reading them never worked
earlier.

8 years agocassandra: Include "prepared" when logging about prepared statement queries
Timo Sirainen [Mon, 16 Oct 2017 12:12:12 +0000 (15:12 +0300)] 
cassandra: Include "prepared" when logging about prepared statement queries

Mainly useful for debugging/testing.

8 years agocassandra: Fix using bigint types with unprepared statements
Timo Sirainen [Mon, 16 Oct 2017 11:49:56 +0000 (14:49 +0300)] 
cassandra: Fix using bigint types with unprepared statements

This reverts the code to not using the statements with binding at all.
Alternative fix would be to start using explicit int32 or int64 parameter
types, but that breaks backwards compatibility a bit.

8 years agodoveadm proxy: Don't crash if remote doesn't support log proxying
Timo Sirainen [Sat, 14 Oct 2017 09:54:18 +0000 (12:54 +0300)] 
doveadm proxy: Don't crash if remote doesn't support log proxying

8 years agofs-compress: Allow compress level 0 to skip compression
Timo Sirainen [Fri, 13 Oct 2017 09:34:01 +0000 (12:34 +0300)] 
fs-compress: Allow compress level 0 to skip compression

This can be useful when combined with the "maybe-" prefix, so Dovecot will
support reading compressed files without creating new ones.

8 years agolib-storage: Add settings to configure lib-index optimization parameters
Timo Sirainen [Mon, 9 Oct 2017 13:37:08 +0000 (16:37 +0300)] 
lib-storage: Add settings to configure lib-index optimization parameters

The defaults are expected to be pretty good, but these settings make it
easier to test whether other values might be more optimal.

8 years agolib-index: Add mail_index_cache_optimization_settings
Timo Sirainen [Mon, 9 Oct 2017 12:37:51 +0000 (15:37 +0300)] 
lib-index: Add mail_index_cache_optimization_settings

8 years agolib-index: Add mail_index_base_optimization_settings
Timo Sirainen [Mon, 9 Oct 2017 12:24:45 +0000 (15:24 +0300)] 
lib-index: Add mail_index_base_optimization_settings

8 years agolib-index: Replace mail_index_set_log_rotation() with mail_index_set_optimization_set...
Timo Sirainen [Mon, 9 Oct 2017 12:15:08 +0000 (15:15 +0300)] 
lib-index: Replace mail_index_set_log_rotation() with mail_index_set_optimization_settings()

This allows more easily adding optimization-related settings.

8 years agofs-compress: Support reading uncompressed input by prefixing compression format with...
Timo Sirainen [Fri, 6 Oct 2017 15:33:24 +0000 (18:33 +0300)] 
fs-compress: Support reading uncompressed input by prefixing compression format with "maybe-"

8 years agolib: Add istream-try
Timo Sirainen [Fri, 6 Oct 2017 15:31:12 +0000 (18:31 +0300)] 
lib: Add istream-try

This can be used to automatically detect the underlying istream format from
a given list of choices.

8 years agolib: io_stream_set_error() - Allow one of the parameters to be the old error
Timo Sirainen [Mon, 9 Oct 2017 15:31:52 +0000 (18:31 +0300)] 
lib: io_stream_set_error() - Allow one of the parameters to be the old error

8 years agolib-master: Allow a second log initialization after settings have been read.
Timo Sirainen [Wed, 11 Oct 2017 10:03:51 +0000 (13:03 +0300)] 
lib-master: Allow a second log initialization after settings have been read.

This fixes logging with services that bypass the log service (lda or -L
parameter).

8 years agolib-storage: Make sure mailbox list notification flush sees latest changes.
Timo Sirainen [Mon, 11 Sep 2017 10:48:17 +0000 (13:48 +0300)] 
lib-storage: Make sure mailbox list notification flush sees latest changes.

This is mainly useful with imaptest test scripts to make sure they're seeing
the changes done by the other session, without assuming that inotify will
always notify about the change before NOOP is run (it doesn't).

Do this only if mailbox_idle_check_interval>0, so it's not run when periodic
stat()s are wanted to be avoided.

8 years agolib: ostream-multiplex - ignore flush return value
Timo Sirainen [Tue, 10 Oct 2017 12:38:13 +0000 (15:38 +0300)] 
lib: ostream-multiplex - ignore flush return value

There's nothing that can be done about it at close() time. Silences static
analyzer warnings.

8 years agolib: ostream-multiplex - remove unnecessary flushes
Timo Sirainen [Tue, 10 Oct 2017 12:37:39 +0000 (15:37 +0300)] 
lib: ostream-multiplex - remove unnecessary flushes

8 years agolib: istream-multiplex - Minor optimization
Timo Sirainen [Tue, 10 Oct 2017 09:33:08 +0000 (12:33 +0300)] 
lib: istream-multiplex - Minor optimization

There's no need to find channel when we already know it. This also helps
static analyzers to understand that req_channel can't be NULL.

8 years agodoveadm-mail-crypt: Do not return prematurely in key generate
Aki Tuomi [Tue, 10 Oct 2017 09:52:15 +0000 (12:52 +0300)] 
doveadm-mail-crypt: Do not return prematurely in key generate

Broken by 446d7d9ddfe122e152b832c13fc28d164ae2c5e9

8 years agoostream-multiplex: Check flush return value
Aki Tuomi [Fri, 6 Oct 2017 06:02:49 +0000 (09:02 +0300)] 
ostream-multiplex: Check flush return value

8 years agotest-ostream-escaped: Check flush return value
Aki Tuomi [Fri, 6 Oct 2017 05:55:33 +0000 (08:55 +0300)] 
test-ostream-escaped: Check flush return value

Found by coverity

8 years agodoveadm-server: Remove flush before multiplex
Aki Tuomi [Fri, 6 Oct 2017 05:54:38 +0000 (08:54 +0300)] 
doveadm-server: Remove flush before multiplex

It's not really necessary, found by coverity

8 years agoiostream-multiplex: Check return values in tests
Aki Tuomi [Fri, 6 Oct 2017 05:52:18 +0000 (08:52 +0300)] 
iostream-multiplex: Check return values in tests

8 years agodoveadm: Return after destroying connection
Aki Tuomi [Fri, 6 Oct 2017 05:46:00 +0000 (08:46 +0300)] 
doveadm: Return after destroying connection

Prevents NULL deferences, found by coverity.

8 years agodoveadm mcp keypair generate: Fix -f parameter
Timo Sirainen [Thu, 17 Aug 2017 11:17:46 +0000 (14:17 +0300)] 
doveadm mcp keypair generate: Fix -f parameter

8 years agopop3: Expand settings to fix rawlog_dir
Timo Sirainen [Fri, 6 Oct 2017 11:39:00 +0000 (14:39 +0300)] 
pop3: Expand settings to fix rawlog_dir

Even if %variables weren't used in rawlog_dir, the path was always prefixed
with "0".

8 years agodoveadm-mail-crypt: Print existing folder key hash when aborting generate
Martti Rannanjärvi [Fri, 6 Oct 2017 09:47:06 +0000 (12:47 +0300)] 
doveadm-mail-crypt: Print existing folder key hash when aborting generate

8 years agodoveadm-mail-crypt: Print existing userkey hash when aborting generate
Martti Rannanjärvi [Fri, 6 Oct 2017 08:07:23 +0000 (11:07 +0300)] 
doveadm-mail-crypt: Print existing userkey hash when aborting generate

8 years agomail-crypt: Improve doveadm output
Aki Tuomi [Thu, 5 Oct 2017 12:53:16 +0000 (15:53 +0300)] 
mail-crypt: Improve doveadm output

8 years agomail-crypt: Fix key generation handling
Aki Tuomi [Thu, 5 Oct 2017 12:40:45 +0000 (15:40 +0300)] 
mail-crypt: Fix key generation handling

Userkey generation would not set all required fields.

8 years agoostream-multiplex: Unreference stream parent
Aki Tuomi [Mon, 9 Oct 2017 15:21:24 +0000 (18:21 +0300)] 
ostream-multiplex: Unreference stream parent

Otherwise it won't get free'd.

8 years agodoveadm: Add remote(host) prefix to all proxied logs
Timo Sirainen [Mon, 9 Oct 2017 10:55:06 +0000 (13:55 +0300)] 
doveadm: Add remote(host) prefix to all proxied logs

8 years agodoveadm log test: Fix it to work again
Timo Sirainen [Mon, 9 Oct 2017 11:28:17 +0000 (14:28 +0300)] 
doveadm log test: Fix it to work again

Broken by 719abeb2088987f213a33a7dd1fe78958beaef03

8 years agolib: ostream-multiplex - set ostream_private.parent
Timo Sirainen [Mon, 9 Oct 2017 10:19:32 +0000 (13:19 +0300)] 
lib: ostream-multiplex - set ostream_private.parent

Unlike with istream-multiplex, there are no issues with I/Os. Only the
parent stream will have the I/O. Using the default parent adds the
missing methods that otherwise would have needed to be implemented:
 - cork
 - flush_pending
 - switch_ioloop

8 years agolib: istream-multiplex - Forward i_stream_switch_ioloop() to parent
Timo Sirainen [Mon, 9 Oct 2017 10:14:23 +0000 (13:14 +0300)] 
lib: istream-multiplex - Forward i_stream_switch_ioloop() to parent

Most istreams do this because istream_private.parent is set to the parent
stream, but this can't be done with istream-multiplex. The main problem
with attempting to do the same with istream-multiplex is that the different
channels don't share the same I/O. Just because one channel received data
doesn't mean that other channels received any data. (It would be possible
to solve this by implementing a new method that allows overriding
i_stream_set_io(), but I'm not sure if that's a good idea either.)

8 years agoacl: Fix compiler warning with -Wstrict-bool
Timo Sirainen [Sun, 8 Oct 2017 22:22:47 +0000 (01:22 +0300)] 
acl: Fix compiler warning with -Wstrict-bool

8 years agoacl: Fix checking create (k) permission in global acl-file
Timo Sirainen [Fri, 6 Oct 2017 13:55:28 +0000 (16:55 +0300)] 
acl: Fix checking create (k) permission in global acl-file

Just because the global ACL file hasn't changed since it was last refreshed
for another ACL object, it doesn't mean that those ACLs don't need to be
applied to this ACL object.

This didn't usually cause problems, because the initial ACL object refresh
was always done due to local-path refresh returning "needs a refresh".
The only exception was when acl_object_init_from_parent() was called,
because it added an empty non-NULL validity for the local-path, so the
"needs a refresh" wasn't returned. This happened only when trying to
CREATE or RENAME mailbox under a parent where user didn't have create
permissions.

This affected only when using a single global acl-file, not when using
global acl directory containing per-mailbox files.

8 years agoacl: Cleanup - move code to a new acl_vfile_validity_has_changed()
Timo Sirainen [Fri, 6 Oct 2017 13:54:20 +0000 (16:54 +0300)] 
acl: Cleanup - move code to a new acl_vfile_validity_has_changed()

8 years agoacl: Fix checking whether global acl-file has changed
Timo Sirainen [Fri, 6 Oct 2017 13:44:01 +0000 (16:44 +0300)] 
acl: Fix checking whether global acl-file has changed

We always assumed that it was changed and re-read it.

8 years agoauth: Fix %{ldap_dn} change to compile with v2.2 API
Timo Sirainen [Fri, 6 Oct 2017 13:30:11 +0000 (16:30 +0300)] 
auth: Fix %{ldap_dn} change to compile with v2.2 API

8 years agoauth: Expand %{ldap_dn} to ldap_get_dn().
Sergey Kitov [Fri, 15 Sep 2017 12:17:08 +0000 (15:17 +0300)] 
auth: Expand %{ldap_dn} to ldap_get_dn().

8 years agolib: iostream-multiplex tests - Fix hangs by setting the pipe fds non-blocking
Timo Sirainen [Thu, 5 Oct 2017 17:25:29 +0000 (20:25 +0300)] 
lib: iostream-multiplex tests - Fix hangs by setting the pipe fds non-blocking

8 years agolib: istream-multiplex - Minor code cleanup
Timo Sirainen [Thu, 5 Oct 2017 17:24:11 +0000 (20:24 +0300)] 
lib: istream-multiplex - Minor code cleanup

Avoid propagating the error twice, and avoid any confusion about what "got"
actually contains.

8 years agodirector: When ring is synced, purge any pending "removed" directors
Timo Sirainen [Thu, 5 Oct 2017 09:34:10 +0000 (12:34 +0300)] 
director: When ring is synced, purge any pending "removed" directors

This allows adding a director back to the ring without having to wait for 30
seconds.

8 years agodirector: Rename director_delayed_dir_remove_timeout() to director_hosts_purge_removed()
Timo Sirainen [Tue, 3 Oct 2017 13:40:32 +0000 (16:40 +0300)] 
director: Rename director_delayed_dir_remove_timeout() to director_hosts_purge_removed()

This allows using it for other purposes without having a confusing name.

8 years agodirector: Fix potential panic when director is alone
Timo Sirainen [Thu, 5 Oct 2017 13:12:38 +0000 (16:12 +0300)] 
director: Fix potential panic when director is alone

If director is alone and it can't connect to other directors, it might crash
with:

Panic: file director.c: line 318 (director_set_ring_synced): assertion failed: (!dir->ring_synced)

8 years agodirector: Allow doveadm director ring remove for the same director
Timo Sirainen [Thu, 5 Oct 2017 08:51:23 +0000 (11:51 +0300)] 
director: Allow doveadm director ring remove for the same director

Fixes:
Panic: file doveadm-connection.c: line 859 (doveadm_connection_cmd_run): assertion failed: (conn->dir->right == NULL && conn->dir->left == NULL)

8 years agodirector: Don't crash on doveadm director ring remove for unknown director
Timo Sirainen [Thu, 5 Oct 2017 08:49:31 +0000 (11:49 +0300)] 
director: Don't crash on doveadm director ring remove for unknown director

Ring syncing isn't started, so it shouldn't try to wait for ring sync.

Fixes:
Panic: file doveadm-connection.c: line 859 (doveadm_connection_cmd_run): assertion failed: (conn->dir->right == NULL && conn->dir->left == NULL)

8 years agodirector: Don't crash if DIRECTOR-REMOVE is received for itself
Timo Sirainen [Thu, 5 Oct 2017 08:46:55 +0000 (11:46 +0300)] 
director: Don't crash if DIRECTOR-REMOVE is received for itself

This triggers the director removal from the ring, which causes the
connection to be destroyed. But since we're still in the middle of handling
the connection it needs refcounting.

8 years agodirector: Fix ring sync wait after DIRECTOR-REMOVE
Timo Sirainen [Thu, 14 Sep 2017 15:13:05 +0000 (18:13 +0300)] 
director: Fix ring sync wait after DIRECTOR-REMOVE

It was sending OK twice, and the first OK was too early.

8 years agodirector: Ignore CONNECT requests to hosts that have been removed already
Timo Sirainen [Thu, 14 Sep 2017 14:59:05 +0000 (17:59 +0300)] 
director: Ignore CONNECT requests to hosts that have been removed already

8 years agodirector: After CONNECT was received, make sure we disconnect
Timo Sirainen [Thu, 14 Sep 2017 14:57:29 +0000 (17:57 +0300)] 
director: After CONNECT was received, make sure we disconnect

The remote side won't be reading anything after the CONNECT, so we have to
disconnect anyway. If we decide that the CONNECT request is wrong, reconnect
after a short delay and hope that the remote agrees with us the next time.

8 years agodirector: When director is removed, notify it before disconnecting
Timo Sirainen [Thu, 14 Sep 2017 14:48:50 +0000 (17:48 +0300)] 
director: When director is removed, notify it before disconnecting

This way the removed director will know that it's been removed, and it
can also more quickly forward the removal to other directors.

8 years agodirector: Don't reset directors' last_network_failure while handshaking
Timo Sirainen [Thu, 14 Sep 2017 14:38:24 +0000 (17:38 +0300)] 
director: Don't reset directors' last_network_failure while handshaking

The reset is done mainly to make it faster for a director that has been down
to connect back to the ring, without other directors still thinking that
it's down. But DIRECTOR that is sent during handshake says nothing about
whether the director is up at the moment or not.

8 years agodirector: Log info line for every incoming/outgoing connection
Timo Sirainen [Thu, 14 Sep 2017 14:35:02 +0000 (17:35 +0300)] 
director: Log info line for every incoming/outgoing connection

This can help with debugging problems.

8 years agodirector: Cleanup - move code to a new director_log_connect()
Timo Sirainen [Thu, 14 Sep 2017 14:33:19 +0000 (17:33 +0300)] 
director: Cleanup - move code to a new director_log_connect()

Also adds a missing ')' to the log line.

8 years agodirector: Log info line whenever a director is added/removed from ring
Timo Sirainen [Thu, 14 Sep 2017 14:29:48 +0000 (17:29 +0300)] 
director: Log info line whenever a director is added/removed from ring

This can help with debugging problems.

8 years agodirector: Improve debugging: Log ring desync when there is no right connection
Timo Sirainen [Thu, 14 Sep 2017 15:13:33 +0000 (18:13 +0300)] 
director: Improve debugging: Log ring desync when there is no right connection

8 years agodirector: When logging "ring SYNC lost", include sync seq number in message
Timo Sirainen [Thu, 14 Sep 2017 14:26:39 +0000 (17:26 +0300)] 
director: When logging "ring SYNC lost", include sync seq number in message

This can help with debugging.

8 years agodoveadm director ring remove: Wait ring sync before and after removal
Timo Sirainen [Thu, 14 Sep 2017 08:57:27 +0000 (11:57 +0300)] 
doveadm director ring remove: Wait ring sync before and after removal

This helps mainly with automated tests.

8 years agolib-master: master_service_init_log() - Switch log handlers only on the first call
Timo Sirainen [Tue, 3 Oct 2017 11:51:16 +0000 (14:51 +0300)] 
lib-master: master_service_init_log() - Switch log handlers only on the first call

The secondary calls were only done by mail_storage_service_*() calls. They
want to initialize the logging once, but afterwards they only care about
changing the log prefix. Switch to this behavior now explicitly.

This fixes behavior if logging functions are changed between
mail_storage_service_*() calls, so they don't get reset.

8 years agolib: Fix warning with gcc7's -Wint-in-bool-context
Timo Sirainen [Thu, 5 Oct 2017 09:47:17 +0000 (12:47 +0300)] 
lib: Fix warning with gcc7's -Wint-in-bool-context

8 years agodoveadm: Deliver remote logs over doveadm socket
Aki Tuomi [Thu, 24 Aug 2017 11:59:07 +0000 (14:59 +0300)] 
doveadm: Deliver remote logs over doveadm socket

8 years agodoveadm: Refactor server/client code to support versioning properly
Aki Tuomi [Thu, 24 Aug 2017 11:45:22 +0000 (14:45 +0300)] 
doveadm: Refactor server/client code to support versioning properly

This way we can distinguish between old and new server side

8 years agodoveadm-server: Refactor connection handshake and authentication
Aki Tuomi [Tue, 12 Sep 2017 10:43:30 +0000 (13:43 +0300)] 
doveadm-server: Refactor connection handshake and authentication

Simplifies next change

8 years agolib: Add multiplex stream support
Aki Tuomi [Tue, 22 Aug 2017 07:14:22 +0000 (10:14 +0300)] 
lib: Add multiplex stream support

This allows having multiple channels of data in single stream.

8 years agodirector: Fix HOST-RESET-USERS when all hosts are down
Timo Sirainen [Wed, 4 Oct 2017 12:41:03 +0000 (15:41 +0300)] 
director: Fix HOST-RESET-USERS when all hosts are down

If there were a lot of users being kicked, the host was flushed after the
initial round of user kills. This caused the rest of the user connections to
be just discarded instead of actually being killed.

8 years agodirector: Fix tracking user move count when user is freed early
Timo Sirainen [Wed, 4 Oct 2017 12:39:08 +0000 (15:39 +0300)] 
director: Fix tracking user move count when user is freed early

users_moving_count wasn't updated if the user was freed before killing it
finished. This caused "doveadm director flush" to hang while waiting for
the move count to drop to 0, which it never did. Also following flushes
were doing less work in parallel, or possibly even nothing since director
thought there were too many users already being moved.

8 years agoquota-clone: Always update dict
Aki Tuomi [Wed, 4 Oct 2017 07:32:17 +0000 (10:32 +0300)] 
quota-clone: Always update dict

ret_count and ret_bytes become zero if no quota rules
are specified, so we need to update the dict anyways.

Broken in 81d10aff29baede9ae4944d6c89790871123d11d

8 years agodsync: Add hashed_headers setting
Aki Tuomi [Fri, 22 Sep 2017 10:30:43 +0000 (13:30 +0300)] 
dsync: Add hashed_headers setting

This makes it possible to configure them

8 years agodsync: Fix typo, it's ibc not icb
Aki Tuomi [Fri, 22 Sep 2017 11:08:45 +0000 (14:08 +0300)] 
dsync: Fix typo, it's ibc not icb

8 years agodsync: Add missing space to handshake optional keys
Aki Tuomi [Mon, 25 Sep 2017 07:28:03 +0000 (10:28 +0300)] 
dsync: Add missing space to handshake optional keys

8 years agodoveadm proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:02:29 +0000 (11:02 +0300)] 
doveadm proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"

8 years agolmtp proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:02:07 +0000 (11:02 +0300)] 
lmtp proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"

8 years agoauth: Avoid DNS lookup for "host" if passdb returns also "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:01:20 +0000 (11:01 +0300)] 
auth: Avoid DNS lookup for "host" if passdb returns also "hostip"