]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agolib-mail: istream-attachment-connector now allows msg_size=-1 for "unknown".
Timo Sirainen [Tue, 1 Nov 2016 16:43:57 +0000 (18:43 +0200)] 
lib-mail: istream-attachment-connector now allows msg_size=-1 for "unknown".

8 years agolib-mail: Make sure istream-attachment-connector detects wrong mail size.
Timo Sirainen [Tue, 1 Nov 2016 16:42:31 +0000 (18:42 +0200)] 
lib-mail: Make sure istream-attachment-connector detects wrong mail size.

8 years agolib: Added i_stream_create_min_sized*()
Timo Sirainen [Tue, 1 Nov 2016 16:35:48 +0000 (18:35 +0200)] 
lib: Added i_stream_create_min_sized*()

8 years agolib: Added i_stream_create_sized_range()
Timo Sirainen [Tue, 1 Nov 2016 12:47:05 +0000 (14:47 +0200)] 
lib: Added i_stream_create_sized_range()

This is just a small wrapper to i_stream_create_sized() to specify stream's
start offset.

8 years agotrash plugin: Use correct hook for overriding mail_user vfuncs
Timo Sirainen [Wed, 22 Feb 2017 15:45:34 +0000 (17:45 +0200)] 
trash plugin: Use correct hook for overriding mail_user vfuncs

This was always wrong to do, and it crashes after
f32382d2da479a4371e08c443679528db37ea988

8 years agoexpire plugin: Use correct hook for overriding mail_user vfuncs
Timo Sirainen [Wed, 22 Feb 2017 15:21:56 +0000 (17:21 +0200)] 
expire plugin: Use correct hook for overriding mail_user vfuncs

This was always wrong to do, and it crashes after
f32382d2da479a4371e08c443679528db37ea988

8 years agolazy-expunge: Fix error handling for GUID lookups
Timo Sirainen [Wed, 22 Feb 2017 13:32:19 +0000 (15:32 +0200)] 
lazy-expunge: Fix error handling for GUID lookups

If the mail is already expunged, the error should be ignored.
In other situations the original error string should be preserved as
part of the logged error message.

8 years agolib-storage: Add missing service_user ref when creating shared mailbox's user.
Timo Sirainen [Wed, 22 Feb 2017 14:09:07 +0000 (16:09 +0200)] 
lib-storage: Add missing service_user ref when creating shared mailbox's user.

Was forgotten from d1bf4ae66b8bf3b9e28df1823d6d4adda2b923b6

Fixes:
Panic: file mail-storage-service.c: line 1513 (mail_storage_service_user_unref): assertion failed: (user->refcount > 0)

8 years agolib-storage: Removed mail_storage_service_user_free() backwards compatibility
Timo Sirainen [Wed, 22 Feb 2017 11:30:18 +0000 (13:30 +0200)] 
lib-storage: Removed mail_storage_service_user_free() backwards compatibility

Used a separate commit so the macro can be left for v2.2 tree.

8 years agoglobal: Replace mail_storage_service_user_free() with _unref()
Timo Sirainen [Wed, 22 Feb 2017 11:30:00 +0000 (13:30 +0200)] 
global: Replace mail_storage_service_user_free() with _unref()

8 years agolib-storage: Use refcounting for mail_storage_service_user
Timo Sirainen [Wed, 22 Feb 2017 11:28:43 +0000 (13:28 +0200)] 
lib-storage: Use refcounting for mail_storage_service_user

doveadm import was freeing the user too early, which resulted
mail_user._service_user pointing to freed memory. More importantly,
after 34512eaad8b1b2f929e6d6e3a2f7252c29fba97b user->set was pointing
to already freed memory.

8 years agoquota: Don't log "Internal quota calculation error"
Timo Sirainen [Wed, 22 Feb 2017 11:02:27 +0000 (13:02 +0200)] 
quota: Don't log "Internal quota calculation error"

It's not very informative and we can't give a better error message without
changing the APIs. The real error should have been logged already anyway,
so this is just duplication of an error. I think originally this was added
because some backend forgot to log an error.

8 years agolib-lda: Fix pigeonhole testsuite to not crash
Timo Sirainen [Wed, 22 Feb 2017 08:44:00 +0000 (10:44 +0200)] 
lib-lda: Fix pigeonhole testsuite to not crash

8 years agolib: Fix again test-utc-mktime with 32bit time_t
Timo Sirainen [Tue, 21 Feb 2017 20:34:14 +0000 (22:34 +0200)] 
lib: Fix again test-utc-mktime with 32bit time_t

8 years agolib-lda: Fix delivery logging when Sieve performs multiple actions
Timo Sirainen [Tue, 21 Feb 2017 10:38:10 +0000 (12:38 +0200)] 
lib-lda: Fix delivery logging when Sieve performs multiple actions

Previous code assumed that it would work like:
 - save/copy
 - transaction commit
 - mail_deliver_ctx_get_log_var_expand_table()
 - repeat for transaction 2

While it really works:
 - transaction 1: save/copy
 - transaction 2: save/copy
 - transaction 1: commit
 - mail_deliver_ctx_get_log_var_expand_table()
 - transaction 2: commit
 - mail_deliver_ctx_get_log_var_expand_table()

So the cache needs to be stored per transaction. This code still wouldn't
work correctly if Sieve saved mails multiple times within the same
transaction, but that doesn't happen (at least currently).

8 years agolib-lda: Refactor - mail_deliver_log_update_cache() doesn't need entire deliver_ctx
Timo Sirainen [Tue, 21 Feb 2017 10:36:52 +0000 (12:36 +0200)] 
lib-lda: Refactor - mail_deliver_log_update_cache() doesn't need entire deliver_ctx

8 years agolib-lda: Refactor - Add struct mail_deliver_mailbox
Timo Sirainen [Tue, 21 Feb 2017 10:34:59 +0000 (12:34 +0200)] 
lib-lda: Refactor - Add struct mail_deliver_mailbox

8 years agolib: Fix test-utc-mktime with 32bit time_t
Timo Sirainen [Tue, 21 Feb 2017 17:55:48 +0000 (19:55 +0200)] 
lib: Fix test-utc-mktime with 32bit time_t

8 years agolib-mail: Place input/output of message-date tests in one struct
Martti Rannanjärvi [Tue, 21 Feb 2017 14:25:48 +0000 (16:25 +0200)] 
lib-mail: Place input/output of message-date tests in one struct

Define both input and output of a message date test case in a single
struct so it is easier to follow and less error prone. Also add some
leap second tests.

8 years agolib: Place input/output of utc_mktime tests in one struct
Martti Rannanjärvi [Tue, 21 Feb 2017 15:00:14 +0000 (17:00 +0200)] 
lib: Place input/output of utc_mktime tests in one struct

Define both input and output of a utc_mktime test case in a single
struct so it is easier to follow and less error prone.

8 years agolib: Accept leap second in utc_mktime
Martti Rannanjärvi [Tue, 21 Feb 2017 14:25:25 +0000 (16:25 +0200)] 
lib: Accept leap second in utc_mktime

Accept leap second at any time in utc_mktime since utc_mktime is being
used before applying the timezone offset everywhere.

8 years agoimap: Fix error message in failed FETCH's NO reply.
Timo Sirainen [Tue, 21 Feb 2017 12:42:01 +0000 (14:42 +0200)] 
imap: Fix error message in failed FETCH's NO reply.

This was broken only with the new imap_fetch_failure = no-after setting.

8 years agoimapc: Error handling wasn't setting storage error everywhere.
Timo Sirainen [Tue, 21 Feb 2017 13:44:09 +0000 (15:44 +0200)] 
imapc: Error handling wasn't setting storage error everywhere.

This would have used the previous error, which might not have been correct.

8 years agolib-storage: Fix mail.access_type for search prefetches
Timo Sirainen [Tue, 21 Feb 2017 12:20:22 +0000 (14:20 +0200)] 
lib-storage: Fix mail.access_type for search prefetches

8 years agolmtp: Fix lmtp_user_concurrency_limit when userdb changes the username
Timo Sirainen [Tue, 21 Feb 2017 11:48:36 +0000 (13:48 +0200)] 
lmtp: Fix lmtp_user_concurrency_limit when userdb changes the username

Anvil LOOKUP was done with the original username, while CONNECT/DISCONNECT
was done with the changed username. So LOOKUP always thought that there
were zero concurrent sessions for the user.

8 years agocassandra: Don't use i_error() from non-main thread
Timo Sirainen [Tue, 21 Feb 2017 09:55:55 +0000 (11:55 +0200)] 
cassandra: Don't use i_error() from non-main thread

It will only cause crashes. This was done only if the internal
communication pipe couldn't be written to, which was pretty unlikely
to happen.

8 years agolib-storage: Fix assert-crash on corrupted dovecot.list.index with name_id==0
Timo Sirainen [Tue, 21 Feb 2017 11:08:59 +0000 (13:08 +0200)] 
lib-storage: Fix assert-crash on corrupted dovecot.list.index with name_id==0

Fixes:
Panic: file hash.c: line 213 (hash_table_insert_node): assertion failed: (key != NULL)

8 years agolib-storage: Add asserts to make sure lookup_abort is being used correctly.
Timo Sirainen [Mon, 20 Feb 2017 17:35:45 +0000 (19:35 +0200)] 
lib-storage: Add asserts to make sure lookup_abort is being used correctly.

8 years agolib-storage, pop3-migration: Reset lookup_abort before continuing to search
Timo Sirainen [Mon, 20 Feb 2017 17:34:25 +0000 (19:34 +0200)] 
lib-storage, pop3-migration: Reset lookup_abort before continuing to search

This doesn't really fix anything right now, but it'll allow adding the
asserts in the following commit.

8 years agoauth: Make sure tokeninfo or introspection URL is given
Aki Tuomi [Tue, 21 Feb 2017 09:52:59 +0000 (11:52 +0200)] 
auth: Make sure tokeninfo or introspection URL is given

8 years agoauth: Make tokeninfo optional
Aki Tuomi [Tue, 21 Feb 2017 09:21:19 +0000 (11:21 +0200)] 
auth: Make tokeninfo optional

It is not supported by all OAuth2 solutions

8 years agolib-oauth2: Support basic authorization
Aki Tuomi [Tue, 21 Feb 2017 09:18:37 +0000 (11:18 +0200)] 
lib-oauth2: Support basic authorization

8 years agolib-index: Unconstifty pointer array
Aki Tuomi [Mon, 20 Feb 2017 13:47:33 +0000 (15:47 +0200)] 
lib-index: Unconstifty pointer array

clang complained about the extra const.

8 years agolib-index: Add missing initialization for chained hooks
Aki Tuomi [Mon, 20 Feb 2017 13:35:02 +0000 (15:35 +0200)] 
lib-index: Add missing initialization for chained hooks

8 years agolib,lib-storage: Move hook building code to lib
Aki Tuomi [Mon, 20 Feb 2017 13:28:36 +0000 (15:28 +0200)] 
lib,lib-storage: Move hook building code to lib

This allows it to be reused elsewhere

8 years agolib-lda: Do not involve mail-deliver plugin unnecessarely
Aki Tuomi [Mon, 20 Feb 2017 12:50:39 +0000 (14:50 +0200)] 
lib-lda: Do not involve mail-deliver plugin unnecessarely

If no mail delivery by LDA/LMTP is being done, do not
hook into the process.

Fixes signal 11 crash with lazy-expunge.

8 years agolib-index: Allow multiple hooks for transaction creation
Aki Tuomi [Mon, 20 Feb 2017 12:34:25 +0000 (14:34 +0200)] 
lib-index: Allow multiple hooks for transaction creation

8 years agolib-compression: Fix test-compression to build without zlib
Timo Sirainen [Mon, 20 Feb 2017 12:26:41 +0000 (14:26 +0200)] 
lib-compression: Fix test-compression to build without zlib

8 years agopop3c: Add no pipelining pop3c feature
Aki Tuomi [Mon, 20 Feb 2017 07:18:45 +0000 (09:18 +0200)] 
pop3c: Add no pipelining pop3c feature

This should help with certain broken pop3c
servers that advertise that they support pipelining
but they really don't.

8 years agoPartially implemented IMAP SEARCH=X-MIMEPART capability.
Stephan Bosch [Tue, 24 May 2016 23:57:08 +0000 (01:57 +0200)] 
Partially implemented IMAP SEARCH=X-MIMEPART capability.

This capability is currently Dovecot-specific.

8 years agoexample-config: Add mail_sort_max_read_count setting.
Timo Sirainen [Sun, 19 Feb 2017 23:24:09 +0000 (01:24 +0200)] 
example-config: Add mail_sort_max_read_count setting.

8 years agoexample-config: Add mail_vsize_bg_after_count setting.
Timo Sirainen [Sun, 19 Feb 2017 23:16:56 +0000 (01:16 +0200)] 
example-config: Add mail_vsize_bg_after_count setting.

8 years agoexample-config: Add imap_fetch_failure setting.
Timo Sirainen [Sun, 19 Feb 2017 23:00:05 +0000 (01:00 +0200)] 
example-config: Add imap_fetch_failure setting.

8 years agoauth: oauth2 mechanism: Fixed implicit boolean expression involving a pointer.
Stephan Bosch [Sun, 19 Feb 2017 20:58:54 +0000 (21:58 +0100)] 
auth: oauth2 mechanism: Fixed implicit boolean expression involving a pointer.

Found with Clang -Wstrict-bool.

8 years agolib-storage: Add explicit MAIL_ERROR_LOOKUP_ABORT error
Timo Sirainen [Sat, 18 Feb 2017 03:01:50 +0000 (05:01 +0200)] 
lib-storage: Add explicit MAIL_ERROR_LOOKUP_ABORT error

The MAIL_ERROR_NOTPOSSIBLE was a bit too generic to assume to mean the same
thing. It doesn't look like there are any external plugins that break
because of this change.

8 years agolib-storage: Add mail.access_type
Timo Sirainen [Fri, 17 Feb 2017 17:29:03 +0000 (19:29 +0200)] 
lib-storage: Add mail.access_type

8 years agolib-storage: Add mail_sort_max_read_count setting.
Timo Sirainen [Fri, 17 Feb 2017 17:07:53 +0000 (19:07 +0200)] 
lib-storage: Add mail_sort_max_read_count setting.

This controls how many slow mail accesses sorting can perform before it
fails:

a NO [LIMIT] Requested sort would have taken too long

The SORT reply is still returned, but it's likely not correct.

8 years agolib-storage: Add MAIL_ERROR_LIMIT
Timo Sirainen [Fri, 17 Feb 2017 16:56:23 +0000 (18:56 +0200)] 
lib-storage: Add MAIL_ERROR_LIMIT

8 years agoimap: If SEARCH/SORT fails but returns some results, send them to client.
Timo Sirainen [Fri, 17 Feb 2017 16:32:05 +0000 (18:32 +0200)] 
imap: If SEARCH/SORT fails but returns some results, send them to client.

The previous error handling fixes cause SEARCH/SORT to now fail if there
are any problems reading mails. This change makes the commands still
return the best known results, so the IMAP client can still use them,
even though they may not be entirely correct.

8 years agolib-storage: Fix error handling when searching mails
Timo Sirainen [Fri, 17 Feb 2017 16:30:51 +0000 (18:30 +0200)] 
lib-storage: Fix error handling when searching mails

Only expunge errors and failures caused by lookup_abort should be ignored.
The rest of the mail errors mean that the search result might not be
correct. We'll still run the search as fully as possible, but we just
return an error at the end.

8 years agolib-storage: Search optimization - avoid parsing message_parts unnecessarily
Timo Sirainen [Fri, 17 Feb 2017 16:24:31 +0000 (18:24 +0200)] 
lib-storage: Search optimization - avoid parsing message_parts unnecessarily

If they're not already cached, the mail is parsed twice: once to get the
message_parts and again to perform the actual search. The searching can
however do the message_parts parsing internally as well.

8 years agolib-storage: Fix error handling when sorting mails.
Timo Sirainen [Fri, 17 Feb 2017 16:19:46 +0000 (18:19 +0200)] 
lib-storage: Fix error handling when sorting mails.

All errors were treated the same as if message had been expunged. This
caused potentially wrong results to be sent to the client without any
indication that they're wrong.

8 years agolib-storage: Change vsize calculation to use the new mail_stream_opened
Timo Sirainen [Fri, 17 Feb 2017 14:31:52 +0000 (16:31 +0200)] 
lib-storage: Change vsize calculation to use the new mail_stream_opened

This avoids calling mail_get_virtual_size() twice and is a bit cleaner
approach.

8 years agolib-storage: Add mail.mail_stream_opened and .mail_metadata_accessed
Timo Sirainen [Fri, 17 Feb 2017 14:20:06 +0000 (16:20 +0200)] 
lib-storage: Add mail.mail_stream_opened and .mail_metadata_accessed

These allow determining after mail_*() calls how efficiently they were
performed.

8 years agolib-storage: Clarify what MAIL_LOOKUP_ABORT_READ_MAIL means.
Timo Sirainen [Fri, 17 Feb 2017 14:14:39 +0000 (16:14 +0200)] 
lib-storage: Clarify what MAIL_LOOKUP_ABORT_READ_MAIL means.

It should maybe even be renamed to something clearer.

8 years agodsync: Don't assert-crash if duplicate attributes are seen
Timo Sirainen [Sat, 18 Feb 2017 23:44:21 +0000 (01:44 +0200)] 
dsync: Don't assert-crash if duplicate attributes are seen

Just ignore the duplicates. Normally this shouldn't happen, but due to
some bugs for example a Sieve script could be returned once by doveadm_sieve
plugin and another time from mail_attribute_dict.

8 years agospelling fixes
klemens [Sat, 18 Feb 2017 09:39:56 +0000 (10:39 +0100)] 
spelling fixes

8 years agoimap: Fix running time in tagged command replies.
Timo Sirainen [Sun, 19 Feb 2017 13:47:48 +0000 (15:47 +0200)] 
imap: Fix running time in tagged command replies.

The timing information was updated only after command_exec() returned.
Most of the commands were handled within a single command_exec() though,
so at the time when tagline was sent the running_usecs was still zero.

The msecs in ioloop timing was correct though, because it relied only on
the command start timing info.

8 years agodoveadm: Add explicit mail_storage_init/deinit() calls
Timo Sirainen [Sun, 19 Feb 2017 00:03:08 +0000 (02:03 +0200)] 
doveadm: Add explicit mail_storage_init/deinit() calls

This mainly prevents losing hooks that were registered by doveadm plugins.

Otherwise what happens is:
 - mail_plugins are unloaded and they unregister their hooks
 - doveadm plugins (e.g. doveadm_sieve) are NOT unloaded
 - mail_storage_deinit() frees all the registered hooks
 - next mail_storage_init() initializes all new hooks
 - All mail_plugins are loaded and they register again their hooks
 - doveadm plugins are NOT re-loaded or re-initialized, so their existing
hooks were lost.

8 years agolib-storage: mail_storage_init/deinit() is now reference counted.
Timo Sirainen [Sun, 19 Feb 2017 00:02:20 +0000 (02:02 +0200)] 
lib-storage: mail_storage_init/deinit() is now reference counted.

This allows calling them multiple times and only the final deinit frees the
data.

8 years agolib-storage: Assert-crash if duplicate internal hooks are added.
Timo Sirainen [Sun, 19 Feb 2017 00:01:24 +0000 (02:01 +0200)] 
lib-storage: Assert-crash if duplicate internal hooks are added.

8 years agofs-posix: Add "no-fsync" parameter.
Timo Sirainen [Sun, 19 Feb 2017 13:54:53 +0000 (15:54 +0200)] 
fs-posix: Add "no-fsync" parameter.

This disables calling fdatasync() when fs_write() was done with
FS_OPEN_FLAG_FSYNC. Useful for making tests faster.

8 years agoimap: Code cleanup - Remove duplicate flags from imap_fetch_state
Timo Sirainen [Sun, 19 Feb 2017 12:49:20 +0000 (14:49 +0200)] 
imap: Code cleanup - Remove duplicate flags from imap_fetch_state

All the cur_flushed, line_partial and line_finished were about the same
thing.

8 years agoimap: Fix sending UID only when necessary on broken FETCHes.
Timo Sirainen [Sun, 19 Feb 2017 12:34:45 +0000 (14:34 +0200)] 
imap: Fix sending UID only when necessary on broken FETCHes.

b748f91d0677fffaa2208b39ebb6db3aeb2e937b changed UID to be sent for most
FETCH replies. There was also some existing code that attempted to do this,
but didn't fully work.

So now:

1) If there are no non-buffered replies, the entire FETCH response isn't
sent.

2) If the buffer was already flushed and nothing else was sent, add UID to
reply. The code paths for handling this are differently for
imap_fetch_failure = disconnect-immediately vs others (depending on
imap_fetch_cur_failed() return value).

8 years agoimap: Include info about last command in disconnection log line.
Timo Sirainen [Thu, 16 Feb 2017 18:39:12 +0000 (20:39 +0200)] 
imap: Include info about last command in disconnection log line.

Only if LOGOUT isn't sent, because that's already visible.

8 years agoimap: Code cleanup - Move code to client_command_stats_append()
Timo Sirainen [Thu, 16 Feb 2017 18:29:46 +0000 (20:29 +0200)] 
imap: Code cleanup - Move code to client_command_stats_append()

8 years agoimap: Add imap_client.logged_out at LOGOUT
Timo Sirainen [Thu, 16 Feb 2017 18:17:32 +0000 (20:17 +0200)] 
imap: Add imap_client.logged_out at LOGOUT

This is useful for determining if client did a clean logout

8 years agoimap: Code cleanup - move command stats to struct client_command_stats
Timo Sirainen [Thu, 16 Feb 2017 18:14:55 +0000 (20:14 +0200)] 
imap: Code cleanup - move command stats to struct client_command_stats

8 years agomech-oauth2: Clarify logging
Aki Tuomi [Fri, 17 Feb 2017 13:46:38 +0000 (15:46 +0200)] 
mech-oauth2: Clarify logging

8 years agomech-oauth2: Set user_given=TRUE when username given in OAUTHBEARER
Aki Tuomi [Fri, 17 Feb 2017 13:45:34 +0000 (15:45 +0200)] 
mech-oauth2: Set user_given=TRUE when username given in OAUTHBEARER

8 years agomech-oauth2: Fix gs2-header parsing
Aki Tuomi [Fri, 17 Feb 2017 13:44:17 +0000 (15:44 +0200)] 
mech-oauth2: Fix gs2-header parsing

8 years agolib-storage: Update vsize header after sync only if sizes are cached.
Timo Sirainen [Tue, 14 Feb 2017 16:48:51 +0000 (18:48 +0200)] 
lib-storage: Update vsize header after sync only if sizes are cached.

The result isn't needed yet in that case, so if it's slow to get the sizes
it might as well be delayd until later. This is especially useful when
indexer-worker triggers FTS indexing. The vsizes can be added to index
after the mail is already read for FTS. Without this change the vsize
update would first open all the mails and then the FTS indexing would
open all the mails a second time.

8 years agolib-storage: Add mail_vsize_bg_after_count setting.
Timo Sirainen [Tue, 7 Feb 2017 14:18:55 +0000 (16:18 +0200)] 
lib-storage: Add mail_vsize_bg_after_count setting.

If folder vsize calculation requires opening more than this many mails from
disk (i.e. mail sizes aren't in cache already), return failure and finish
the calculation via indexer process.

This should be used like:

protocol !indexer-worker {
  mail_vsize_bg_after_count = 10
}

8 years agolib-storage: Don't stop vsize calculation on expunged mails.
Timo Sirainen [Tue, 7 Feb 2017 11:53:52 +0000 (13:53 +0200)] 
lib-storage: Don't stop vsize calculation on expunged mails.

I don't know why I added such logic there in the first place. If we just
skip the expunged mails, the end result should still be correct and
usable when cached.

8 years agoREADME: Add note that we support OAUTHBEARER and XOAUTH2
Aki Tuomi [Tue, 14 Feb 2017 11:33:47 +0000 (13:33 +0200)] 
README: Add note that we support OAUTHBEARER and XOAUTH2

8 years agoauth: Add oauth2 passdb
Aki Tuomi [Mon, 13 Feb 2017 13:33:21 +0000 (15:33 +0200)] 
auth: Add oauth2 passdb

8 years agoauth: Add xoauth2 and oauthbearer mechanisms
Aki Tuomi [Sat, 4 Feb 2017 21:56:04 +0000 (23:56 +0200)] 
auth: Add xoauth2 and oauthbearer mechanisms

8 years agoauth: Add mechanism filter for passdbs
Aki Tuomi [Mon, 6 Feb 2017 10:56:27 +0000 (12:56 +0200)] 
auth: Add mechanism filter for passdbs

8 years agoauth: Add accessor for passdb template arguments
Aki Tuomi [Wed, 8 Feb 2017 11:06:13 +0000 (13:06 +0200)] 
auth: Add accessor for passdb template arguments

8 years agolib-oauth2: Add support library for OAUTH2
Aki Tuomi [Thu, 26 Jan 2017 08:49:08 +0000 (10:49 +0200)] 
lib-oauth2: Add support library for OAUTH2

8 years agolib-index: Fix updating mail_index_header.day_first_uid
Timo Sirainen [Wed, 15 Feb 2017 20:13:12 +0000 (22:13 +0200)] 
lib-index: Fix updating mail_index_header.day_first_uid

If user received a mail every day, the day_first_uid wasn't being updated.
This caused wrong caching decisions to be made in dovecot.index.cache:

 - Accessing >1 week old emails should have changed caching decision from
"tmp" to "yes". This might not have happened, although as long as
day_first_uid[7] pointed to an existing mail and email client accessed
all the mails, this wouldn't have changed anything.

 - Cache compression is supposed to drop >1 week old mails when caching
decision is "tmp". Not enough mails were being dropped because
day_first_uid[7] pointed to a much older than 1 week old mails.

Also added a unit test to make sure this works.

Broken by d9ee2f9fb3ef7b9391bfeeff1b374aead51667aa

8 years agolib-index: Add day_stamp parameter to mail_index_update_day_headers()
Timo Sirainen [Wed, 15 Feb 2017 20:12:15 +0000 (22:12 +0200)] 
lib-index: Add day_stamp parameter to mail_index_update_day_headers()

This will help creating a unit test.

8 years agolib-storage: Re-open mailbox after it's undeleted.
Timo Sirainen [Wed, 15 Feb 2017 16:20:05 +0000 (18:20 +0200)] 
lib-storage: Re-open mailbox after it's undeleted.

This is needed with mailbox formats that didn't fully open the mailbox while
it was undeleted.

8 years agolib-storage: Don't sync mailbox after undeleting it.
Timo Sirainen [Wed, 15 Feb 2017 16:18:46 +0000 (18:18 +0200)] 
lib-storage: Don't sync mailbox after undeleting it.

This is useful only when deleting it. With undeletion the syncing isn't
useful and might actually be harmful with mailbox formats that didn't
fully open the mailbox while it was undeleted.

8 years agolib-storage: Make sure mailbox undeletion won't go to infinite loop
Timo Sirainen [Wed, 15 Feb 2017 16:05:14 +0000 (18:05 +0200)] 
lib-storage: Make sure mailbox undeletion won't go to infinite loop

8 years agomail-log: Add mail_log_cached_only setting.
Timo Sirainen [Wed, 15 Feb 2017 21:32:52 +0000 (23:32 +0200)] 
mail-log: Add mail_log_cached_only setting.

If enabled, everything except "save" event will log only the fields that can
be looked up from cache. This improves performance if some of the fields
aren't cached and it's not a strict requirement to log them.

8 years agolib-imap-client: pass the reply text to the auth-failed state change callback
Josef 'Jeff' Sipek [Wed, 15 Feb 2017 18:46:06 +0000 (13:46 -0500)] 
lib-imap-client: pass the reply text to the auth-failed state change callback

8 years agolib-imap-client: invoke state change callback on "authentication success"
Josef 'Jeff' Sipek [Wed, 15 Feb 2017 14:13:05 +0000 (09:13 -0500)] 
lib-imap-client: invoke state change callback on "authentication success"

8 years agolib-imap-client: add callback to notify consumers about state changes
Josef 'Jeff' Sipek [Wed, 15 Feb 2017 14:12:35 +0000 (09:12 -0500)] 
lib-imap-client: add callback to notify consumers about state changes

Add a callback to notify imapc users about failures.  Currently, the only
failure defined is "authentication failed".

8 years agolib-imap-client: centralize authentication failed error logging
Josef 'Jeff' Sipek [Tue, 14 Feb 2017 13:58:10 +0000 (08:58 -0500)] 
lib-imap-client: centralize authentication failed error logging

8 years agolib-http: response parser: Drop previous response's pool immediately when parsing...
Stephan Bosch [Sat, 4 Feb 2017 14:40:41 +0000 (15:40 +0100)] 
lib-http: response parser: Drop previous response's pool immediately when parsing continues.

Prevously, it would only do that when the first byte of the next response was received.
This prevents wasting memory when no response is being parsed.

8 years agolib-http: response parser: Always clear response to prevent referring to stale data.
Stephan Bosch [Sat, 4 Feb 2017 15:21:51 +0000 (16:21 +0100)] 
lib-http: response parser: Always clear response to prevent referring to stale data.

8 years agolib-http: test-http-response-parse: Properly test multiple sequential responses.
Stephan Bosch [Sat, 4 Feb 2017 15:15:57 +0000 (16:15 +0100)] 
lib-http: test-http-response-parse: Properly test multiple sequential responses.

8 years agolib-http: message parser: Don't allocate a pool for the next message until it is...
Stephan Bosch [Sat, 4 Feb 2017 12:59:10 +0000 (13:59 +0100)] 
lib-http: message parser: Don't allocate a pool for the next message until it is needed.

This prevents wasting memory when no message is being parsed.

8 years agolib-http: message parser: Delay allocation of message header.
Stephan Bosch [Sat, 4 Feb 2017 13:11:36 +0000 (14:11 +0100)] 
lib-http: message parser: Delay allocation of message header.

8 years agolib-http: message parser: Don't create the connection_options array, unless it is...
Stephan Bosch [Sat, 4 Feb 2017 13:03:25 +0000 (14:03 +0100)] 
lib-http: message parser: Don't create the connection_options array, unless it is actually used.

8 years agolib-mail: Fix duplicate HEADER_FILTER_ADD_MISSING_EOH callback call
Timo Sirainen [Tue, 14 Feb 2017 15:35:54 +0000 (17:35 +0200)] 
lib-mail: Fix duplicate HEADER_FILTER_ADD_MISSING_EOH callback call

If headers weren't modified, the second reading of the istream shouldn't
call any callbacks.

8 years agodoveadm: Added "mailbox path" command
Timo Sirainen [Tue, 14 Feb 2017 22:08:49 +0000 (00:08 +0200)] 
doveadm: Added "mailbox path" command

This allows easily printing a path for a mailbox, index, control dir, etc.

8 years agolib-lda: Code cleanup - remove unnecessary dest_mail check
Timo Sirainen [Tue, 14 Feb 2017 18:23:16 +0000 (20:23 +0200)] 
lib-lda: Code cleanup - remove unnecessary dest_mail check

8 years agolib-lda: Don't set mail_deliver_context.dest_mail too early.
Timo Sirainen [Tue, 14 Feb 2017 18:20:07 +0000 (20:20 +0200)] 
lib-lda: Don't set mail_deliver_context.dest_mail too early.

It must be NULL for the caller, unless save_dest_mail==TRUE