]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
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.
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.
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.
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
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.
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.
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
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.
Josef 'Jeff' Sipek [Wed, 20 Sep 2017 08:27:05 +0000 (11:27 +0300)]
lib: remove close_keep_errno()
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().
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 13:17:45 +0000 (16:17 +0300)]
lib: print correct error string on i_close_fd() failure
close_keep_errno() preserved the original errno, therefore the %m in
i_close_fd()'s error message printed an unrelated error string.
Aki Tuomi [Mon, 25 Sep 2017 07:08:16 +0000 (10:08 +0300)]
dovecot.service: Update systemd file
There is no point daemonizing dovecot in systemd, also added
comment about apparmor and NoNewPrivileges option.
Aki Tuomi [Wed, 27 Sep 2017 11:07:46 +0000 (14:07 +0300)]
lib-test: Suppress expected error messages
Unless pattern is also provided
Martti Rannanjärvi [Fri, 29 Sep 2017 09:37:58 +0000 (12:37 +0300)]
lib-storage: Remove obsolete mailbox_save_set_dest_mail()
Stephan Bosch [Fri, 29 Sep 2017 15:22:50 +0000 (17:22 +0200)]
configure.ac: Wrapped long LIBDOVECOT_LA_LIBS definition line to make modifications easier.
Sergey Kitov [Mon, 2 Oct 2017 10:25:42 +0000 (13:25 +0300)]
auth: global rounds parameter replaced with argument to password_generate()
username and rounds parameter moved to a single
password_generate_params structure.
Martti Rannanjärvi [Thu, 28 Sep 2017 17:18:19 +0000 (20:18 +0300)]
doveadm: Use doveadm command name as reason in doveadm_mail_iter_init()
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
Aki Tuomi [Fri, 22 Sep 2017 11:08:45 +0000 (14:08 +0300)]
dsync: Fix typo, it's ibc not icb
Aki Tuomi [Mon, 25 Sep 2017 07:28:03 +0000 (10:28 +0300)]
dsync: Add missing space to handshake optional keys
Timo Sirainen [Tue, 26 Sep 2017 14:23:32 +0000 (16:23 +0200)]
dsync: Improve reason when logging "modseq .. no longer in transaction log"
Show the current highest, as well as the last common UID and the current
next UID. These can help to try to figure out problems.
Sergey Kitov [Wed, 20 Sep 2017 08:34:49 +0000 (11:34 +0300)]
global: remove unnecessary ENOENT checks from unlink_directory() calls
Sergey Kitov [Wed, 20 Sep 2017 07:46:16 +0000 (10:46 +0300)]
lib: unlink_directory() return value is changed to 1 in case of no error.
Sergey Kitov [Wed, 20 Sep 2017 07:45:26 +0000 (10:45 +0300)]
lib: unlink_directory_r() is refactored.
unlinking doesn't stop at unlink() errors, first error is written to
error_r, consequent errors are logged via i_error errno set to first
happened error. unlink_directory_r() is expecting *error_r to be set
to NULL. errno is set to 0 before each call to readdir().
Timo Sirainen [Fri, 22 Sep 2017 10:48:46 +0000 (13:48 +0300)]
mail-crypt: Fix linking order
Timo Sirainen [Fri, 22 Sep 2017 11:10:09 +0000 (14:10 +0300)]
lib: Define i_unreached() to __builtin_unreachable() with STATIC_CHECKER
This helps clang's alpha.deadcode.UnreachableCode checker.
Martti Rannanjärvi [Fri, 22 Sep 2017 12:07:25 +0000 (15:07 +0300)]
replication-plugin: Debug-log mailbox transaction reason
Martti Rannanjärvi [Wed, 20 Sep 2017 14:15:32 +0000 (17:15 +0300)]
lib-storage: Add reason to mailbox.transaction_begin()
Martti Rannanjärvi [Wed, 20 Sep 2017 11:42:00 +0000 (14:42 +0300)]
lib-storage: Add reason to mailbox_transaction_begin()
Remove mailbox_transaction_set_reason().
Timo Sirainen [Fri, 22 Sep 2017 10:34:47 +0000 (13:34 +0300)]
configure: Fix link order: libsmtp depends on libprogram-client
Martti Rannanjärvi [Thu, 21 Sep 2017 18:49:09 +0000 (21:49 +0300)]
lib-storage: Don't crash when opening inbox fails in mailbox-list-index-notify
Timo Sirainen [Thu, 21 Sep 2017 12:53:40 +0000 (15:53 +0300)]
lib-sql: Fix compiler warning with OSX
Timo Sirainen [Thu, 21 Sep 2017 14:53:04 +0000 (17:53 +0300)]
master: Don't throttle services that are already being destroyed
If process couldn't be created, because the service_list is already being
destroyed (e.g. due to reload), also don't enable unnecessary throttling
for the service.
Hopefully fixes these random errors that are logged alone:
master: Error: service(...): command startup failed, throttling for 2 secs
Timo Sirainen [Tue, 19 Sep 2017 10:52:30 +0000 (13:52 +0300)]
lib: If log writing to log process is blocking, show it in process title
This change also makes the log pipe non-blocking.
Timo Sirainen [Tue, 19 Sep 2017 10:49:03 +0000 (13:49 +0300)]
lib: Add process_title_get()
Timo Sirainen [Wed, 20 Sep 2017 16:09:58 +0000 (19:09 +0300)]
Add <%{pid}> to default mail_log_prefix
It's especially useful nowadays when the same session ID can be reused by
multiple processes with IMAP hibernation enabled.
Timo Sirainen [Wed, 20 Sep 2017 12:56:10 +0000 (15:56 +0300)]
doveadm: "Extraneous arguments found": Show the args in the error
Stephan Bosch [Wed, 20 Sep 2017 22:38:33 +0000 (00:38 +0200)]
lib-http: client: Send empty payload (Content-Length: 0) for requests that normally expect a payload.
This includes the standard POST and PUT methods.
Others need to use the new http_client_request_set_payload_empty() function to force sending an empty payload.
Timo Sirainen [Wed, 20 Sep 2017 12:03:55 +0000 (15:03 +0300)]
notify-status plugin: Use priv/status/<mailbox> for keys
priv/<mailbox>/status can't be used with dict-sql when <mailbox> has '/'.
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 10:33:06 +0000 (13:33 +0300)]
global: start relying on buffer_free(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- buffer_free(&E);
- }
+ buffer_free(&E);
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 10:26:57 +0000 (13:26 +0300)]
lib: buffer_free(NULL) should be a no-op
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 10:25:23 +0000 (13:25 +0300)]
global: start relying on pool_unref(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- pool_unref(&E);
- }
+ pool_unref(&E);
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 10:21:07 +0000 (13:21 +0300)]
lib: pool_unref(NULL) shoud be a no-op
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 10:19:36 +0000 (13:19 +0300)]
global: start relying on [io]_stream_unref(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- i_stream_unref(&E);
- }
+ i_stream_unref(&E);
@@
expression E;
@@
- if (E != NULL) {
- o_stream_unref(&E);
- }
+ o_stream_unref(&E);
Josef 'Jeff' Sipek [Tue, 19 Sep 2017 10:09:07 +0000 (13:09 +0300)]
lib: [io]_stream_unref(NULL) should be a no-op
Josef 'Jeff' Sipek [Tue, 6 Jun 2017 09:53:41 +0000 (12:53 +0300)]
global: start relying on [io]_stream_destroy(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- i_stream_destroy(&E);
- }
+ i_stream_destroy(&E);
@@
expression E;
@@
- if (E != NULL) {
- o_stream_destroy(&E);
- }
+ o_stream_destroy(&E);
Josef 'Jeff' Sipek [Tue, 6 Jun 2017 09:49:00 +0000 (12:49 +0300)]
lib: [io]_stream_destroy(NULL) should be a no-op
Josef 'Jeff' Sipek [Tue, 6 Jun 2017 09:33:23 +0000 (12:33 +0300)]
global: start relying on timeout_remove(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- timeout_remove(&E);
- }
+ timeout_remove(&E);
Josef 'Jeff' Sipek [Tue, 6 Jun 2017 09:30:17 +0000 (12:30 +0300)]
lib: timeout_remove(NULL) should be a no-op
Josef 'Jeff' Sipek [Tue, 6 Jun 2017 09:28:07 +0000 (12:28 +0300)]
global: start relying on io_remove{,_closed}(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- io_remove(&E);
- }
+ io_remove(&E);
@@
expression E;
@@
- if (E != NULL) {
- io_remove_closed(&E);
- }
+ io_remove_closed(&E);
Josef 'Jeff' Sipek [Tue, 6 Jun 2017 09:19:22 +0000 (12:19 +0300)]
lib: io_remove(NULL) and io_remove_closed(NULL) should be no-ops
Josef 'Jeff' Sipek [Tue, 6 Jun 2017 07:20:49 +0000 (10:20 +0300)]
global: start relying on i_close_fd(-1) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != -1)
- i_close_fd(&E);
+ i_close_fd(&E);
Josef 'Jeff' Sipek [Tue, 6 Jun 2017 07:13:15 +0000 (10:13 +0300)]
lib: i_close_fd(-1) should be a no-op
Timo Sirainen [Tue, 19 Sep 2017 22:47:38 +0000 (01:47 +0300)]
director: Fix flush to kick the user also when all backends are down
The user's host can't change, because there are no other hosts. So add a
new parameter to force the kick anyway.
Timo Sirainen [Tue, 19 Sep 2017 11:48:54 +0000 (14:48 +0300)]
cassandra: Timestamp should be in microseconds, not milliseconds
Josef 'Jeff' Sipek [Mon, 18 Sep 2017 11:15:44 +0000 (14:15 +0300)]
global: use i_rand_limit() and i_rand_minmax() when possible
Josef 'Jeff' Sipek [Mon, 18 Sep 2017 10:55:08 +0000 (13:55 +0300)]
lib: introduce i_rand_limit() and i_rand_minmax()
Josef 'Jeff' Sipek [Mon, 18 Sep 2017 13:48:41 +0000 (16:48 +0300)]
lib-index: fix off-by-one in index flag update test
When selecting the second seq, the max value we should generate is
hdr.messages_count - not one less than that.
Timo Sirainen [Tue, 19 Sep 2017 08:18:30 +0000 (11:18 +0300)]
lib-storage: Fail if two namespaces try to wrongly share the same LISTINDEX
If they have different mailboxes-path, they can't be sharing the same
mailbox list index. The previous behavior caused Dovecot to silently
overwrite the list index whenever each of the namespaces were accessed,
resulting in bad performance.
Timo Sirainen [Mon, 18 Sep 2017 20:04:55 +0000 (23:04 +0300)]
notify-status: Remove first_unseen_seq field
The sequence number keeps changing, so it's very unlikely to be useful.
It's also not always as efficiently available as the other fields, so
better to avoid having it.
Josef 'Jeff' Sipek [Thu, 7 Sep 2017 11:26:51 +0000 (14:26 +0300)]
lib-storage: convert struct pop3_mail casts to container_of
Josef 'Jeff' Sipek [Thu, 7 Sep 2017 11:11:06 +0000 (14:11 +0300)]
lib-storage: convert struct imapc_mail casts to container_of
Josef 'Jeff' Sipek [Thu, 7 Sep 2017 10:04:01 +0000 (13:04 +0300)]
lib-storage: convert index to use container_of
Josef 'Jeff' Sipek [Thu, 7 Sep 2017 11:29:08 +0000 (14:29 +0300)]
lib-storage: convert missed mbox casts to container_of
Josef 'Jeff' Sipek [Thu, 7 Sep 2017 11:28:27 +0000 (14:28 +0300)]
lib-storage: convert missed raw storage casts to container_of
Josef 'Jeff' Sipek [Thu, 7 Sep 2017 11:24:46 +0000 (14:24 +0300)]
lib-storage: convert missed maildir casts to container_of
Josef 'Jeff' Sipek [Thu, 7 Sep 2017 11:21:03 +0000 (14:21 +0300)]
lib-storage: convert missed imapc casts to container_of
Josef 'Jeff' Sipek [Thu, 7 Sep 2017 11:08:44 +0000 (14:08 +0300)]
lib-storage: convert missed cydir casts to container_of
Sergey Kitov [Fri, 15 Sep 2017 12:17:08 +0000 (15:17 +0300)]
auth: Expand %{ldap_dn} to ldap_get_dn().
Timo Sirainen [Thu, 14 Sep 2017 09:50:29 +0000 (12:50 +0300)]
director: Avoid "ring sync timeout" errors when all backends are down
doveadm commands were failing with it. Also pending request failures were
logged as failing due to ring sync timeout, instead of because no hosts.
Timo Sirainen [Thu, 14 Sep 2017 10:02:40 +0000 (13:02 +0300)]
director: Delay calling state_change_callback() after user kick is finished
Otherwise it can get into recursive loop and cause problems.
Timo Sirainen [Thu, 14 Sep 2017 09:42:13 +0000 (12:42 +0300)]
doveadm director: Improve logging unexpected disconnections from director socket
Previously it just logged "failed", which wasn't very understandable.
Timo Sirainen [Tue, 22 Aug 2017 13:32:32 +0000 (16:32 +0300)]
director: Fix crash when flush is run and all backends are down.
Instead of moving the users elsewhere, just kill them and flush the backend.
Timo Sirainen [Fri, 15 Sep 2017 08:49:16 +0000 (11:49 +0300)]
lib: uri_parser_init*() - initialize allow_pct_nul
Unless the caller explicitly cleared the parser's memory, allow_pct_nul was
somewhat random. All the code in Dovecot core did this, but some plugins
didn't.
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.
Timo Sirainen [Thu, 14 Sep 2017 14:59:05 +0000 (17:59 +0300)]
director: Ignore CONNECT requests to hosts that have been removed already
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.
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.
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.
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.
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.
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.
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
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.
Aki Tuomi [Thu, 14 Sep 2017 10:34:22 +0000 (13:34 +0300)]
lib: chdir to / after chroot
Makes static analyzers more happy
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.
Timo Sirainen [Thu, 14 Sep 2017 10:19:26 +0000 (13:19 +0300)]
director: Return temporary auth failures using the new "code" field
The "temp" is no longer used.
Timo Sirainen [Wed, 13 Sep 2017 20:35:04 +0000 (23:35 +0300)]
lib-mail: message_header_encode() cleanup - simplify pointer arithmetic
This should make static analyzers happier.
Timo Sirainen [Wed, 13 Sep 2017 20:26:49 +0000 (23:26 +0300)]
global: Add asserts to help static analyzers
Timo Sirainen [Wed, 13 Sep 2017 20:24:01 +0000 (23:24 +0300)]
lib-index: Remove size from struct mail_keywords.idx[]
This was confusing static analyzers, which thought that using [1] meant that
its size really was 1.
Timo Sirainen [Wed, 13 Sep 2017 15:06:43 +0000 (18:06 +0300)]
man: Remove extra ^L from "doveadm fetch" example
It's no longer sent.
Timo Sirainen [Wed, 13 Sep 2017 13:13:34 +0000 (16:13 +0300)]
lib-storage: Fix updating mailbox GUID in mailbox list index when it's empty
Normally the GUID shouldn't be empty at this point. Updating mailbox GUID is
also very rare. So this was unlikely to cause any problems in practise.
Timo Sirainen [Wed, 13 Sep 2017 13:09:05 +0000 (16:09 +0300)]
master: Don't send uninitialized byte to anvil along the log fd.
The byte was ignored by anvil, so it didn't cause any real problems.
Timo Sirainen [Wed, 13 Sep 2017 13:06:48 +0000 (16:06 +0300)]
cassandra: NULL values' sizes weren't initialized
This was only a problem if sql_result_get_field_value_binary() was
attempted to be used for a NULL value.
Timo Sirainen [Wed, 13 Sep 2017 15:32:23 +0000 (18:32 +0300)]
lib-index: If mail_index_view is leaked, include in Panic the file:line where it was opened
Timo Sirainen [Wed, 13 Sep 2017 12:16:59 +0000 (15:16 +0300)]
cassandra: Fix paged queries to work again
When continuing the result, consistency was reset to 0 (=ANY), which caused
the queries to fail. There's no need to initialize the statement again when
continuing it. Also set result->consistency to be correct mainly for
debugging purposes.
Timo Sirainen [Mon, 11 Sep 2017 09:27:17 +0000 (12:27 +0300)]
lib-storage: Fix mailbox list notification assert-crash when mailbox is deleted
Reproduced with if IMAP NOTIFY is used for non-selected mailboxes without
MailboxName being specified. Another session then does changes to a
mailbox and immediately deletes it, which causes the crash.
Fixes:
Panic: file mailbox-list-index-notify.c: line 751: unreached
Stephan Bosch [Tue, 12 Sep 2017 22:28:38 +0000 (00:28 +0200)]
lib-smtp: lmtp-client: Fixed handling of unexpected reply while sending RCPT TO commands.
It caused a segfault.
Timo Sirainen [Fri, 8 Sep 2017 13:00:53 +0000 (16:00 +0300)]
doveadm director kick: Fix -f parameter to work
It already worked as --passdb-field, but now it matches the usage string.
Timo Sirainen [Mon, 11 Sep 2017 09:59:27 +0000 (12:59 +0300)]
lib-index: mail_index_use_existing_permissions() - Ignore with INDEX=MEMORY