]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
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.

8 years agopop3-migration: Delete unnecessary POP3 order checking code
Timo Sirainen [Fri, 25 Aug 2017 10:36:11 +0000 (13:36 +0300)] 
pop3-migration: Delete unnecessary POP3 order checking code

Nothing is actually using the result.

8 years agolib-storage: Support LISTINDEX= to disable it
Timo Sirainen [Fri, 25 Aug 2017 10:16:26 +0000 (13:16 +0300)] 
lib-storage: Support LISTINDEX= to disable it

8 years agolib-settings: Escape comma in section name.
Sergey Kitov [Thu, 24 Aug 2017 07:01:02 +0000 (10:01 +0300)] 
lib-settings: Escape comma in section name.

Comma is valid symbol in encoded non-ascii section names, so it
shouldn't be used as splitting symbol in section name.

8 years agoquota plugin: restructure quota_root_get_rule_limits() 46/head
Josef 'Jeff' Sipek [Fri, 18 Aug 2017 12:29:09 +0000 (15:29 +0300)] 
quota plugin: restructure quota_root_get_rule_limits()

If the user has unlimited quota, we have no reason to find the real
mailbox name.

8 years agoapparmor: Call super deinit function
Aki Tuomi [Wed, 23 Aug 2017 10:14:50 +0000 (13:14 +0300)] 
apparmor: Call super deinit function

Otherwise user won't get properly deinitialized, forgotten in
a7a0f3196b2b97577ebd9e804507d58e67508fcf

8 years agolib-storage: Call mail_cache_close_mail() when mail is closed
Timo Sirainen [Fri, 18 Aug 2017 14:38:34 +0000 (17:38 +0300)] 
lib-storage: Call mail_cache_close_mail() when mail is closed

Fixes caching problems with INDEX=MEMORY

8 years agolib-index: Add mail_cache_close_mail() to smartly drop cached data with INDEX=MEMORY
Timo Sirainen [Fri, 18 Aug 2017 14:34:14 +0000 (17:34 +0300)] 
lib-index: Add mail_cache_close_mail() to smartly drop cached data with INDEX=MEMORY

Instead of reseting the entire transaction buffer when 256 kB is reached,
just drop mails have have been marked closed with mail_cache_close_mail().
If that's not enough, continue deleting forcibly until the buffer is below
256 kB.

This is especially important when mail_prefetch_count>0 and INDEX=MEMORY.
In that case there can be multiple mails that are being added to cache
and used later on. If they were dropped from cache too early, the work
would have to be done all over again.

8 years agodoveadm: Actually use resolved IP address(es) in director flush
Aki Tuomi [Fri, 18 Aug 2017 11:58:37 +0000 (14:58 +0300)] 
doveadm: Actually use resolved IP address(es) in director flush

It left the IP variable unitialized which caused host parameter
to be left empty causing flush all. Flushing with IP address
was not affected.

8 years agodoveadm-server: Deinitialize print on connection destroy
Aki Tuomi [Fri, 18 Aug 2017 08:22:52 +0000 (11:22 +0300)] 
doveadm-server: Deinitialize print on connection destroy

Otherwise print remains initialized and can break when reusing the service.

8 years agodirector: Fix rapid reconnection on failed outgoing connections
Timo Sirainen [Fri, 18 Aug 2017 08:09:41 +0000 (11:09 +0300)] 
director: Fix rapid reconnection on failed outgoing connections

last_network_failure wasn't set, which caused a failed outgoing connection
to immediately reconnect to it. This resulted in rapid logging of
connect() errors.

8 years agoglobal: Add/change switch case "fall through" comments
Timo Sirainen [Thu, 17 Aug 2017 10:20:26 +0000 (13:20 +0300)] 
global: Add/change switch case "fall through" comments

These fix warnings with gcc 7's -Wimplicit-fallthrough

8 years agolib: Add missing parenthesis to timeout_add()'s msecs parameter checks
Timo Sirainen [Thu, 17 Aug 2017 11:42:07 +0000 (14:42 +0300)] 
lib: Add missing parenthesis to timeout_add()'s msecs parameter checks

This caused wrong results when the msecs parameter contained e.g. var?1:2

8 years agolib: Fix compiler warning about mixing boolean with multiplication
Timo Sirainen [Thu, 17 Aug 2017 10:14:16 +0000 (13:14 +0300)] 
lib: Fix compiler warning about mixing boolean with multiplication

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 agovirtual: Make sure sync_mailbox_idx isn't used uninitialized
Timo Sirainen [Mon, 24 Jul 2017 11:40:31 +0000 (14:40 +0300)] 
virtual: Make sure sync_mailbox_idx isn't used uninitialized

Changing its indexes to start from 1, we can add an assert to check that
it's never the default 0 when we need to use it.

8 years agoapparmor: Add apparmor plugin
Aki Tuomi [Thu, 13 Jul 2017 07:02:26 +0000 (10:02 +0300)] 
apparmor: Add apparmor plugin

It lets dovecot temporarily switch to a new apparmor
context for a user.

8 years agodirector: Make sure users gets expired even on an idle director
Timo Sirainen [Thu, 10 Aug 2017 14:50:04 +0000 (17:50 +0300)] 
director: Make sure users gets expired even on an idle director

Normally expiring gets done while looking up users, but if nothing is doing
that on an idle director the users won't get expired. This can cause confusion
in "doveadm director status" output.

8 years agopush-notification plugin: properly terminate strings
Michael Koch [Wed, 16 Aug 2017 10:53:55 +0000 (13:53 +0300)] 
push-notification plugin: properly terminate strings

Without this fix, if the new message does not contain a from, a subject, and
a snippet the generated JSON will be malformed (the status check at the end
appended a '"' when it shouldn't have).

8 years agoauth: auth_request_log_unknown_user() to call common auth_request_log_login_failure()
Sergey Kitov [Tue, 15 Aug 2017 08:09:07 +0000 (11:09 +0300)] 
auth: auth_request_log_unknown_user() to call common auth_request_log_login_failure()

Separate implementation of auth_request_log_unknown_user() is
replaced with call to auth_request_log_login_failure()
NOTE: behavior of the auth_request_log_unknown_user() is changed and
is in line with auth_request_log_password_mismatch()

8 years agoauth: auth_request_log_password_mismatch() to call common auth_request_log_login_fail...
Sergey Kitov [Tue, 15 Aug 2017 08:07:46 +0000 (11:07 +0300)] 
auth: auth_request_log_password_mismatch() to call common auth_request_log_login_failure()

Separate implementation of auth_request_log_password_mismatch() is
replaced with call to auth_request_log_login_failure()

8 years agoauth: ldap auth bind password mismatch logging is changed
Sergey Kitov [Tue, 15 Aug 2017 08:06:58 +0000 (11:06 +0300)] 
auth: ldap auth bind password mismatch logging is changed

All unknown user and password mismatch logging is performed in the
same way in both auth_bind = yes and auth_bind = no cases.

8 years agoauth: Added auth_request_log_login_failure()
Sergey Kitov [Tue, 15 Aug 2017 06:27:09 +0000 (09:27 +0300)] 
auth: Added auth_request_log_login_failure()

New function implementing functionality of auth_request_log_unknown_user() and auth_request_log_password_mismatch()

8 years agocassandra: Fix confusing debug logging for paged query results.
Timo Sirainen [Mon, 14 Aug 2017 12:44:24 +0000 (15:44 +0300)] 
cassandra: Fix confusing debug logging for paged query results.

Even when caller supported paged queries, the debug output contained
"Paged query has more results, but not supported by the caller".
Clear out the error after sql_result_more() is called, so it won't be
logged.

8 years agoauth: Do not use strcasecmp to compare mechanisms
Aki Tuomi [Fri, 28 Jul 2017 09:35:07 +0000 (12:35 +0300)] 
auth: Do not use strcasecmp to compare mechanisms

This is optimization since strcasecmp is slow

8 years agoauth: Empty schemes cannot be aliases
Aki Tuomi [Fri, 28 Jul 2017 07:20:17 +0000 (10:20 +0300)] 
auth: Empty schemes cannot be aliases

Optimizes cases where empty scheme is compared to PLAIN

8 years agoauth: Use strchr to split encoding and scheme
Aki Tuomi [Mon, 14 Aug 2017 11:48:05 +0000 (14:48 +0300)] 
auth: Use strchr to split encoding and scheme

This is an optimization because usually strchr is faster

8 years agoauth: Use hash table for schemes
Aki Tuomi [Fri, 28 Jul 2017 07:09:06 +0000 (10:09 +0300)] 
auth: Use hash table for schemes

8 years agolib: Add strfastcase_hash
Aki Tuomi [Fri, 28 Jul 2017 06:47:09 +0000 (09:47 +0300)] 
lib: Add strfastcase_hash

Fast case-insensitive hashing which works by masking signed
bytes with 0x20.

8 years agolib-index: Fix wrong mail_index_modseq_header automatically
Timo Sirainen [Tue, 8 Aug 2017 13:56:02 +0000 (16:56 +0300)] 
lib-index: Fix wrong mail_index_modseq_header automatically

It happens only on the next sync, although that isn't actually guaranteed to
happen. Still, it happens almost always so this should be good enough.

8 years agolib-index: Code cleanup - move code to get_modseq_next_offset_at()
Timo Sirainen [Tue, 8 Aug 2017 13:54:42 +0000 (16:54 +0300)] 
lib-index: Code cleanup - move code to get_modseq_next_offset_at()

In preparation for making the next commit smaller.

8 years agolib-index: Add unit tests to mail_transaction_log_file_get_modseq_next_offset() and...
Timo Sirainen [Tue, 8 Aug 2017 11:55:48 +0000 (14:55 +0300)] 
lib-index: Add unit tests to mail_transaction_log_file_get_modseq_next_offset() and _get_highest_modseq_at()

8 years agolib-index: Add unit test to mail_transaction_update_modseq()
Timo Sirainen [Tue, 8 Aug 2017 11:01:18 +0000 (14:01 +0300)] 
lib-index: Add unit test to mail_transaction_update_modseq()

8 years agolib-index: Remove tracking of mail_index_modseq_sync.highest_modseq
Timo Sirainen [Sat, 5 Aug 2017 05:38:50 +0000 (14:38 +0900)] 
lib-index: Remove tracking of mail_index_modseq_sync.highest_modseq

It's no longer necessary after the previous changes.

8 years agolib-index: Fix setting highest_modseq correctly in mail_index_modseq_header
Timo Sirainen [Sat, 5 Aug 2017 05:33:12 +0000 (14:33 +0900)] 
lib-index: Fix setting highest_modseq correctly in mail_index_modseq_header

The internally counted ctx->highest_modseq wasn't correct if all of the
records weren't synced. This could have happened for various reasons.
Since the view's current log seq/offset is used for the header, we can
also use the current highest_modseq from the view as well and it's
guaranteed to be correct.

This fixes various potential problems with using QRESYNC and CONDSTORE
extensions. It also fixes potential errors with unhibernating imap
clients, including:

Error: .../dovecot.index.log: Transaction log changed unexpectedly, can't get modseq

8 years agolib-index: Update per-flag modseq value a bit more correctly.
Timo Sirainen [Sat, 5 Aug 2017 05:29:12 +0000 (14:29 +0900)] 
lib-index: Update per-flag modseq value a bit more correctly.

This changes the code to be similar to the per-mail modseq updating in
mail_index_modseq_update(). It probably wasn't exactly wrong previously
either, but this change is required for the following commits.