]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agoglobal: Use check-local in Makefile.am instead of overriding check directly
Timo Sirainen [Wed, 4 Oct 2017 18:45:18 +0000 (21:45 +0300)] 
global: Use check-local in Makefile.am instead of overriding check directly

This helps with dependency problems, like running "make check" in
lib-storage without "make" first would try to compile the test programs
too early and fail.

7 years agolib-sql, lib-ldap: Fix link dependencies
Timo Sirainen [Sun, 8 Oct 2017 18:08:14 +0000 (21:08 +0300)] 
lib-sql, lib-ldap: Fix link dependencies

Fixes using the gold linker.

7 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.

7 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

7 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.

7 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

7 years agoglobal: Use i_close_fd instead of close
Aki Tuomi [Fri, 6 Oct 2017 05:58:16 +0000 (08:58 +0300)] 
global: Use i_close_fd instead of close

Some were missed, found by coverity

7 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

7 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

7 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

7 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 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 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 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 agodict-sql: dict doesn't support NULL values, so convert SQL NULLs to ""
Timo Sirainen [Fri, 6 Oct 2017 12:54:47 +0000 (15:54 +0300)] 
dict-sql: dict doesn't support NULL values, so convert SQL NULLs to ""

8 years agolib-sql: Add comments about NULL values.
Timo Sirainen [Fri, 6 Oct 2017 12:52:36 +0000 (15:52 +0300)] 
lib-sql: Add comments about NULL values.

8 years agoglobal: Use PRIdTIME_T and PRIxTIME_T format specifiers
Martti Rannanjärvi [Tue, 3 Oct 2017 14:28:39 +0000 (17:28 +0300)] 
global: Use PRIdTIME_T and PRIxTIME_T format specifiers

8 years agomaster,stats: Use time_t instead of unsigned long to count seconds
Martti Rannanjärvi [Fri, 6 Oct 2017 12:10:53 +0000 (15:10 +0300)] 
master,stats: Use time_t instead of unsigned long to count seconds

8 years agom4: Add PRIdTIME_T and PRIxTIME_T format specifiers
Martti Rannanjärvi [Tue, 19 Sep 2017 16:39:19 +0000 (19:39 +0300)] 
m4: Add PRIdTIME_T and PRIxTIME_T format specifiers

8 years agoglobal: Use PRI* macros and %zu instead of casting
Martti Rannanjärvi [Tue, 19 Sep 2017 08:57:18 +0000 (11:57 +0300)] 
global: Use PRI* macros and %zu instead of casting

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 agolib-settings: Add assert to help static analyzer
Timo Sirainen [Fri, 6 Oct 2017 11:52:54 +0000 (14:52 +0300)] 
lib-settings: Add assert to help static analyzer

8 years agomail-crypt: test-mail-key - Fix potential crash on a failed test
Timo Sirainen [Fri, 6 Oct 2017 11:50:35 +0000 (14:50 +0300)] 
mail-crypt: test-mail-key - Fix potential crash on a failed test

Avoids "Uninitialized argument value" warning from static analyzer.

8 years agolib: test-mempool-alloconly - help static analyzer understand that pool is non-NULL
Timo Sirainen [Fri, 6 Oct 2017 11:48:37 +0000 (14:48 +0300)] 
lib: test-mempool-alloconly - help static analyzer understand that pool is non-NULL

8 years agolib: istream-multiplex - remove dead assignment
Timo Sirainen [Fri, 6 Oct 2017 11:43:57 +0000 (14:43 +0300)] 
lib: istream-multiplex - remove dead assignment

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 agolib: don't use foo_real()-style symbols in a header file
Josef 'Jeff' Sipek [Wed, 4 Oct 2017 13:01:43 +0000 (09:01 -0400)] 
lib: don't use foo_real()-style symbols in a header file

While there is precedent for symbols getting _real suffix to hide
implementation details, all the existing symbols were static until
the recent i_fd_close*() changes.  This commit makes this true again.

8 years agolib: move i_fd_close*() to fd-util.[ch]
Josef 'Jeff' Sipek [Wed, 4 Oct 2017 12:58:36 +0000 (08:58 -0400)] 
lib: move i_fd_close*() to fd-util.[ch]

8 years agolib: move fd_close_maybe_stdio() to fd-util.[ch]
Josef 'Jeff' Sipek [Wed, 4 Oct 2017 12:52:13 +0000 (08:52 -0400)] 
lib: move fd_close_maybe_stdio() to fd-util.[ch]

8 years agolib: move fd_set_nonblock() to fd-util.[ch]
Josef 'Jeff' Sipek [Wed, 4 Oct 2017 12:42:56 +0000 (08:42 -0400)] 
lib: move fd_set_nonblock() to fd-util.[ch]

8 years agolib: move fd-close-on-exec.[ch] code into fd-util.[ch]
Josef 'Jeff' Sipek [Wed, 4 Oct 2017 12:28:38 +0000 (08:28 -0400)] 
lib: move fd-close-on-exec.[ch] code into fd-util.[ch]

8 years agoglobal: stop including fd-set-nonblock.h & fd-close-on-exec.h directly
Josef 'Jeff' Sipek [Thu, 5 Oct 2017 17:06:09 +0000 (13:06 -0400)] 
global: stop including fd-set-nonblock.h & fd-close-on-exec.h directly

8 years agolib: always include fd-close-on-exec.h & fd-set-nonblock.h via fd-util.h
Josef 'Jeff' Sipek [Thu, 5 Oct 2017 17:05:20 +0000 (13:05 -0400)] 
lib: always include fd-close-on-exec.h & fd-set-nonblock.h via fd-util.h

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 agodict-ldap: Link directly to dict binary, unless --with-ldap=plugin was used
Timo Sirainen [Wed, 4 Oct 2017 18:13:13 +0000 (21:13 +0300)] 
dict-ldap: Link directly to dict binary, unless --with-ldap=plugin was used

This is similar to how authdb_ldap plugin is built.

8 years agodict-ldap: Move from plugins/dict-ldap to lib-dict-backend
Timo Sirainen [Wed, 4 Oct 2017 18:01:18 +0000 (21:01 +0300)] 
dict-ldap: Move from plugins/dict-ldap to lib-dict-backend

8 years agolib-dict-backend: Build test-dict-sql even without "make check"
Timo Sirainen [Wed, 4 Oct 2017 17:48:24 +0000 (20:48 +0300)] 
lib-dict-backend: Build test-dict-sql even without "make check"

There's no longer a dependency problem.

8 years agolib-dict: Move libdict_backend to lib-dict-backend
Timo Sirainen [Wed, 4 Oct 2017 17:46:10 +0000 (20:46 +0300)] 
lib-dict: Move libdict_backend to lib-dict-backend

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 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 agoglobal: Remove dead code
Timo Sirainen [Thu, 5 Oct 2017 10:42:07 +0000 (13:42 +0300)] 
global: Remove dead code

Found with clang static analyzer.

8 years agodict-memcached: Response status may not be included in enum memcached_response
Timo Sirainen [Thu, 5 Oct 2017 10:39:49 +0000 (13:39 +0300)] 
dict-memcached: Response status may not be included in enum memcached_response

This helps at least static analyzers figure out that other statuses are
possible, although unexpected.

8 years agolib-test: Use i_unreached() for marking unreachable code in test fatal handler
Timo Sirainen [Thu, 5 Oct 2017 10:26:03 +0000 (13:26 +0300)] 
lib-test: Use i_unreached() for marking unreachable code in test fatal handler

This avoids a warning with static analyzer.

8 years agoauth: LDAP request queue has no size limit anymore - remove dead code
Timo Sirainen [Thu, 5 Oct 2017 10:23:19 +0000 (13:23 +0300)] 
auth: LDAP request queue has no size limit anymore - remove dead code

8 years agombox: Remove unnecessary check from assert - move_diff is always negative here
Timo Sirainen [Thu, 5 Oct 2017 10:17:59 +0000 (13:17 +0300)] 
mbox: Remove unnecessary check from assert - move_diff is always negative here

8 years agozlib: zlib_mailbox_open_input() can't fail - remove dead code
Timo Sirainen [Thu, 5 Oct 2017 10:14:55 +0000 (13:14 +0300)] 
zlib: zlib_mailbox_open_input() can't fail - remove dead code

8 years agolib-storage: imapc_mailbox_get_selected_status() can't fail - remove dead code
Timo Sirainen [Thu, 5 Oct 2017 10:02:21 +0000 (13:02 +0300)] 
lib-storage: imapc_mailbox_get_selected_status() can't fail - remove dead code

8 years agodoveadm-server: Use i_close_fd
Aki Tuomi [Wed, 4 Oct 2017 06:42:02 +0000 (09:42 +0300)] 
doveadm-server: Use i_close_fd

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: 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 agolib: istream-file - set blocking=TRUE automatically for blocking sockets
Timo Sirainen [Wed, 4 Oct 2017 12:11:18 +0000 (15:11 +0300)] 
lib: istream-file - set blocking=TRUE automatically for blocking sockets

This fixes it to be correct with various doveadm commands.

8 years agolib: istream-file/unix - don't ignore EINTR for blocking istream reads
Timo Sirainen [Wed, 4 Oct 2017 12:08:07 +0000 (15:08 +0300)] 
lib: istream-file/unix - don't ignore EINTR for blocking istream reads

Just fail the istream read entirely. Although there's a small possibility
that this interrupt was unwanted and should be retried, it's more likely
that a blocking istream is hanging and admin wants to stop the process.
If the EINTR is ignored all the time, it's not possible to abort a
blocking read with ^C or anything else than SIGKILL.

8 years agolib: test-istream-unix - Use i_stream_set_blocking()
Timo Sirainen [Wed, 4 Oct 2017 17:14:05 +0000 (20:14 +0300)] 
lib: test-istream-unix - Use i_stream_set_blocking()

8 years agolib: Add i_stream_set_blocking()
Timo Sirainen [Wed, 4 Oct 2017 17:13:49 +0000 (20:13 +0300)] 
lib: Add i_stream_set_blocking()

8 years agolib-smtp: smtp-submit: Made submission_timeout a setting rather than a function param...
Stephan Bosch [Sat, 16 Sep 2017 11:28:32 +0000 (13:28 +0200)] 
lib-smtp: smtp-submit: Made submission_timeout a setting rather than a function parameter.

This makes it configurable.

8 years agolib-lda: Dropped now useless settings from lib-lda/lda-settings.
Stephan Bosch [Thu, 14 Sep 2017 23:46:38 +0000 (01:46 +0200)] 
lib-lda: Dropped now useless settings from lib-lda/lda-settings.

These are now in lib-smtp/smtp-submit-settings.

8 years agoimap: Drop dependencies on lib-lda settings.
Stephan Bosch [Thu, 14 Sep 2017 23:44:24 +0000 (01:44 +0200)] 
imap: Drop dependencies on lib-lda settings.

Start using lib-smtp/smtp-submit-settings instead.
Put any other settings required by IMAPSIEVE in struct imap_settings.

8 years agolib-lda: Use hostname and postmaster_address settings from mail_storage_settings...
Stephan Bosch [Wed, 20 Sep 2017 22:14:17 +0000 (00:14 +0200)] 
lib-lda: Use hostname and postmaster_address settings from mail_storage_settings where possible.

8 years agolib-lda: Use SMTP submit settings directly.
Stephan Bosch [Thu, 14 Sep 2017 23:15:19 +0000 (01:15 +0200)] 
lib-lda: Use SMTP submit settings directly.

8 years agolib-storage: Renamed duplicate to mail_duplicate.
Stephan Bosch [Wed, 4 Oct 2017 20:41:14 +0000 (22:41 +0200)] 
lib-storage: Renamed duplicate to mail_duplicate.

This makes more sense given where this is now located.

8 years agolib-lda: Moved duplicate handling to lib-storage.
Stephan Bosch [Sat, 16 Sep 2017 15:06:14 +0000 (17:06 +0200)] 
lib-lda: Moved duplicate handling to lib-storage.

8 years agolib-lda: Removed old smtp-client API.
Stephan Bosch [Thu, 14 Sep 2017 23:28:11 +0000 (01:28 +0200)] 
lib-lda: Removed old smtp-client API.

8 years agolib-storage: Added hostname, postmaster_address and recipient_delimiter settings...
Stephan Bosch [Wed, 20 Sep 2017 19:49:34 +0000 (21:49 +0200)] 
lib-storage: Added hostname, postmaster_address and recipient_delimiter settings to mail_storage_settings.

Copied from lda_settings.

8 years agolda/lmtp: Parse SMTP submit settings.
Stephan Bosch [Thu, 14 Sep 2017 23:13:18 +0000 (01:13 +0200)] 
lda/lmtp: Parse SMTP submit settings.

8 years agolda: main: main(): Put result from mail_user_var_expand_table() in a variable.
Stephan Bosch [Tue, 19 Sep 2017 19:51:14 +0000 (21:51 +0200)] 
lda: main: main(): Put result from mail_user_var_expand_table() in a variable.

Keeps code more compact, as this function is going to be called several times.

8 years agolmtp: commands: client_deliver(): Put client->state.dest_user in a variable.
Stephan Bosch [Tue, 19 Sep 2017 19:39:14 +0000 (21:39 +0200)] 
lmtp: commands: client_deliver(): Put client->state.dest_user in a variable.

Keeps code more compact, as this value is used several times.

8 years agolmtp: commands: client_deliver(): Put result from mail_user_var_expand_table() in...
Stephan Bosch [Tue, 19 Sep 2017 19:33:30 +0000 (21:33 +0200)] 
lmtp: commands: client_deliver(): Put result from mail_user_var_expand_table() in a variable.

Keeps code more compact, as this function is called several times.

8 years agolib-smtp: smtp-submit: Made settings parseable.
Stephan Bosch [Thu, 14 Sep 2017 22:10:30 +0000 (00:10 +0200)] 
lib-smtp: smtp-submit: Made settings parseable.

8 years agolib-lda: Moved most of mail_deliver_save_open() to lib-storage.
Stephan Bosch [Wed, 13 Sep 2017 23:32:17 +0000 (01:32 +0200)] 
lib-lda: Moved most of mail_deliver_save_open() to lib-storage.

This prevents the need to link Pigeonhole lib-sieve to lib-lda, which makes no sense for IMAPSIEVE.
This also allows lib-sieve to have more control over how mailboxes are opened.

8 years agolib-storage: Created mailbox_alloc_delivery(), which initializes a mailbox for messag...
Stephan Bosch [Wed, 13 Sep 2017 23:56:38 +0000 (01:56 +0200)] 
lib-storage: Created mailbox_alloc_delivery(), which initializes a mailbox for message delivery.

8 years agolib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_SUBSCRIBE.
Stephan Bosch [Wed, 13 Sep 2017 23:46:12 +0000 (01:46 +0200)] 
lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_SUBSCRIBE.

When this flag is enabled, the mailbox is implicitly subscribed to when it is created automatically.

8 years agolib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_CREATE.
Stephan Bosch [Wed, 13 Sep 2017 23:39:30 +0000 (01:39 +0200)] 
lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_CREATE.

When this flag is enabled, the mailbox is automatically created when it is opened (if possible and appropriate).

8 years agolib-storage: Implemented mailbox_is_autosubscribed().
Stephan Bosch [Tue, 19 Sep 2017 19:08:38 +0000 (21:08 +0200)] 
lib-storage: Implemented mailbox_is_autosubscribed().

Indicates whether the mailbox is automatically subscribed to when it is automatically created.

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: quota_get_resource() - return enum to make the result more exact
Timo Sirainen [Wed, 4 Oct 2017 07:46:47 +0000 (10:46 +0300)] 
quota: quota_get_resource() - return enum to make the result more exact

This is mainly to differentiate between "resource name unknown" and
"unlimited quota".

This also fixes quota_clone plugin to update quota even when quota is
unlimited. It was supposed to have been skipped only when the resource
names weren't known.

The private quota.get_resource() API is unchanged. The backends were
already returning 0 only when the resource name was unknown.

8 years agoimap-quota: Return NO reply if GETQUOTA fails only partially
Timo Sirainen [Wed, 4 Oct 2017 07:44:47 +0000 (10:44 +0300)] 
imap-quota: Return NO reply if GETQUOTA fails only partially

If the first resource lookup succeeded and the second one failed, the
GETQUOTA command replied with OK instead of NO.

8 years agodoveadm-mail: Handle parse_arg return value
Aki Tuomi [Fri, 29 Sep 2017 06:42:48 +0000 (09:42 +0300)] 
doveadm-mail: Handle parse_arg return value

Invalid parameters did not cause error.
Broken in fa6b2cbb3

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-dcrypt: Use cpu32_to_be instead of htonl
Aki Tuomi [Mon, 18 Sep 2017 12:52:12 +0000 (15:52 +0300)] 
lib-dcrypt: Use cpu32_to_be instead of htonl

prefer our own conversion functions over htonl
which is intended for networking related numbers.

8 years agoglobal: use i_close_fd{,_path}() instead of open-coding them
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 12:54:35 +0000 (15:54 +0300)] 
global: use i_close_fd{,_path}() instead of open-coding them

8 years agolib: introduce i_close_fd_path()
Josef 'Jeff' Sipek [Fri, 22 Sep 2017 07:33:51 +0000 (10:33 +0300)] 
lib: introduce i_close_fd_path()

It is like i_close_fd() but takes an argument with the name of the file
that's being closed.  The name is only used when printing the error
message due to a failed close() syscall.

8 years agolib: remove close_keep_errno()
Josef 'Jeff' Sipek [Wed, 20 Sep 2017 08:27:05 +0000 (11:27 +0300)] 
lib: remove close_keep_errno()

8 years agolib: improve i_close_fd() error message
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 13:23:30 +0000 (16:23 +0300)] 
lib: improve i_close_fd() error message

In addition to printing the file and line number, we can print the
actual arg passed in as well as the function calling i_close_fd().