]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-http: client: Assert that req->client != NULL in http_client_request_send_error().
Stephan Bosch [Sun, 28 Jan 2018 20:39:07 +0000 (21:39 +0100)] 
lib-http: client: Assert that req->client != NULL in http_client_request_send_error().

Applies when blocking payload output API is being used.
Addresses a report by scan-build.

7 years agolib-smtp: client: Fix timeout leak sometimes occurring at unexpected remote disconnect.
Stephan Bosch [Sun, 28 Jan 2018 10:44:26 +0000 (11:44 +0100)] 
lib-smtp: client: Fix timeout leak sometimes occurring at unexpected remote disconnect.

While disconnected, newly submitted commands are queued, yet scheduled for
immediate failure. The timeout used for that was not cleaned up.

7 years agolib-program-client: Make an explicit enum for the exit code.
Stephan Bosch [Fri, 26 Jan 2018 19:37:32 +0000 (20:37 +0100)] 
lib-program-client: Make an explicit enum for the exit code.

Before, the meaning of the code was confusing, since the actual program returns
a different set of values.

7 years agolib-program-client: local: Add test for big data I/O.
Stephan Bosch [Sat, 20 Jan 2018 20:32:07 +0000 (21:32 +0100)] 
lib-program-client: local: Add test for big data I/O.

7 years agolib-program-client: Document the purpose of the use_dotstream setting.
Stephan Bosch [Wed, 24 Jan 2018 00:17:59 +0000 (01:17 +0100)] 
lib-program-client: Document the purpose of the use_dotstream setting.

7 years agolib-program-client: Add comments to program_input/program_output functions.
Stephan Bosch [Tue, 23 Jan 2018 20:14:18 +0000 (21:14 +0100)] 
lib-program-client: Add comments to program_input/program_output functions.

7 years agolib-program-client: Flush/finish the output stream after o_stream_send_istream().
Stephan Bosch [Mon, 22 Jan 2018 22:43:18 +0000 (23:43 +0100)] 
lib-program-client: Flush/finish the output stream after o_stream_send_istream().

There may still be data in the output stream buffer. Failing to flush this
leads to truncated output. For the output towards the program o_stream_finish()
is used, since there may be an ostream_dot in between (or something else for
future features).

7 years agolib-program-client: remote: Don't change exit_code in program_client_remote_disconnec...
Stephan Bosch [Wed, 24 Jan 2018 00:09:16 +0000 (01:09 +0100)] 
lib-program-client: remote: Don't change exit_code in program_client_remote_disconnect() when program_input is already NULL.

When the program_input is NULL, the stream is finished, meaning that the
exit_code is set based on the return code. There can be a program_input for
remote streams, even when the program produces no output.

7 years agolib-program-client: Simplify cleanup of dot input stream in program_client_program_in...
Stephan Bosch [Tue, 23 Jan 2018 20:38:27 +0000 (21:38 +0100)] 
lib-program-client: Simplify cleanup of dot input stream in program_client_program_input().

7 years agolib-program-client: Restructure reading input from program to simplify handling of...
Stephan Bosch [Tue, 23 Jan 2018 20:24:35 +0000 (21:24 +0100)] 
lib-program-client: Restructure reading input from program to simplify handling of dot input stream.

7 years agolib-program-client: Use reliable means of checking for input stream EOF.
Stephan Bosch [Mon, 22 Jan 2018 22:25:34 +0000 (23:25 +0100)] 
lib-program-client: Use reliable means of checking for input stream EOF.

7 years agolib-program-client: Remove check for -2 returned from i_stream_read_more().
Stephan Bosch [Wed, 24 Jan 2018 20:48:07 +0000 (21:48 +0100)] 
lib-program-client: Remove check for -2 returned from i_stream_read_more().

The stream must have space for at least 1 byte.

7 years agolib-program-client: Remove useless stream eof check.
Stephan Bosch [Tue, 23 Jan 2018 21:16:26 +0000 (22:16 +0100)] 
lib-program-client: Remove useless stream eof check.

It also looks to be problematic.

7 years agolib-imap-client: continue imapc operation on parsing errors.
Sergey Kitov [Mon, 8 Jan 2018 09:38:37 +0000 (11:38 +0200)] 
lib-imap-client: continue imapc operation on parsing errors.

7 years agolib-smtp: client: Fix ignoring invalid certificate from server.
Stephan Bosch [Thu, 25 Jan 2018 21:24:05 +0000 (22:24 +0100)] 
lib-smtp: client: Fix ignoring invalid certificate from server.

Although it initially allowed the invalid certificate, it would still fail later
on while reading/writing the SSL streams.

7 years agolib-storage: Fix adding body.snippet to cache
Timo Sirainen [Thu, 25 Jan 2018 10:27:41 +0000 (12:27 +0200)] 
lib-storage: Fix adding body.snippet to cache

Unless body.snippet was in mail_always_cache_fields, it didn't get added to
the cache file.

7 years agolib-storage: Add comment to how mail_cache_field_can/want_add() is used
Timo Sirainen [Thu, 25 Jan 2018 10:35:51 +0000 (12:35 +0200)] 
lib-storage: Add comment to how mail_cache_field_can/want_add() is used

7 years agolib-index: Update comments for mail_cache_decision_*()
Timo Sirainen [Thu, 25 Jan 2018 10:35:35 +0000 (12:35 +0200)] 
lib-index: Update comments for mail_cache_decision_*()

7 years agolib-auth: Fix memory leak in auth_client_request_abort()
Timo Sirainen [Mon, 18 Dec 2017 14:50:51 +0000 (16:50 +0200)] 
lib-auth: Fix memory leak in auth_client_request_abort()

This caused memory leaks when authentication was aborted. For example
with IMAP:

a AUTHENTICATE PLAIN
*

Broken by 9137c55411aa39d41c1e705ddc34d5bd26c65021

7 years agolib: i_stream_read_more() - assert it can't return -2
Timo Sirainen [Wed, 24 Jan 2018 11:47:50 +0000 (13:47 +0200)] 
lib: i_stream_read_more() - assert it can't return -2

7 years agolib-index: Write forced cache decision changes immediately to cache file
Timo Sirainen [Wed, 24 Jan 2018 16:01:48 +0000 (18:01 +0200)] 
lib-index: Write forced cache decision changes immediately to cache file

When mail_always/never_cache_fields doesn't match the current caching
decisions in the cache file, write the updated decisions to the file.

7 years agolib-index: Code cleanup for reading caching decisions
Timo Sirainen [Wed, 24 Jan 2018 16:01:23 +0000 (18:01 +0200)] 
lib-index: Code cleanup for reading caching decisions

No functional changes.

7 years agolib-index: Finish fixing removal of forced cache decisions from existing cache files
Timo Sirainen [Wed, 24 Jan 2018 15:58:57 +0000 (17:58 +0200)] 
lib-index: Finish fixing removal of forced cache decisions from existing cache files

6ef2504d020461b0f480766c41596595a4300023 didn't fix it for already known
fields.

7 years agolib-storage: Rename .vsize.lock file to dovecot-vsize.lock
Aki Tuomi [Wed, 24 Jan 2018 12:48:36 +0000 (14:48 +0200)] 
lib-storage: Rename .vsize.lock file to dovecot-vsize.lock

.vsize.lock can break maildir++ because it looks like a maildir folder,
so rename it to dovecot-vsize.lock.

Introduced in 9963bef6

7 years agopush-notification: PUSH_NOTIFICATION_USER_CONTEXT is now required
Aki Tuomi [Tue, 23 Jan 2018 08:51:26 +0000 (10:51 +0200)] 
push-notification: PUSH_NOTIFICATION_USER_CONTEXT is now required

Satisfies static analyzers

7 years agofts-lucene: Add and use FTS_LUCENE_USER_CONTEXT_REQUIRE
Aki Tuomi [Tue, 23 Jan 2018 08:49:40 +0000 (10:49 +0200)] 
fts-lucene: Add and use FTS_LUCENE_USER_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agowelcome: WELCOME_CONTEXT is now required
Aki Tuomi [Tue, 23 Jan 2018 08:47:49 +0000 (10:47 +0200)] 
welcome: WELCOME_CONTEXT is now required

Satisfies static analyzers

7 years agoexpire: DOVEADM_EXPIRE_MAIL_CMD_CONTEXT is now required
Aki Tuomi [Tue, 23 Jan 2018 08:46:30 +0000 (10:46 +0200)] 
expire: DOVEADM_EXPIRE_MAIL_CMD_CONTEXT is now required

Satisfied static analyzers

7 years agovirtual: Contexts are now required or checked
Aki Tuomi [Tue, 23 Jan 2018 08:44:02 +0000 (10:44 +0200)] 
virtual: Contexts are now required or checked

Satisfies static analyzers

7 years agoquota: Add and use QUOTA_USER_CONTEXT_REQUIRE
Aki Tuomi [Tue, 23 Jan 2018 08:41:35 +0000 (10:41 +0200)] 
quota: Add and use QUOTA_USER_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agoimap-zlib: Context is now required
Aki Tuomi [Tue, 23 Jan 2018 08:40:23 +0000 (10:40 +0200)] 
imap-zlib: Context is now required

Satisfies static analyzers

7 years agolazy-expunge: Fix context checking
Aki Tuomi [Tue, 23 Jan 2018 08:39:30 +0000 (10:39 +0200)] 
lazy-expunge: Fix context checking

Was not done properly in 462a3d92adcde4bfa9a575875bd8ae740b89ce9e

7 years agomail-crypt: Add and use MAIL_CRYPT_USER_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 12:04:47 +0000 (14:04 +0200)] 
mail-crypt: Add and use MAIL_CRYPT_USER_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agofts-solr: Add and use FTS_SOLR_USER_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 12:02:39 +0000 (14:02 +0200)] 
fts-solr: Add and use FTS_SOLR_USER_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agoacl: Fix ACL_CONTEXT check
Aki Tuomi [Tue, 23 Jan 2018 09:37:41 +0000 (11:37 +0200)] 
acl: Fix ACL_CONTEXT check

Was incorrect in 3131b3878de3245db7552234e66d437e8fde9351

7 years agoacl: Add and use ACL_USER_CONTEXT_REQUIRE
Aki Tuomi [Tue, 23 Jan 2018 08:38:41 +0000 (10:38 +0200)] 
acl: Add and use ACL_USER_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agoacl: Add and use ACL_LIST_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 12:00:37 +0000 (14:00 +0200)] 
acl: Add and use ACL_LIST_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agolib-storage: imapc - Ensure search ctx is not NULL
Aki Tuomi [Mon, 22 Jan 2018 11:57:12 +0000 (13:57 +0200)] 
lib-storage: imapc - Ensure search ctx is not NULL

Satisfies static analyzers

7 years agolib-storage: Add and use MAIL_STORAGE_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 11:54:58 +0000 (13:54 +0200)] 
lib-storage: Add and use MAIL_STORAGE_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agolib-storage: Add and use MAIL_THREAD_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 11:52:37 +0000 (13:52 +0200)] 
lib-storage: Add and use MAIL_THREAD_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agolib-index: Add and use CACHE_TRANS_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 11:50:37 +0000 (13:50 +0200)] 
lib-index: Add and use CACHE_TRANS_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agolib-storage: Add and use INDEX_LIST_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 07:38:26 +0000 (09:38 +0200)] 
lib-storage: Add and use INDEX_LIST_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agomail-log: Contexts are now required or checked
Aki Tuomi [Sat, 20 Jan 2018 18:42:02 +0000 (20:42 +0200)] 
mail-log: Contexts are now required or checked

Satisfies static analyzers

7 years agoauth: db-lua - Do not assert-crash if given parameter was not auth_request
Aki Tuomi [Sat, 20 Jan 2018 13:44:56 +0000 (15:44 +0200)] 
auth: db-lua - Do not assert-crash if given parameter was not auth_request

Use luaL_error instead that will back out more gracefully.

Fixes Panic: file db-lua.c: line 279 (auth_lua_check_auth_request): assertion failed: (lua_istable(script->L, arg))

7 years agoauth: db-lua - Use luaL_error correctly
Aki Tuomi [Sat, 20 Jan 2018 18:33:01 +0000 (20:33 +0200)] 
auth: db-lua - Use luaL_error correctly

7 years agolib-index: Fix removal of forced cache decisions from existing cache files
Timo Sirainen [Mon, 22 Jan 2018 22:04:28 +0000 (00:04 +0200)] 
lib-index: Fix removal of forced cache decisions from existing cache files

The forced-flags are written to the cache file when the file is created.
They were also read back, and the force-flag was preserved even when the
configuration was removed.

7 years agolib-index: Fix adding forced cache decisions to existing cache files
Timo Sirainen [Mon, 22 Jan 2018 15:38:32 +0000 (17:38 +0200)] 
lib-index: Fix adding forced cache decisions to existing cache files

If a field already existed in the cache file, the cache decision from the
file was always used. This caused force-decisions to be ignored.

7 years agosubmission: Enable verbose reporting of relay server certificate problems.
Stephan Bosch [Mon, 22 Jan 2018 17:51:21 +0000 (18:51 +0100)] 
submission: Enable verbose reporting of relay server certificate problems.

7 years agolib: cast {,CONST_}PTR_OFFSET's offset argument to size_t
Josef 'Jeff' Sipek [Mon, 22 Jan 2018 20:58:51 +0000 (15:58 -0500)] 
lib: cast {,CONST_}PTR_OFFSET's offset argument to size_t

This fixes build on 32-bit systems where the addition may cause integer
promotion to an integer type larger than uintptr_t.

gcc 6.3.0 warning:

file-cache.c: In function 'file_cache_write':
macros.h:25:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  ((void *) (((uintptr_t) (ptr)) + (offset)))

7 years agolib-smtp: client: Assign only connection settings during connection initialization.
Stephan Bosch [Fri, 19 Jan 2018 22:32:31 +0000 (23:32 +0100)] 
lib-smtp: client: Assign only connection settings during connection initialization.

Due to some copy-paste mistake, some global client settings were assigned
instead.

7 years agolib-smtp: client: Always use per-connection settings in connection.
Stephan Bosch [Fri, 19 Jan 2018 22:31:05 +0000 (23:31 +0100)] 
lib-smtp: client: Always use per-connection settings in connection.

Some part of the connection code referred to global client settings.

7 years agolib-smtp: client: Properly allow per-connection SSL configuration.
Stephan Bosch [Fri, 19 Jan 2018 15:05:18 +0000 (16:05 +0100)] 
lib-smtp: client: Properly allow per-connection SSL configuration.

Although this was already partially possible, the connection was still always
using the global client SSL context.

7 years agolib-smtp: client: Fix segfault occurring in connection when SSL certificate is invalid.
Stephan Bosch [Fri, 19 Jan 2018 13:44:50 +0000 (14:44 +0100)] 
lib-smtp: client: Fix segfault occurring in connection when SSL certificate is invalid.

The connection is using its own local SSL settings to determine whether an
invalid certificate is allowed. However, these local settings were not properly
initialized.

7 years agoimapc: Fix deleting mailbox
Timo Sirainen [Mon, 22 Jan 2018 11:33:29 +0000 (13:33 +0200)] 
imapc: Fix deleting mailbox

Broken by f8f30bd27e41e1041a8de0b97f35d7d75e0a412e

7 years agolib-http: test-http-payload: Initialize http_context in test_client_create_clients().
Stephan Bosch [Sat, 20 Jan 2018 17:48:00 +0000 (18:48 +0100)] 
lib-http: test-http-payload: Initialize http_context in test_client_create_clients().

Fixes complaint from scan-build.

7 years agolib-smtp: address: Remove useless local variable initialization in smtp_address_clone().
Stephan Bosch [Sat, 20 Jan 2018 15:48:03 +0000 (16:48 +0100)] 
lib-smtp: address: Remove useless local variable initialization in smtp_address_clone().

Fixes complaint from scan-build.

7 years agoimap: support for FETCH SNIPPET
Josef 'Jeff' Sipek [Thu, 4 Jan 2018 17:44:16 +0000 (12:44 -0500)] 
imap: support for FETCH SNIPPET

7 years agoold-stats-plugin: Fix context requirements
Aki Tuomi [Fri, 19 Jan 2018 08:27:09 +0000 (10:27 +0200)] 
old-stats-plugin: Fix context requirements

Fixes Panic: Module context stats_storage_module missing

Broken by 6afdf0b6fce26c5492d5e56f6f16fb8a4d869566

7 years agopop3-migration-plugin: Fix context requirements
Aki Tuomi [Thu, 18 Jan 2018 13:29:42 +0000 (15:29 +0200)] 
pop3-migration-plugin: Fix context requirements

Fixes Panic: Module context pop3_migration_storage_module missing

Broken by a8703ce24540b7efaa51a8c7d3c72e72727f9789

7 years agoglobal: don't cast NULL to void *
Josef 'Jeff' Sipek [Thu, 4 Jan 2018 17:41:23 +0000 (12:41 -0500)] 
global: don't cast NULL to void *

NULL is guaranteed to be a void * thanks to
dd6043c05e32a8e8db1233ed711a2c74d1477a89.

7 years agoauth: passdb-cache - Verify credentials with worker when enabled
Aki Tuomi [Mon, 8 Jan 2018 13:08:10 +0000 (15:08 +0200)] 
auth: passdb-cache - Verify credentials with worker when enabled

7 years agoauth: Expose auth_request_verify_plain_callback_finish
Aki Tuomi [Mon, 8 Jan 2018 13:00:17 +0000 (15:00 +0200)] 
auth: Expose auth_request_verify_plain_callback_finish

7 years agoauth-worker: Support PASSW request
Aki Tuomi [Mon, 8 Jan 2018 13:09:28 +0000 (15:09 +0200)] 
auth-worker: Support PASSW request

This will attempt to verify given credentials.

7 years agoauth-worker: Add auth_worker_auth_request_new
Aki Tuomi [Mon, 8 Jan 2018 12:52:10 +0000 (14:52 +0200)] 
auth-worker: Add auth_worker_auth_request_new

Replaces worker_auth_request_new, moves in
check for username and service. Simplifies code.

7 years agoauth: passdb-blocking - Expose passdb_blocking_auth_worker_reply_parse
Aki Tuomi [Tue, 2 Jan 2018 10:33:50 +0000 (12:33 +0200)] 
auth: passdb-blocking - Expose passdb_blocking_auth_worker_reply_parse

Enables sharing code with passdb cache

7 years agolast-login: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 10:15:16 +0000 (12:15 +0200)] 
last-login: Contexts are now required or checked

Satisfies static analyzers

7 years agomail-crypt: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 10:14:22 +0000 (12:14 +0200)] 
mail-crypt: Contexts are now required or checked

Satisfies static analyzers

7 years agoold-stats: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:28:48 +0000 (10:28 +0200)] 
old-stats: Contexts are now required or checked

Satisfies static analyzers

7 years agoquota-clone: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:23:05 +0000 (10:23 +0200)] 
quota-clone: Contexts are now required or checked

Satisfies static analyzers

7 years agozlib: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:21:52 +0000 (10:21 +0200)] 
zlib: Contexts are now required or checked

Satisfies static analyzers

7 years agomailbox-alias: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:10:41 +0000 (10:10 +0200)] 
mailbox-alias: Contexts are now required or checked

Satisfies static analyzers

7 years agomail-filter: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:07:37 +0000 (10:07 +0200)] 
mail-filter: Contexts are now required or checked

Satisfies static analyzers

7 years agonotify: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:06:25 +0000 (10:06 +0200)] 
notify: Contexts are now required or checked

Satisfied static analyzers

7 years agopop3-migration: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 07:31:44 +0000 (09:31 +0200)] 
pop3-migration: Contexts are now required or checked

Satisfies static analyzers

7 years agoquota: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:40:11 +0000 (20:40 +0200)] 
quota: Contexts are now required or checked

Satisfied static analyzers

7 years agoapparmor: Ensure auser is not NULL
Aki Tuomi [Sun, 14 Jan 2018 18:33:48 +0000 (20:33 +0200)] 
apparmor: Ensure auser is not NULL

Satisfies static analyzers

7 years agolazy-expunge: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:25:16 +0000 (20:25 +0200)] 
lazy-expunge: Contexts are now required or checked

Satisfied static analyzers

7 years agofts: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:18:45 +0000 (20:18 +0200)] 
fts: Contexts are now required or checked

Satisfied static analyzer

7 years agosnarf: If sstorage is NULL, do not allocate box
Aki Tuomi [Sun, 14 Jan 2018 18:08:11 +0000 (20:08 +0200)] 
snarf: If sstorage is NULL, do not allocate box

Old code would continue if sstorage was NULL.

Found by static analyzer

7 years agosnarf: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:07:31 +0000 (20:07 +0200)] 
snarf: Contexts are now required or checked

Satisfies static analyzers

7 years agoexpire: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:00:04 +0000 (20:00 +0200)] 
expire: Contexts are now required or checked

Satisfied static analyzers

7 years agotrash: Ensure quser is not NULL
Aki Tuomi [Sun, 14 Jan 2018 17:57:16 +0000 (19:57 +0200)] 
trash: Ensure quser is not NULL

Satisfies static analyzers

7 years agoacl: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 17:56:19 +0000 (19:56 +0200)] 
acl: Contexts are now required or checked

Satisfies static analyzers

7 years agoreplication: Check ruser for NULL
Aki Tuomi [Sun, 14 Jan 2018 17:46:13 +0000 (19:46 +0200)] 
replication: Check ruser for NULL

Satisfies static analyzers

7 years agoimap-old-stats-plugins: Check suser for NULL
Aki Tuomi [Sun, 14 Jan 2018 17:43:39 +0000 (19:43 +0200)] 
imap-old-stats-plugins: Check suser for NULL

Satisfies static analyzers

7 years agolib-sql: SQL_DB_CACHE_CONTEXT now requires context
Aki Tuomi [Wed, 17 Jan 2018 10:25:18 +0000 (12:25 +0200)] 
lib-sql: SQL_DB_CACHE_CONTEXT now requires context

Satisfies static analyzers

7 years agolib-storage: MBOX_LIST_CONTEXT now requires context
Aki Tuomi [Wed, 17 Jan 2018 07:29:23 +0000 (09:29 +0200)] 
lib-storage: MBOX_LIST_CONTEXT now requires context

Satisfies static analyzers

7 years agolib-storage: INDEX_LIST_STORAGE_CONTEXT now requires context
Aki Tuomi [Wed, 17 Jan 2018 07:29:53 +0000 (09:29 +0200)] 
lib-storage: INDEX_LIST_STORAGE_CONTEXT now requires context

Satisfies static analyzers

7 years agolib-storage: INDEX_STORAGE_CONTEXT now requires context
Aki Tuomi [Wed, 17 Jan 2018 07:25:26 +0000 (09:25 +0200)] 
lib-storage: INDEX_STORAGE_CONTEXT now requires context

Satisfies static analyzers

7 years agolib-lda: Require context in mail-deliver
Aki Tuomi [Wed, 17 Jan 2018 10:24:21 +0000 (12:24 +0200)] 
lib-lda: Require context in mail-deliver

Satisfies static analyzers

7 years agolib: Add MODULE_CONTEXT_REQUIRE
Aki Tuomi [Fri, 12 Jan 2018 13:10:48 +0000 (15:10 +0200)] 
lib: Add MODULE_CONTEXT_REQUIRE

This will panic instead of return NULL. Should satisfy static
analyzers when used.

7 years agoimapc: Fix sending initial FETCH after reconnection SELECTs mailbox
Timo Sirainen [Mon, 25 Dec 2017 14:11:26 +0000 (16:11 +0200)] 
imapc: Fix sending initial FETCH after reconnection SELECTs mailbox

Move sending the FETCH when the SELECT returns tagged OK reply instead of
delaying it until mailbox is next synced. Most importantly this allows
sending the FETCH before any retried commands that are also sent after
SELECT receives tagged reply.

7 years agoimapc: gmail-migration: Fetch X-GM-MSGID for new mails as well
Timo Sirainen [Mon, 25 Dec 2017 20:48:00 +0000 (22:48 +0200)] 
imapc: gmail-migration: Fetch X-GM-MSGID for new mails as well

I'm not sure why it was originally restricted only for the initial FETCH.
Fetching GUIDs for new mails can be just as useful.

7 years agoimapc: Move imapc_mailbox_fetch_state*() to imapc-mailbox.c
Timo Sirainen [Mon, 25 Dec 2017 18:21:40 +0000 (20:21 +0200)] 
imapc: Move imapc_mailbox_fetch_state*() to imapc-mailbox.c

Mainly to make the next commit smaller.

7 years agoimapc: Handle untagged UIDVALIDITY immediately
Timo Sirainen [Mon, 25 Dec 2017 17:19:09 +0000 (19:19 +0200)] 
imapc: Handle untagged UIDVALIDITY immediately

This is part of the changes to fix mailbox resyncing after reconnect.

7 years agoimapc: If mailbox select fails, rollback any changes done to it
Timo Sirainen [Mon, 25 Dec 2017 17:34:31 +0000 (19:34 +0200)] 
imapc: If mailbox select fails, rollback any changes done to it

Required by the following changes that start adding changes immediately
after SELECT. If the initial syncing doesn't finish successfully, these
changes need to be reverted.

7 years agoimapc: Keep "selected" state TRUE only while mailbox is successfully SELECTed
Timo Sirainen [Mon, 25 Dec 2017 17:33:33 +0000 (19:33 +0200)] 
imapc: Keep "selected" state TRUE only while mailbox is successfully SELECTed

7 years agoimapc: Fix leaking mail_index_view on delayed expunge handling
Timo Sirainen [Wed, 17 Jan 2018 13:05:38 +0000 (15:05 +0200)] 
imapc: Fix leaking mail_index_view on delayed expunge handling

Fixes:
Panic: Leaked view for index (in-memory index): Opened in imapc-mailbox.c:47

7 years agolib-imap-client: Avoid "Unknown tag" errors for aborted commands
Timo Sirainen [Wed, 17 Jan 2018 13:03:06 +0000 (15:03 +0200)] 
lib-imap-client: Avoid "Unknown tag" errors for aborted commands

If mailbox is closed before all command replies were received, the commands
were aborted but they'll still receive the replies from server. Remember
the aborted commands' tag numbers so they can be ignored.

7 years agolib-imap-client: Fix reason text when unselecting mailbox aborts commands
Timo Sirainen [Wed, 17 Jan 2018 13:02:09 +0000 (15:02 +0200)] 
lib-imap-client: Fix reason text when unselecting mailbox aborts commands