]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agolib-smtp: smtp-submit: Added support for asynchronous message submission.
Stephan Bosch [Fri, 5 May 2017 15:06:32 +0000 (17:06 +0200)] 
lib-smtp: smtp-submit: Added support for asynchronous message submission.

8 years agolib-lda: Moved smtp-submit to lib-smtp.
Stephan Bosch [Fri, 5 May 2017 11:26:46 +0000 (13:26 +0200)] 
lib-lda: Moved smtp-submit to lib-smtp.

8 years agolib-lda: Made smtp-submit standalone.
Stephan Bosch [Fri, 5 May 2017 11:21:16 +0000 (13:21 +0200)] 
lib-lda: Made smtp-submit standalone.

Removed dependencies on LDA.

8 years agolib-lda: Renamed smtp-client to smtp-submit (2/2).
Stephan Bosch [Fri, 5 May 2017 11:06:39 +0000 (13:06 +0200)] 
lib-lda: Renamed smtp-client to smtp-submit (2/2).

Renamed smtp_client identifiers to smtp_submit.
Also, created temporary backwards-compatibility in smtp-client.h.

8 years agolib-lda: Renamed smtp-client to smtp-submit (1/2).
Stephan Bosch [Fri, 5 May 2017 10:55:49 +0000 (12:55 +0200)] 
lib-lda: Renamed smtp-client to smtp-submit (1/2).

Renamed the files.

8 years agolib-lda: Created tests for SMTP message submission using the smtp-client API.
Stephan Bosch [Tue, 28 Feb 2017 22:56:47 +0000 (23:56 +0100)] 
lib-lda: Created tests for SMTP message submission using the smtp-client API.

8 years agolib-storage: Preserve messages' vsize record when rebuilding index
Timo Sirainen [Fri, 8 Sep 2017 09:20:21 +0000 (12:20 +0300)] 
lib-storage: Preserve messages' vsize record when rebuilding index

Since vsize is often used by quota, losing this can be very expensive.
If the vsize is wrong, it gets fixed automatically when fetching the
message body.

8 years agocassandra: Add support for prepared statements
Timo Sirainen [Tue, 22 Aug 2017 11:35:11 +0000 (14:35 +0300)] 
cassandra: Add support for prepared statements

8 years agocassandra: Cleanup - Create statement earlier
Timo Sirainen [Tue, 22 Aug 2017 10:55:15 +0000 (13:55 +0300)] 
cassandra: Cleanup - Create statement earlier

Simplifies the following changes

8 years agocassandra: sql_transaction_commit*() cleanup - handle multiple query failures earlier
Timo Sirainen [Thu, 24 Aug 2017 08:56:38 +0000 (11:56 +0300)] 
cassandra: sql_transaction_commit*() cleanup - handle multiple query failures earlier

This makes the handling same for the sync and async method. It also
simplifies code for the following commits.

8 years agocassandra: sql_transaction_commit_s() - Set query_type correctly
Timo Sirainen [Thu, 24 Aug 2017 08:13:32 +0000 (11:13 +0300)] 
cassandra: sql_transaction_commit_s() - Set query_type correctly

The queries were all sent with READ type instead of WRITE/DELETE. This
meant they were using potentially wrong consistency values. Although
synchronous commits aren't actually used anywhere, so this practically
this doesn't fix anything right now.

8 years agocassandra: sql_transaction_commit_s() - Don't allow multi-query transactions
Timo Sirainen [Thu, 24 Aug 2017 08:09:05 +0000 (11:09 +0300)] 
cassandra: sql_transaction_commit_s() - Don't allow multi-query transactions

They were already denied for asynchronous commits. Also the synchronous
commits aren't actually used anywhere, so this shouldn't break anything.

8 years agodict-sql: Use prepared statements
Timo Sirainen [Thu, 7 Sep 2017 12:40:16 +0000 (15:40 +0300)] 
dict-sql: Use prepared statements

Create a hash table of query template -> prepared statement and fill it out
as needed. This could have been done some alternative ways that wouldn't
require building the string first, but this should still be fast enough and
much easier to implement.

8 years agodict-sql: Flush pending atomic_inc on set, and pending set on atomic_inc
Timo Sirainen [Sat, 26 Aug 2017 20:27:21 +0000 (23:27 +0300)] 
dict-sql: Flush pending atomic_inc on set, and pending set on atomic_inc

8 years agodict-sql: Cleanup - change query generator functions to return statement
Timo Sirainen [Sat, 26 Aug 2017 20:17:45 +0000 (23:17 +0300)] 
dict-sql: Cleanup - change query generator functions to return statement

Instead of query+params. This is in preparation for the following changes.

8 years agodict-sql: Cleanup - Remove unnecessary code
Timo Sirainen [Tue, 15 Aug 2017 13:50:16 +0000 (16:50 +0300)] 
dict-sql: Cleanup - Remove unnecessary code

The values are explicitly added to params. sql_dict_update_query() doesn't
add them again. Since the "diff" parameter is already a long long type,
this avoids unnecessary conversion to string and back.

8 years agodict-sql: Use sql_statement_bind_*()
Timo Sirainen [Tue, 15 Aug 2017 13:38:33 +0000 (16:38 +0300)] 
dict-sql: Use sql_statement_bind_*()

8 years agodict-sql: Add signed "int" type
Timo Sirainen [Tue, 15 Aug 2017 12:37:01 +0000 (15:37 +0300)] 
dict-sql: Add signed "int" type

8 years agodict-sql: Use sql_statement_set_timestamp() instead of adding it to query
Timo Sirainen [Tue, 15 Aug 2017 11:55:48 +0000 (14:55 +0300)] 
dict-sql: Use sql_statement_set_timestamp() instead of adding it to query

8 years agodict-sql: Initial change to use sql_statement API
Timo Sirainen [Tue, 15 Aug 2017 11:46:10 +0000 (14:46 +0300)] 
dict-sql: Initial change to use sql_statement API

sql_statement_bind_*() will be followed by later changes.

8 years agodict-sql: Remove dict_sql_build_query.inc
Timo Sirainen [Tue, 15 Aug 2017 13:44:27 +0000 (16:44 +0300)] 
dict-sql: Remove dict_sql_build_query.inc

It's no longer useful with the current code.

8 years agodict-sql: Change "uint" type to mean 64bit instead of 32bit integer.
Timo Sirainen [Tue, 15 Aug 2017 11:27:40 +0000 (14:27 +0300)] 
dict-sql: Change "uint" type to mean 64bit instead of 32bit integer.

This is likely what is usually wanted (especially in e.g. quotas).
If someone actually wants it to be restricted to 32bit, we could add
uint32 later on.

8 years agolib-sql: Add support for prepared SQL statements.
Timo Sirainen [Tue, 22 Aug 2017 08:37:17 +0000 (11:37 +0300)] 
lib-sql: Add support for prepared SQL statements.

This initial implementation doesn't use prepared statements in drivers, but
simply generates the query string internally.

8 years agolib-sql: Explicitly specify used *_vfuncs methods for drivers.
Timo Sirainen [Tue, 22 Aug 2017 08:31:51 +0000 (11:31 +0300)] 
lib-sql: Explicitly specify used *_vfuncs methods for drivers.

This allows adding more methods without modifying all the existing drivers.

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"

8 years agolib: Only deprecate rand/rand_r on recent enough compilers
Aki Tuomi [Thu, 7 Sep 2017 09:18:55 +0000 (12:18 +0300)] 
lib: Only deprecate rand/rand_r on recent enough compilers

8 years agomaster: Write all the early warnings to log file after logging is initialized
Timo Sirainen [Tue, 5 Sep 2017 17:42:31 +0000 (20:42 +0300)] 
master: Write all the early warnings to log file after logging is initialized

Any warnings (or errors) logged before settings were read and logging was
initialized caused them to be only written to stderr. This caused them to
be lost too easily. Now they are also buffered in memory and then flushed
to log files once logging is initialized.

8 years agolib: Free io_switch_callbacks_free only after other atexit-callbacks
Timo Sirainen [Thu, 7 Sep 2017 09:44:46 +0000 (12:44 +0300)] 
lib: Free io_switch_callbacks_free only after other atexit-callbacks

Fixes a crash at deinit where io_loop_remove_switch_callback() was called in
lib_atexit() callback.

8 years agoglobal: Replace random_fill_weak with random_fill
Aki Tuomi [Mon, 4 Sep 2017 12:46:39 +0000 (15:46 +0300)] 
global: Replace random_fill_weak with random_fill

They are now the same thing

8 years agoglobal: Remove random_init/random_deinit calls
Aki Tuomi [Wed, 23 Aug 2017 11:12:20 +0000 (14:12 +0300)] 
global: Remove random_init/random_deinit calls

lib already initializes it.

8 years agolib: Simplify timing_add_usecs
Aki Tuomi [Wed, 23 Aug 2017 10:42:09 +0000 (13:42 +0300)] 
lib: Simplify timing_add_usecs

i_rand is guaranteed to return 32 bit integer

8 years agolib: Warn if rand is used
Aki Tuomi [Wed, 23 Aug 2017 09:59:30 +0000 (12:59 +0300)] 
lib: Warn if rand is used

8 years agoglobal: Replace rand with i_rand
Aki Tuomi [Wed, 23 Aug 2017 09:59:42 +0000 (12:59 +0300)] 
global: Replace rand with i_rand

8 years agolib: Use best available random number generator
Aki Tuomi [Wed, 23 Aug 2017 09:49:03 +0000 (12:49 +0300)] 
lib: Use best available random number generator

The best available method is used from short list of
getrandom, arc4random or reading /dev/urandom

8 years agolib: Replace rand.c with i_rand function
Aki Tuomi [Wed, 23 Aug 2017 09:38:07 +0000 (12:38 +0300)] 
lib: Replace rand.c with i_rand function

Replacement for rand

8 years agolib: Replace rand_set_seed with srand
Aki Tuomi [Mon, 4 Sep 2017 12:22:13 +0000 (15:22 +0300)] 
lib: Replace rand_set_seed with srand

Makes following commits easier, and also
makes sure that rand() will get seeded when
used by other libraries.

8 years agolib-test: Remove rand state dump
Aki Tuomi [Wed, 23 Aug 2017 10:02:36 +0000 (13:02 +0300)] 
lib-test: Remove rand state dump

It's not possible after next commit

8 years agoconfigure: Check for getrandom
Aki Tuomi [Wed, 23 Aug 2017 09:53:50 +0000 (12:53 +0300)] 
configure: Check for getrandom

8 years agolib: lib-signals: Removed explicit notification of ioloop change through lib_signals_...
Stephan Bosch [Thu, 2 Mar 2017 22:13:48 +0000 (23:13 +0100)] 
lib: lib-signals: Removed explicit notification of ioloop change through lib_signals_reset_ioloop() in favor of implicit method.

Before, if the ioloop changed, the application had to explicitly notify lib-signals using lib_signals_reset_ioloop().
This is error-prone and requires doing this all over the Dovecot code base.
Now, lib-signals registers an ioloop switch callback that deals with this implicitly.
The application can detach lib-signals from the ioloop explicitly if delayed signal handling is not required/desired in the new ioloop.
Specific delayed signal handlers can be exempt from this automated behavior using a flag, meaning that such signal handlers need to be moved between ioloops explicitly.

8 years agolib-storage: convert dbox-multi to use container_of
Josef 'Jeff' Sipek [Fri, 1 Sep 2017 12:10:52 +0000 (15:10 +0300)] 
lib-storage: convert dbox-multi to use container_of

8 years agolib-storage: convert dbox-single to use container_of
Josef 'Jeff' Sipek [Fri, 1 Sep 2017 12:09:00 +0000 (15:09 +0300)] 
lib-storage: convert dbox-single to use container_of

8 years agolib-storage: convert dbox-common to use container_of
Josef 'Jeff' Sipek [Fri, 1 Sep 2017 12:06:54 +0000 (15:06 +0300)] 
lib-storage: convert dbox-common to use container_of

8 years agolib-storage: convert cydir to use container_of
Josef 'Jeff' Sipek [Mon, 28 Aug 2017 08:52:52 +0000 (11:52 +0300)] 
lib-storage: convert cydir to use container_of

8 years agolib-storage: convert shared to use container_of
Josef 'Jeff' Sipek [Mon, 28 Aug 2017 08:52:06 +0000 (11:52 +0300)] 
lib-storage: convert shared to use container_of

8 years agolib-storage: convert raw to use container_of
Josef 'Jeff' Sipek [Mon, 28 Aug 2017 08:51:34 +0000 (11:51 +0300)] 
lib-storage: convert raw to use container_of

8 years agolib-storage: convert imapc to use container_of
Josef 'Jeff' Sipek [Mon, 28 Aug 2017 08:50:40 +0000 (11:50 +0300)] 
lib-storage: convert imapc to use container_of

8 years agolib-storage: convert pop3c to use container_of
Josef 'Jeff' Sipek [Mon, 28 Aug 2017 08:26:20 +0000 (11:26 +0300)] 
lib-storage: convert pop3c to use container_of

8 years agolib-storage: convert mbox to use container_of
Josef 'Jeff' Sipek [Mon, 28 Aug 2017 08:24:21 +0000 (11:24 +0300)] 
lib-storage: convert mbox to use container_of

8 years agolib-storage: convert maildir to use container_of
Josef 'Jeff' Sipek [Mon, 28 Aug 2017 08:15:45 +0000 (11:15 +0300)] 
lib-storage: convert maildir to use container_of

8 years agolib: introduce container_of
Josef 'Jeff' Sipek [Tue, 13 Sep 2016 19:01:56 +0000 (15:01 -0400)] 
lib: introduce container_of

This is a simple but type safe implementation.

8 years agolib-storage: rename IMAPC_CONTEXT to IMAPC_SEARCHCTX
Josef 'Jeff' Sipek [Fri, 1 Sep 2017 11:57:20 +0000 (14:57 +0300)] 
lib-storage: rename IMAPC_CONTEXT to IMAPC_SEARCHCTX

8 years agoauth: Rename overlooked "original_username" after c3e50b
Manuel Mausz [Mon, 4 Sep 2017 14:52:01 +0000 (16:52 +0200)] 
auth: Rename overlooked "original_username" after c3e50b

In c3e50b854dec3f9a51dbaecf2ee56197125a003f "original_username" field got renamed to "original-username".

8 years agodoveadm-server: http: Fixed crash occurring when disconnecting a client at server...
Stephan Bosch [Sun, 18 Jun 2017 17:55:23 +0000 (19:55 +0200)] 
doveadm-server: http: Fixed crash occurring when disconnecting a client at server deinit.

8 years ago*-login: Cache director_username_hash between KICK-DIRECTOR-HASH commands
Timo Sirainen [Wed, 19 Jul 2017 13:53:17 +0000 (16:53 +0300)] 
*-login: Cache director_username_hash between KICK-DIRECTOR-HASH commands

This should make the kicking much faster, which is important when director
is moving thousands of users.

8 years agolib-mail: Make sure mail_user_hash() won't return 0 as the hash.
Timo Sirainen [Wed, 19 Jul 2017 13:49:18 +0000 (16:49 +0300)] 
lib-mail: Make sure mail_user_hash() won't return 0 as the hash.

It doesn't seem to actually happen, but this makes sure of it.

8 years agodoveadm-fs: Fix argument handling
Aki Tuomi [Sun, 27 Aug 2017 10:55:52 +0000 (13:55 +0300)] 
doveadm-fs: Fix argument handling

If argument contains - and needs to be passed to doveadm-fs
then it needs -- to make sure getopt won't choke on it, and
due to this, we need to use getopt in doveadm-fs too, to make
sure -- gets removed.

8 years agodoveadm-dict: Convert to new parameter handling
Aki Tuomi [Sun, 27 Aug 2017 09:50:35 +0000 (12:50 +0300)] 
doveadm-dict: Convert to new parameter handling

Fixes problems with negative numbers as parameters

8 years agodoveadm: Make sure positional arguments end up in right place
Aki Tuomi [Sun, 27 Aug 2017 09:57:51 +0000 (12:57 +0300)] 
doveadm: Make sure positional arguments end up in right place

Otherwise -- is placed into wrong place and breaks command line
reparsing in legacy functions.

8 years agoinit: Execute /etc/default/dovecot on init, if it exists
Tom Sommer [Tue, 7 Feb 2017 12:06:31 +0000 (13:06 +0100)] 
init: Execute /etc/default/dovecot on init, if it exists

8 years agoinit: Execute /etc/sysconfig/dovecot on init, if it exists
Tom Sommer [Thu, 12 Jan 2017 09:02:13 +0000 (10:02 +0100)] 
init: Execute /etc/sysconfig/dovecot on init, if it exists

Helps users set `ulimit`, `DAEMON` etc. without having to touch the init.d script.

8 years agoauth: cache: don't log password mismatch twice
manuel [Mon, 4 Sep 2017 15:43:31 +0000 (17:43 +0200)] 
auth: cache: don't log password mismatch twice

If auth cache is enabled and the last auth was successful dovecot assumes the
password has been changed and invalidates the cache which results in
double logging of the same password mismatch.
This also applies to expired negative cache entries.

8 years agodsync: Ignore missing remote mailbox when doing unidirectional sync
Aki Tuomi [Tue, 5 Sep 2017 07:43:46 +0000 (10:43 +0300)] 
dsync: Ignore missing remote mailbox when doing unidirectional sync

If there are some folders on remote system that
are being ignored by remote brain, do not error out.

8 years agolib-storage: Fix INBOX notifications to set correct events
Timo Sirainen [Mon, 4 Sep 2017 14:48:52 +0000 (17:48 +0300)] 
lib-storage: Fix INBOX notifications to set correct events

This fixes IMAP NOTIFY so it doesn't send STATUS notifications to INBOX when
it doesn't have to.

8 years agolib-storage: List index notify cleanup - move code to separate functions
Timo Sirainen [Mon, 4 Sep 2017 14:37:05 +0000 (17:37 +0300)] 
lib-storage: List index notify cleanup - move code to separate functions

No functional changes. In preparation for the next commit.

8 years agolib-storage: Remove INBOX notification checks if mailbox events aren't requested
Timo Sirainen [Mon, 4 Sep 2017 13:59:52 +0000 (16:59 +0300)] 
lib-storage: Remove INBOX notification checks if mailbox events aren't requested

Nothing would be done with the results of those checks.

Note that MAILBOX_LIST_NOTIFY_UIDVALIDITY can be handled using mailbox list
index, even for INBOX with mailbox_list_index_include_inbox=no.

8 years agolib-storage: Optimize INBOX notifications with mailbox_list_index_include_inbox=yes
Timo Sirainen [Mon, 4 Sep 2017 13:55:30 +0000 (16:55 +0300)] 
lib-storage: Optimize INBOX notifications with mailbox_list_index_include_inbox=yes

There's no need for special INBOX checks in that case, because INBOX is
tracked in the mailbox list index the same as any other mailbox.

8 years agopop3-migration: Strip away invalid header lines.
Timo Sirainen [Mon, 4 Sep 2017 09:40:49 +0000 (12:40 +0300)] 
pop3-migration: Strip away invalid header lines.

If there's no ":" in the header, remove it. Fixes matching mails with
Zimbra.

8 years agoexample-config: Update mail_temp_dir comment
Timo Sirainen [Mon, 4 Sep 2017 10:25:38 +0000 (13:25 +0300)] 
example-config: Update mail_temp_dir comment

8 years agopop3-migration: Fail if all IMAP mails were matched by size, but POP3 had extra mails
Timo Sirainen [Mon, 4 Sep 2017 16:37:12 +0000 (19:37 +0300)] 
pop3-migration: Fail if all IMAP mails were matched by size, but POP3 had extra mails

This makes the handling same as what happens when the same situation happens
and the last mails were matched by headers. That's an error, unless
pop3_migration_ignore_*_uidls=yes.

8 years agopop3-migration: Add pop3_migration_ignore_extra_uidls=yes setting
Timo Sirainen [Mon, 4 Sep 2017 15:32:15 +0000 (18:32 +0300)] 
pop3-migration: Add pop3_migration_ignore_extra_uidls=yes setting

8 years agonotify-status: Provide access to all easy fields
Aki Tuomi [Mon, 4 Sep 2017 12:32:24 +0000 (15:32 +0300)] 
notify-status: Provide access to all easy fields

8 years agolib: Preallocate output space for base64 encoding
compmaniak [Wed, 30 Aug 2017 22:59:22 +0000 (01:59 +0300)] 
lib: Preallocate output space for base64 encoding

8 years agolib: Reduced conditional logic in base64_encode
compmaniak [Wed, 30 Aug 2017 22:25:22 +0000 (01:25 +0300)] 
lib: Reduced conditional logic in base64_encode

8 years agolib: Fix MAX_BASE64_ENCODED_SIZE macro
compmaniak [Wed, 30 Aug 2017 22:04:48 +0000 (01:04 +0300)] 
lib: Fix MAX_BASE64_ENCODED_SIZE macro

8 years agolib: optimize nearest_power
Josef 'Jeff' Sipek [Wed, 30 Aug 2017 10:51:20 +0000 (13:51 +0300)] 
lib: optimize nearest_power

Instead of looping over each bit of a size_t, we can use a closed form
expression.

8 years agolib-compression: Fix assert in i_stream_zlib_seek
Anton Yuzhaninov [Thu, 31 Aug 2017 00:49:17 +0000 (20:49 -0400)] 
lib-compression: Fix assert in i_stream_zlib_seek

Also fix same bug in i_stream_bzlib_seek, i_stream_lz4_seek, i_stream_lzma_seek.

8 years agodb-oauth2: Add some debugging
Aki Tuomi [Wed, 30 Aug 2017 06:50:48 +0000 (09:50 +0300)] 
db-oauth2: Add some debugging

8 years agolib-http: client: Improved absolute request timeout error message.
Stephan Bosch [Mon, 28 Aug 2017 22:24:46 +0000 (00:24 +0200)] 
lib-http: client: Improved absolute request timeout error message.

Now mentions that it is the absolute timeout.
Provides the request statistics also provided for the regular attempt timeout message.

8 years agosdbox: Don't open mail files when expunging
Timo Sirainen [Fri, 25 Aug 2017 15:40:23 +0000 (18:40 +0300)] 
sdbox: Don't open mail files when expunging

It was done when mail_attachment_fs was non-empty (and default is
non-empty), even though mail_attachment_dir was empty.

8 years agolib-storage: mail_storage_set_critical() - don't free old error_string too early
Timo Sirainen [Fri, 25 Aug 2017 15:02:44 +0000 (18:02 +0300)] 
lib-storage: mail_storage_set_critical() - don't free old error_string too early

It may be used in one of the parameters.

8 years agoimap: Add debug logging for [un]hibernation
Timo Sirainen [Fri, 25 Aug 2017 16:38:20 +0000 (19:38 +0300)] 
imap: Add debug logging for [un]hibernation

The logs should now clearly say when a client was hibernated and when/why
it was was unhibernated.

8 years agoquota dict: Log when quota is recalculated if mail_debug=yes
Timo Sirainen [Fri, 25 Aug 2017 16:53:36 +0000 (19:53 +0300)] 
quota dict: Log when quota is recalculated if mail_debug=yes

8 years agodirector: Run director/host changing doveadm commands only after ring is synced
Timo Sirainen [Fri, 18 Aug 2017 08:51:36 +0000 (11:51 +0300)] 
director: Run director/host changing doveadm commands only after ring is synced

If the ring sync is still pending, the doveadm command may become reverted.
This doesn't fully prevent problems caused by sending doveadm commands
simultaneously to multiple directors, but it should prevent issues when
only a single director is used for doveadm commands.

It would have been nice to enable this also for HOST/DIRECTOR-LIST commands,
but they don't support returning a ring timeout error without changing the
protocol. It's a bit too much effort to change that for now.

8 years agodirector: doveadm HOST-* commands now wait for ring sync before returning OK
Timo Sirainen [Mon, 14 Aug 2017 07:29:47 +0000 (10:29 +0300)] 
director: doveadm HOST-* commands now wait for ring sync before returning OK

This should make it easier for tests and maybe for scripts in general, so
they won't think the command failed when it just takes a while to finish.

8 years agodirector: Cleanup - Doveadm commands now return enum doveadm_director_cmd_ret
Timo Sirainen [Mon, 14 Aug 2017 07:06:34 +0000 (10:06 +0300)] 
director: Cleanup - Doveadm commands now return enum doveadm_director_cmd_ret

8 years agodirector: Cleanup - Move all doveadm commands into an array.
Timo Sirainen [Mon, 14 Aug 2017 07:01:01 +0000 (10:01 +0300)] 
director: Cleanup - Move all doveadm commands into an array.

8 years agomdbox: Use mail_storage_set_index_error() instead of poorly duplicating it
Timo Sirainen [Mon, 21 Aug 2017 12:44:41 +0000 (15:44 +0300)] 
mdbox: Use mail_storage_set_index_error() instead of poorly duplicating it

8 years agolib-storage: Add mail_storage_set_index_error()
Timo Sirainen [Mon, 21 Aug 2017 12:34:40 +0000 (15:34 +0300)] 
lib-storage: Add mail_storage_set_index_error()

8 years agolib-storage: index_mail_set_cache_corrupted() - Don't reset internal error string
Timo Sirainen [Mon, 21 Aug 2017 12:29:46 +0000 (15:29 +0300)] 
lib-storage: index_mail_set_cache_corrupted() - Don't reset internal error string

It's already set correctly by the earlier functions.

8 years agolib-storage: mail_set_mail_cache_corrupted() - set also internal error string
Timo Sirainen [Mon, 21 Aug 2017 12:27:48 +0000 (15:27 +0300)] 
lib-storage: mail_set_mail_cache_corrupted() - set also internal error string

8 years agolib-storage: mailbox_set_index_error() - Set internal error string to index's error
Timo Sirainen [Mon, 21 Aug 2017 12:26:13 +0000 (15:26 +0300)] 
lib-storage: mailbox_set_index_error() - Set internal error string to index's error

8 years agolib-storage: Fix error logging after mail_storage_set_internal_error()
Timo Sirainen [Mon, 21 Aug 2017 12:11:30 +0000 (15:11 +0300)] 
lib-storage: Fix error logging after mail_storage_set_internal_error()

The function doesn't actually set the last_internal_error and it also
doesn't update last_error_is_internal, so calling
mail_storage_get_last_internal_error() afterwards could be returning an
error for some different older error.

Since there's no parameter to set the internal error string, just reset
last_error_is_internal=FALSE.

8 years agolib-index: Avoid opening .log.2 file if .log was reset
Timo Sirainen [Fri, 25 Aug 2017 12:12:06 +0000 (15:12 +0300)] 
lib-index: Avoid opening .log.2 file if .log was reset

After a reset there's no point in trying to read the older log files.
This avoids trying to open .log.2 at least for newly created mailboxes
when trying to lookup log file sequence 1 (since due to some bug/feature
the log files start from sequence 2).

8 years agolog: Log a warning for each service that still has processes at shutdown
Timo Sirainen [Thu, 24 Aug 2017 14:01:34 +0000 (17:01 +0300)] 
log: Log a warning for each service that still has processes at shutdown

This makes it clearer which services are causing log process to hang, and
also which processes may have their logging discarded afterwards.

8 years agolog: Include PID in prefix for internal log messages.
Timo Sirainen [Thu, 24 Aug 2017 14:00:30 +0000 (17:00 +0300)] 
log: Include PID in prefix for internal log messages.

8 years agomaster: Log "Processes aren't dying after reload" only when signals are sent
Timo Sirainen [Thu, 24 Aug 2017 13:31:40 +0000 (16:31 +0300)] 
master: Log "Processes aren't dying after reload" only when signals are sent

This required moving the warning after the "Sent SIG.. to .. processes"
warnings, which is a little bit annoying. However, now it's at least not
unnecessarily logging the warning when it's not doing anything about the
processes.

8 years agomaster: Improve killing processes when they don't die after reload
Timo Sirainen [Thu, 24 Aug 2017 13:24:21 +0000 (16:24 +0300)] 
master: Improve killing processes when they don't die after reload

The old behavior was:
1. Send SIGTERM to all processes, except log
2. Send SIGTERM to all processes, including log
3. Send SIGKILL to all processes, including log

The new behavior is now:
1. Send SIGTERM to all processes, except log
2. Send SIGKILL to all processes, except log

Only after there aren't any processes left except log, send SIGTERM to it.
If that doesn't work, send SIGKILL.

8 years agopop3-migration: Try to assign UIDLs based on dovecot.index.cache
Timo Sirainen [Fri, 25 Aug 2017 10:38:35 +0000 (13:38 +0300)] 
pop3-migration: Try to assign UIDLs based on dovecot.index.cache

Add the UIDLs to (imapc) mailbox cache after they've been assigned.
Try to read them from the cache on the next sync to avoid reading
mails' headers.

This can be disabled with pop3_migration_skip_uidl_cache=yes, just in case
there's some kind of a problem with it.