]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
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
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
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
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
Aki Tuomi [Sat, 20 Jan 2018 18:42:02 +0000 (20:42 +0200)]
mail-log: Contexts are now required or checked
Satisfies static analyzers
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))
Aki Tuomi [Sat, 20 Jan 2018 18:33:01 +0000 (20:33 +0200)]
auth: db-lua - Use luaL_error correctly
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.
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.
Stephan Bosch [Mon, 22 Jan 2018 17:51:21 +0000 (18:51 +0100)]
submission: Enable verbose reporting of relay server certificate problems.
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)))
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.
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.
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.
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.
Timo Sirainen [Mon, 22 Jan 2018 11:33:29 +0000 (13:33 +0200)]
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.
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.
Josef 'Jeff' Sipek [Thu, 4 Jan 2018 17:44:16 +0000 (12:44 -0500)]
imap: support for FETCH SNIPPET
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
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
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 .
Aki Tuomi [Mon, 8 Jan 2018 13:08:10 +0000 (15:08 +0200)]
auth: passdb-cache - Verify credentials with worker when enabled
Aki Tuomi [Mon, 8 Jan 2018 13:00:17 +0000 (15:00 +0200)]
auth: Expose auth_request_verify_plain_callback_finish
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.
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.
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
Aki Tuomi [Wed, 17 Jan 2018 10:15:16 +0000 (12:15 +0200)]
last-login: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 10:14:22 +0000 (12:14 +0200)]
mail-crypt: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:28:48 +0000 (10:28 +0200)]
old-stats: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:23:05 +0000 (10:23 +0200)]
quota-clone: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:21:52 +0000 (10:21 +0200)]
zlib: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:10:41 +0000 (10:10 +0200)]
mailbox-alias: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:07:37 +0000 (10:07 +0200)]
mail-filter: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:06:25 +0000 (10:06 +0200)]
notify: Contexts are now required or checked
Satisfied static analyzers
Aki Tuomi [Wed, 17 Jan 2018 07:31:44 +0000 (09:31 +0200)]
pop3-migration: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Sun, 14 Jan 2018 18:40:11 +0000 (20:40 +0200)]
quota: Contexts are now required or checked
Satisfied static analyzers
Aki Tuomi [Sun, 14 Jan 2018 18:33:48 +0000 (20:33 +0200)]
apparmor: Ensure auser is not NULL
Satisfies static analyzers
Aki Tuomi [Sun, 14 Jan 2018 18:25:16 +0000 (20:25 +0200)]
lazy-expunge: Contexts are now required or checked
Satisfied static analyzers
Aki Tuomi [Sun, 14 Jan 2018 18:18:45 +0000 (20:18 +0200)]
fts: Contexts are now required or checked
Satisfied static analyzer
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
Aki Tuomi [Sun, 14 Jan 2018 18:07:31 +0000 (20:07 +0200)]
snarf: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Sun, 14 Jan 2018 18:00:04 +0000 (20:00 +0200)]
expire: Contexts are now required or checked
Satisfied static analyzers
Aki Tuomi [Sun, 14 Jan 2018 17:57:16 +0000 (19:57 +0200)]
trash: Ensure quser is not NULL
Satisfies static analyzers
Aki Tuomi [Sun, 14 Jan 2018 17:56:19 +0000 (19:56 +0200)]
acl: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Sun, 14 Jan 2018 17:46:13 +0000 (19:46 +0200)]
replication: Check ruser for NULL
Satisfies static analyzers
Aki Tuomi [Sun, 14 Jan 2018 17:43:39 +0000 (19:43 +0200)]
imap-old-stats-plugins: Check suser for NULL
Satisfies static analyzers
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
Aki Tuomi [Wed, 17 Jan 2018 07:29:23 +0000 (09:29 +0200)]
lib-storage: MBOX_LIST_CONTEXT now requires context
Satisfies static analyzers
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
Aki Tuomi [Wed, 17 Jan 2018 07:25:26 +0000 (09:25 +0200)]
lib-storage: INDEX_STORAGE_CONTEXT now requires context
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 10:24:21 +0000 (12:24 +0200)]
lib-lda: Require context in mail-deliver
Satisfies static analyzers
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.
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.
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.
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.
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.
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.
Timo Sirainen [Mon, 25 Dec 2017 17:33:33 +0000 (19:33 +0200)]
imapc: Keep "selected" state TRUE only while mailbox is successfully SELECTed
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
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.
Timo Sirainen [Wed, 17 Jan 2018 13:02:09 +0000 (15:02 +0200)]
lib-imap-client: Fix reason text when unselecting mailbox aborts commands
Timo Sirainen [Mon, 25 Dec 2017 19:31:05 +0000 (21:31 +0200)]
lib-imap-client: Add asserts for reconnect_command_count
Timo Sirainen [Mon, 25 Dec 2017 19:29:06 +0000 (21:29 +0200)]
lib-imap-client: Delay sending more commands while SELECT is running
Timo Sirainen [Mon, 25 Dec 2017 16:49:15 +0000 (18:49 +0200)]
lib-imap-client: After reconnection send retried commands last
Previously only SELECT was sent before others. This allows sending more
commands on reconnection before the retried commands.
Stephan Bosch [Sat, 13 Jan 2018 10:53:43 +0000 (11:53 +0100)]
lmtp: local: Don't deliver more than once to the same recipient.
Duplicate RCPT TO commands for local recipients are now mostly ignored,
by repeating the reply for the first instance of that RCPT TO command.
Stephan Bosch [Sat, 13 Jan 2018 12:34:47 +0000 (13:34 +0100)]
lmtp: Add recipient type to struct lmtp_recipient.
Stephan Bosch [Sat, 13 Jan 2018 12:25:01 +0000 (13:25 +0100)]
lmtp: Move common recipient handling code to separate file.
Stephan Bosch [Sat, 13 Jan 2018 12:10:53 +0000 (13:10 +0100)]
lib-smtp: server: Use smtp_server_reply_submit_duplicate() in smtp_server_reply_allv().
This is more efficient, since it doesn't need to compose new content for each
reply.
Stephan Bosch [Sat, 13 Jan 2018 12:08:53 +0000 (13:08 +0100)]
lib-smtp: server: Add function that allows submitting duplicate replies.
The smtp_server_reply_submit_duplicate() function submits a new reply at the
specified index with content duplicated from an existing earlier reply.
Stephan Bosch [Sat, 13 Jan 2018 12:03:48 +0000 (13:03 +0100)]
lib-smtp: server: Move allocation of command replies to a separate function.
Stephan Bosch [Sat, 13 Jan 2018 11:43:08 +0000 (12:43 +0100)]
lib-smtp: server: Put reply content in a separate struct.
This allows duplicate replies to share content for a multi-reply command.
Stephan Bosch [Sat, 13 Jan 2018 11:56:59 +0000 (12:56 +0100)]
lib-smtp: server: Allow part of the replies to be already sent in smtp_server_reply_allv().
This is not something observed to happen in existing code, but it is best to
deal with this properly, as it could happen in the future.
Stephan Bosch [Sat, 13 Jan 2018 11:26:57 +0000 (12:26 +0100)]
lib-smtp: server: transaction: Add function that finds duplicate recipients.
Duplicate means that both the path and parameters are equal.
Stephan Bosch [Sat, 13 Jan 2018 11:20:34 +0000 (12:20 +0100)]
lib-smtp: server: Add RCPT parameters directly in smtp_server_transaction_add_rcpt().
This makes more sense. Before, these were added to the recipient in
smtp-server-cmd-rcpt.c, after the recipient was added.
Stephan Bosch [Sat, 13 Jan 2018 10:52:31 +0000 (11:52 +0100)]
lib-smtp: params: Add function that allows checking whether RCPT parameters are equal.
Stephan Bosch [Sat, 13 Jan 2018 11:07:46 +0000 (12:07 +0100)]
lib-smtp: params: Add functions to evaluate any extra (non-standard) MAIL and RCPT parameters.
These allow looking up the parameter based on its name.
Stephan Bosch [Sat, 13 Jan 2018 10:51:24 +0000 (11:51 +0100)]
lib-smtp: address: Consistently allow address values to be NULL.
If the address pointer is NULL or the localpart field is NULL or empty, it
signifies that it is the NULL address "<>".
In the case of smtp_address_equals(), this also likely fixes crashes at places
where it may be used to compare "<>".
Stephan Bosch [Sat, 13 Jan 2018 10:59:54 +0000 (11:59 +0100)]
lib-smtp: address: Rename 'poo' to 'pool' in declaration of smtp_address_detail_parse().
Stephan Bosch [Wed, 17 Jan 2018 20:26:44 +0000 (21:26 +0100)]
lmtp: local: Fix segfault occurring when quota is exceeded.
Martin Cyr [Sat, 13 Jan 2018 21:15:47 +0000 (16:15 -0500)]
Always link krb5 when gssapi is requested
Since krb5_free_context is defined in libkrb5, not libgssapi, it must be
linked, even when gssapi is found.
krb5-config --libs gssapi alone will not provide -lkrb5.
Also, krb5-config --version ANYTHING will always return 0 (at least with
Heimdal).
Aki Tuomi [Sun, 14 Jan 2018 17:21:36 +0000 (19:21 +0200)]
lib: Use uintptr_t in PTR_OFFSET and POINTER_CAST
Use uintptr_t instead of pointers.
Fixes clang 6.0 warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension
Aki Tuomi [Sat, 11 Nov 2017 08:07:42 +0000 (10:07 +0200)]
lib-storage: Set keyword based on attachment presence when saving
If attachment is detected, use $HasAttachment, if not
use $HasNoAttachment
Aki Tuomi [Mon, 20 Nov 2017 08:09:23 +0000 (10:09 +0200)]
lib-storage: Add attachment detection settings
Aki Tuomi [Fri, 10 Nov 2017 12:32:44 +0000 (14:32 +0200)]
lib-mail: Add message_part_has_attachment
Timo Sirainen [Tue, 16 Jan 2018 16:17:00 +0000 (18:17 +0200)]
imapc: Fix imap_features=no-msn-updates to not fail on SELECT
The initial EXISTS reply shouldn't be ignored, only the following ones.
Martti Rannanjärvi [Fri, 12 Jan 2018 13:28:52 +0000 (15:28 +0200)]
lib-master: Copy settings_parser_get_error() string so it's usable as error_r
Also convert t_strdup()s in master_service_settings_read() into p_strdup()s
using service->set_pool.
Stephan Bosch [Fri, 12 Jan 2018 20:03:41 +0000 (21:03 +0100)]
lib-http: queue: Update the correct timout while dropping a request from the delay queue.
The absolute request timeout rather than the delay timeout was updated for the
removal of the request from the delay queue.
Timo Sirainen [Thu, 11 Jan 2018 18:38:14 +0000 (13:38 -0500)]
*-login: Fix clients linked list corruption with SSL connections
This could have resulted in infinite loops or some of the clients being
skipped for some operations.
Aki Tuomi [Thu, 11 Jan 2018 14:10:48 +0000 (16:10 +0200)]
auth: Ensure crypt schemes match with samples
Aki Tuomi [Thu, 11 Jan 2018 13:22:30 +0000 (15:22 +0200)]
auth: Fix crypt scheme detection
Broken by
1ebb6094e5105ba7ef521a0177c42d3ea81243f0
Timo Sirainen [Tue, 9 Jan 2018 21:01:42 +0000 (16:01 -0500)]
imap-login: Simplify ID handling code
Timo Sirainen [Wed, 14 Jun 2017 07:46:53 +0000 (10:46 +0300)]
imap-login: Rewrite ID parameter handling to be less fragile
There's no longer two places that need to be kept in sync.
Timo Sirainen [Wed, 14 Jun 2017 07:34:57 +0000 (10:34 +0300)]
imap-login: Move ID command handling to its own file.
Aki Tuomi [Fri, 5 Jan 2018 07:51:00 +0000 (09:51 +0200)]
lib-mail: mail-html2text - Validate UCS4 codepoint
Fixes: Panic: file unichar.c: line 160 (uni_ucs4_to_utf8_c): assertion failed: (uni_is_valid_ucs4(chr))
Timo Sirainen [Sat, 6 Jan 2018 20:11:30 +0000 (22:11 +0200)]
doveadm dump: Fix imapzlib to handle input traffic
This has been broken with newer Dovecot versions for a while now.
Timo Sirainen [Sat, 6 Jan 2018 19:22:11 +0000 (21:22 +0200)]
ostream-zlib: Ignore missing finish if parent stream is ignoring errors
This fixes panic with imap_zlib plugin when client enables the IMAP COMPRESS
extension and disconnects:
Panic: file ostream-zlib.c: line 36 (o_stream_zlib_close): assertion failed: (zstream->ostream.finished || zstream->ostream.ostream.stream_errno != 0)
Aki Tuomi [Wed, 27 Dec 2017 12:08:13 +0000 (14:08 +0200)]
doveadm: Add NOREPLICATE error when "noreplicate" user flag is used
It will be only understood if -U flag has been used
Aki Tuomi [Wed, 27 Dec 2017 12:07:30 +0000 (14:07 +0200)]
replicator: Remove user from replication if NOREPLICATE error is returned
Phil Carmody [Mon, 11 Dec 2017 12:03:13 +0000 (14:03 +0200)]
lib/lib-test: restore DOVECOT_SRAND feature in DEBUG builds
Add a deterministic PRNG, an ability to force its use, and an
ability to re-use the same sequence later.
Since proper random numbers have been forced into use, making
reproducable tests isn't quite as easy as it used to be, it's 3 steps
rather than 2. When seeing an intermittent test failure:
- rerun the tests with environmental variable DOVECOT_SRAND=kiss
- upon seeing a new failure case, note the seed logged at the failure
- debug using DOVECOT_SRAND=<that number>
In non-DEBUG builds, there's no trace of this code, and the
randomisation that is an inherent part of many tests remains
non-reproduceable.
Works with all of the RNG preferences, getrandom/urandom/arc4.
Signed-off-by: Phil Carmody <phil@dovecot.fi>