]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agoauth: Removed dead code from oauth2 mechanism
Timo Sirainen [Fri, 24 Feb 2017 10:17:21 +0000 (12:17 +0200)] 
auth: Removed dead code from oauth2 mechanism

8 years agoacl plugin: Fix Coverity warning
Timo Sirainen [Fri, 24 Feb 2017 10:13:36 +0000 (12:13 +0200)] 
acl plugin: Fix Coverity warning

Just switch the MALLOC_ADD() parameters, so that arithmetic doesn't get
inside a sizeof().

8 years agolib-http: client: Fixed i_unreached() failure occurring when a host's list of IPs...
Stephan Bosch [Thu, 23 Feb 2017 18:38:31 +0000 (19:38 +0100)] 
lib-http: client: Fixed i_unreached() failure occurring when a host's list of IPs changes while a connection is still pending.

In that case, the IP of the pending connection may no longer be associated with that host.
If the IP was not found anymore, the i_unreached() error occurred.

8 years agoauth: Export oauth2 pass_attrs to passdb reply
Aki Tuomi [Thu, 23 Feb 2017 09:29:17 +0000 (11:29 +0200)] 
auth: Export oauth2 pass_attrs to passdb reply

8 years agovirtual: Include virtual mailbox name in "Mailbox ID unexpectedly lost" error
Timo Sirainen [Wed, 22 Feb 2017 23:24:43 +0000 (01:24 +0200)] 
virtual: Include virtual mailbox name in "Mailbox ID unexpectedly lost" error

8 years agolib-storage: Allow mail_storage_set_error() to use existing error_string
Timo Sirainen [Wed, 22 Feb 2017 13:29:34 +0000 (15:29 +0200)] 
lib-storage: Allow mail_storage_set_error() to use existing error_string

Fixes some code that may be attempting to copy an error from one storage to
another, but actually ends up trying to copy within the same storage.

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-mail: Fix memory leak in test-istream-attachment
Timo Sirainen [Fri, 23 Dec 2016 19:15:49 +0000 (14:15 -0500)] 
lib-mail: Fix memory leak in test-istream-attachment

8 years agolib-mail: Improve istream-attachment-extractor unit test for EIO errors
Timo Sirainen [Fri, 23 Dec 2016 18:08:59 +0000 (13:08 -0500)] 
lib-mail: Improve istream-attachment-extractor unit test for EIO errors

8 years agolib-mail: istream-attachment-extractor - use EIO for internal errors
Timo Sirainen [Fri, 23 Dec 2016 17:59:13 +0000 (12:59 -0500)] 
lib-mail: istream-attachment-extractor - use EIO for internal errors

These happen only if the attachment writing failed for some reason.
The input stream itself can't have any errors, so EINVAL isn't proper.

8 years agolib-mail: istream-attachment-extractor - remove unnecessary code
Timo Sirainen [Fri, 23 Dec 2016 17:56:24 +0000 (12:56 -0500)] 
lib-mail: istream-attachment-extractor - remove unnecessary code

It's enough to set the stream_errno.

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: istream-sized - consistently set stream_errno=EINVAL if stream is too large
Timo Sirainen [Fri, 23 Dec 2016 17:52:45 +0000 (12:52 -0500)] 
lib: istream-sized - consistently set stream_errno=EINVAL if stream is too large

Earlier it was sometimes done and sometimes not, depending on whether the
parent istream happened to stop at the expected boundary.

8 years agolib: istream-sized - set stream_errno=EPIPE if stream is too small
Timo Sirainen [Fri, 23 Dec 2016 17:51:41 +0000 (12:51 -0500)] 
lib: istream-sized - set stream_errno=EPIPE if stream is too small

8 years agolib: istream-sized - remove explicit i_error() logging
Timo Sirainen [Fri, 23 Dec 2016 17:26:17 +0000 (12:26 -0500)] 
lib: istream-sized - remove explicit i_error() logging

The stream_errno is set, so it's the caller's responsibility to log the
error. There's no need to log it twice.

8 years agolib: istream-sized should log errors with its own name, not parent's name
Timo Sirainen [Mon, 16 May 2016 17:17:41 +0000 (20:17 +0300)] 
lib: istream-sized should log errors with its own name, not parent's name

8 years agolib: remove failed bool from sized_istream struct
Martti Rannanjärvi [Mon, 9 May 2016 08:08:33 +0000 (11:08 +0300)] 
lib: remove failed bool from sized_istream struct

This is no longer needed as we are now checking for
stream_errno also in istream.c

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 agomaildir: Fix checking vsize caching decision in "is this pop3 user?"
Timo Sirainen [Wed, 22 Feb 2017 18:05:16 +0000 (20:05 +0200)] 
maildir: Fix checking vsize caching decision in "is this pop3 user?"

If vsize extension is used, it's practically the same as if vsize's caching
decision was YES.

8 years agopop3c: Remove unnecessarily duplicated code setting vsize to cache
Timo Sirainen [Wed, 22 Feb 2017 18:04:28 +0000 (20:04 +0200)] 
pop3c: Remove unnecessarily duplicated code setting vsize to cache

This is important now that the vsize can be added also to index's vsize
extension.

8 years agopop3c: Prefetched streams didn't call istream_opened() or set virtual_size
Timo Sirainen [Wed, 22 Feb 2017 18:03:43 +0000 (20:03 +0200)] 
pop3c: Prefetched streams didn't call istream_opened() or set virtual_size

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-mail: Fix message_part_data_is_plain_7bit()
Timo Sirainen [Mon, 30 Jan 2017 19:53:01 +0000 (21:53 +0200)] 
lib-mail: Fix message_part_data_is_plain_7bit()

Content-Type parameters weren't handled exactly right.
Broken by recent changes.

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 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 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-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-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-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-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-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 agoimap: Revert change to use [PARSE] in FETCH replies.
Timo Sirainen [Mon, 20 Feb 2017 12:07:23 +0000 (14:07 +0200)] 
imap: Revert change to use [PARSE] in FETCH replies.

Lets leave this for v2.3. Apparently Roundcube has some workarounds that
assume [UNKNOWNCTE].

Partially reverts 8fe64e2af5b6ce7b6ffa6453beaf569dca089e59

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 agolib-imap: Created test-imap-envelope.
Stephan Bosch [Sat, 14 Jan 2017 12:33:05 +0000 (13:33 +0100)] 
lib-imap: Created test-imap-envelope.

8 years agolib-imap: imap-envelope: Added function for parsing ENVELOPE from string.
Stephan Bosch [Thu, 29 Dec 2016 13:02:05 +0000 (14:02 +0100)] 
lib-imap: imap-envelope: Added function for parsing ENVELOPE from string.

8 years agolib-imap: Added more comments to imap-bodystructure and imap-envelope.
Stephan Bosch [Wed, 26 Oct 2016 21:44:47 +0000 (23:44 +0200)] 
lib-imap: Added more comments to imap-bodystructure and imap-envelope.

8 years agolib-imap: imap-bodystructure: Added support for making imap_bodystructure_parse(...
Stephan Bosch [Sun, 23 Oct 2016 23:45:18 +0000 (01:45 +0200)] 
lib-imap: imap-bodystructure: Added support for making imap_bodystructure_parse() work without a pre-existing message_part tree.

It can now create the tree from the BODYSTRUCTURE string itself.

8 years agolib-mail: message-part-data: Implemented message_part_data_get_filename().
Stephan Bosch [Sun, 23 Oct 2016 23:01:19 +0000 (01:01 +0200)] 
lib-mail: message-part-data: Implemented message_part_data_get_filename().

Gets the message part's filename if it has any.

8 years agolib-mail: message-part-data: Renamed struct message_part_envelope_data to message_par...
Stephan Bosch [Sun, 23 Oct 2016 22:19:05 +0000 (00:19 +0200)] 
lib-mail: message-part-data: Renamed struct message_part_envelope_data to message_part_envelope.

8 years agolib-imap: imap-envelope: Moved imap_envelope_headers to lib-mail/message-part-data...
Stephan Bosch [Sun, 23 Oct 2016 20:29:49 +0000 (22:29 +0200)] 
lib-imap: imap-envelope: Moved imap_envelope_headers to lib-mail/message-part-data as message_part_envelope_headers.

8 years agolib-imap: imap-bodystructure: Moved message_part_data header parsing and query functi...
Stephan Bosch [Sun, 23 Oct 2016 18:05:33 +0000 (20:05 +0200)] 
lib-imap: imap-bodystructure: Moved message_part_data header parsing and query functions to their own module in lib-mail.

Moved code from imap-bodystructure and imap-envelope.

8 years agolib-imap: imap-bodystructure: Renamed imap_bodystructure_is_plain_7bit() to message_p...
Stephan Bosch [Sun, 23 Oct 2016 17:47:12 +0000 (19:47 +0200)] 
lib-imap: imap-bodystructure: Renamed imap_bodystructure_is_plain_7bit() to message_part_data_is_plain_7bit().

8 years agolib-imap: imap-envelope: Renamed imap_envelope_parse_header() to message_part_envelop...
Stephan Bosch [Sun, 23 Oct 2016 17:00:10 +0000 (19:00 +0200)] 
lib-imap: imap-envelope: Renamed imap_envelope_parse_header() to message_part_envelope_parse_from_header().

8 years agolib-imap: imap-evenvelope: Changed imap_envelope_get_field() into a private equivalent.
Stephan Bosch [Sun, 23 Oct 2016 16:10:01 +0000 (18:10 +0200)] 
lib-imap: imap-evenvelope: Changed imap_envelope_get_field() into a private equivalent.

8 years agolib-imap: imap-bodystructure: Renamed imap_bodystructure_parse_header() to message_pa...
Stephan Bosch [Sun, 23 Oct 2016 15:51:59 +0000 (17:51 +0200)] 
lib-imap: imap-bodystructure: Renamed imap_bodystructure_parse_header() to message_part_data_parse_from_header().

8 years agolib-imap: imap-bodystructure: Grouped together functions relating to the conversion...
Stephan Bosch [Sun, 23 Oct 2016 15:27:07 +0000 (17:27 +0200)] 
lib-imap: imap-bodystructure: Grouped together functions relating to the conversion of BODYSTRUCTURE to BODY.

This only moves code.

8 years agolib-imap: imap-bodystructure: Changed struct message_part_body to contain fully decod...
Stephan Bosch [Sun, 23 Oct 2016 14:50:25 +0000 (16:50 +0200)] 
lib-imap: imap-bodystructure: Changed struct message_part_body to contain fully decoded data.

Contained unparsed IMAP string data before.

8 years agolib-imap: imap-envelope: Added function to parse struct message_part_envelope_data...
Stephan Bosch [Sun, 23 Oct 2016 14:49:37 +0000 (16:49 +0200)] 
lib-imap: imap-envelope: Added function to parse struct message_part_envelope_data from parsed imap args.

8 years agolib-imap: imap-bodystructure: Renamed `d' parameter to `data' in parse_content_header...
Stephan Bosch [Sun, 23 Oct 2016 12:06:44 +0000 (14:06 +0200)] 
lib-imap: imap-bodystructure: Renamed `d' parameter to `data' in parse_content_header() function.

8 years agolib-imap: imap-envelope: Removed useless pool field from struct message_part_envelope...
Stephan Bosch [Sun, 23 Oct 2016 11:52:10 +0000 (13:52 +0200)] 
lib-imap: imap-envelope: Removed useless pool field from struct message_part_envelope_data.

8 years agolib-imap: imap-bodystructure: Removed useless pool field from struct message_part_data.
Stephan Bosch [Sun, 23 Oct 2016 11:50:05 +0000 (13:50 +0200)] 
lib-imap: imap-bodystructure: Removed useless pool field from struct message_part_data.

8 years agolib-mail: Gave message_part_data its own field in struct message_part.
Stephan Bosch [Sun, 23 Oct 2016 11:29:43 +0000 (13:29 +0200)] 
lib-mail: Gave message_part_data its own field in struct message_part.

8 years agolib-imap: imap-bodystructure: Renamed struct message_part_body_data to message_part_data.
Stephan Bosch [Sun, 23 Oct 2016 11:10:11 +0000 (13:10 +0200)] 
lib-imap: imap-bodystructure: Renamed struct message_part_body_data to message_part_data.

8 years agolib-imap: Removed existing envelope parsing function.
Stephan Bosch [Sun, 23 Oct 2016 10:10:44 +0000 (12:10 +0200)] 
lib-imap: Removed existing envelope parsing function.

This is currently only used by imaptest. Alternative API is provided in later commit.

8 years agolib-imap: test-imap-bodystructure: Added normalization tests.
Stephan Bosch [Sun, 8 Jan 2017 11:00:15 +0000 (12:00 +0100)] 
lib-imap: test-imap-bodystructure: Added normalization tests.

8 years agolib-imap: imap-bodystructure: Allow alternative syntax and omitted optional elements...
Stephan Bosch [Mon, 9 Jan 2017 01:03:25 +0000 (02:03 +0100)] 
lib-imap: imap-bodystructure: Allow alternative syntax and omitted optional elements in parser input.

This makes the parser accept any RFC-compliant BODYSTRUCTURE syntax, instead of only what Dovecot itself produces.
This way the parser could reliably be used in the lib-imap-client if ever needed.

8 years agolib-imap: test-imap-bodystructure: Added more tests.
Stephan Bosch [Mon, 9 Jan 2017 15:29:26 +0000 (16:29 +0100)] 
lib-imap: test-imap-bodystructure: Added more tests.

8 years agolib-imap: test-imap-bodystructure: Improved handing of parse errors.
Stephan Bosch [Mon, 9 Jan 2017 15:20:29 +0000 (16:20 +0100)] 
lib-imap: test-imap-bodystructure: Improved handing of parse errors.

Actually show the parse error.

8 years agolib-imap: test-imap-bodystructure: Added support for more than one test case.
Stephan Bosch [Mon, 9 Jan 2017 15:16:46 +0000 (16:16 +0100)] 
lib-imap: test-imap-bodystructure: Added support for more than one test case.

8 years agolib-imap: imap-bodystructure: Fixed parse error message about invalid Content-M5...
Stephan Bosch [Sun, 8 Jan 2017 21:50:02 +0000 (22:50 +0100)] 
lib-imap: imap-bodystructure: Fixed parse error message about invalid Content-M5 field.

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 agolib-mail: Fix matched-parameter in HEADER_FILTER_ADD_MISSING_EOH callback
Timo Sirainen [Sun, 19 Feb 2017 22:26:28 +0000 (00:26 +0200)] 
lib-mail: Fix matched-parameter in HEADER_FILTER_ADD_MISSING_EOH callback

The matched-parameter in the regular EOH callback is the reverse of what
it's in v2.3 tree. So preserve it here.

8 years ago.gitignore: Fixed location of ignored m4 files.
Stephan Bosch [Sun, 19 Feb 2017 22:03:40 +0000 (23:03 +0100)] 
.gitignore: Fixed location of ignored m4 files.

Probably got cherry-picked wrong from development branch.

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