]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Thu, 9 Feb 2017 14:34:52 +0000 (16:34 +0200)]
lib-storage: Fix mailbox list index hook usage
The previous method appeared to work, but not if the internal hooks were
used more than once.
Martti Rannanjärvi [Tue, 14 Feb 2017 08:42:26 +0000 (10:42 +0200)]
lib-index: zero mmap_length after logging error
Logging that mmap(size=0) failed looks suspicious.
Aki Tuomi [Mon, 13 Feb 2017 17:40:22 +0000 (19:40 +0200)]
mail-crypt: Do not restrict access in unit test
This works around problem with docker
Timo Sirainen [Tue, 14 Feb 2017 08:54:29 +0000 (10:54 +0200)]
lib: Clarify *_strsplit_spaces() and add unit test
Timo Sirainen [Mon, 13 Feb 2017 21:46:15 +0000 (23:46 +0200)]
lib: Add pool_alloconly_create_clean()
This partially reverts
2a2beae3a4c1e75b3aeff996781503138e6f24bc
Timo Sirainen [Mon, 13 Feb 2017 18:02:24 +0000 (20:02 +0200)]
LAYOUT=index: Fix duplicate mailbox name renaming to actually work
Timo Sirainen [Mon, 13 Feb 2017 18:01:13 +0000 (20:01 +0200)]
LAYOUT=index: Rename mailbox_list_index_node.corrupted_parent to corrupted_ext
The code will be useful for other purposes also besides updating corrupted
parents.
Aki Tuomi [Tue, 31 Jan 2017 17:43:30 +0000 (19:43 +0200)]
driver-cassandra: Add support for speculative execution
Timo Sirainen [Wed, 8 Feb 2017 10:03:30 +0000 (12:03 +0200)]
lib-index: Add MAIL_INDEX_OPEN_FLAG_NO_DIRTY
This way mailbox format backends that don't need dirty flags can use them
for other purposes.
Timo Sirainen [Fri, 10 Feb 2017 14:26:15 +0000 (16:26 +0200)]
cassandra: Track query counts internally and include them in metrics
Timo Sirainen [Mon, 13 Feb 2017 16:06:46 +0000 (18:06 +0200)]
lib-compress: Fix missing .gz header error message
Timo Sirainen [Mon, 13 Feb 2017 16:05:13 +0000 (18:05 +0200)]
lib-compress: Fix assert-crash when .gz header size exceeds buffer max length
Instead treat the stream as corrupted and return EINVAL.
Fixes:
Panic: file istream.c: line 182 (i_stream_read): assertion failed: (_stream->skip != _stream->pos)
Timo Sirainen [Fri, 10 Feb 2017 13:27:13 +0000 (15:27 +0200)]
lib-http: http_client_request_add_header() - Add key/value asserts
These don't check that they're entirely correct as required by HTTP
specifications. They're mainly there as a quick check that if the caller
didn't validate the key/value in any way, we'll crash instead of creating
a potential security hole. (Because with line feeds the attacker could
add extra headers or even entirely new HTTP requests.)
Martti Rannanjärvi [Mon, 13 Feb 2017 07:09:28 +0000 (09:09 +0200)]
lib-index: clear file->mmap_size only after logging it
Logging the error with size=0 loses information.
Martti Rannanjärvi [Mon, 13 Feb 2017 07:08:25 +0000 (09:08 +0200)]
lib-index: don't reset ioloop_time on mmap error
The variables seems to have been in the wrong order.
Timo Sirainen [Wed, 8 Feb 2017 10:47:06 +0000 (12:47 +0200)]
quota: Log why quota_over_flag check is skipped if mail_debug=yes
Timo Sirainen [Tue, 7 Feb 2017 13:46:47 +0000 (15:46 +0200)]
quota: If quota_over_script is unset, skip the quota_over check.
Timo Sirainen [Tue, 7 Feb 2017 13:44:20 +0000 (15:44 +0200)]
quota: If quota_over_flag_value is unset, skip the quota_over check.
Timo Sirainen [Tue, 7 Feb 2017 13:33:07 +0000 (15:33 +0200)]
quota: Remove quota_over_flag_* from quota_root.
They are used only in one specific location and don't need to be stored
permanently.
Timo Sirainen [Fri, 10 Feb 2017 11:17:00 +0000 (13:17 +0200)]
global: Add asserts to make static analyzer happier.
Timo Sirainen [Fri, 10 Feb 2017 11:15:58 +0000 (13:15 +0200)]
pop3-login: Code cleanup - Make sure destroying client stops processing.
It would currently do it in any case, but this makes it clearer.
Timo Sirainen [Fri, 10 Feb 2017 11:15:26 +0000 (13:15 +0200)]
global: Ignore unnecessary return values.
Timo Sirainen [Fri, 10 Feb 2017 11:13:01 +0000 (13:13 +0200)]
mail-filter: Handle handshake write() failure
Timo Sirainen [Fri, 10 Feb 2017 10:50:58 +0000 (12:50 +0200)]
fts: Fix crash using fts_autoexpunge_exclude = \Special-use crash
It crashed whenever seeing a mailbox that didn't have any special-use flags.
Timo Sirainen [Fri, 10 Feb 2017 10:46:50 +0000 (12:46 +0200)]
doveadm mailbox metadata list: Fix listing all metadata.
It was listing only private attributes, because key_type=0 happens to be
MAIL_ATTRIBUTE_TYPE_PRIVATE and key was never NULL.
Timo Sirainen [Fri, 10 Feb 2017 10:41:28 +0000 (12:41 +0200)]
mail-crypt-acl: Fix error handling
Don't crash if mail_user creation failed.
Timo Sirainen [Fri, 10 Feb 2017 10:40:41 +0000 (12:40 +0200)]
doveadm mailbox cryptokey generate: Fix error handling
Don't crash if mail_user creation failed.
Timo Sirainen [Fri, 10 Feb 2017 10:33:01 +0000 (12:33 +0200)]
doveadm mailbox cryptokey generate: Fix memory leak
dest_user was set to NULL, but never freed.
Timo Sirainen [Fri, 10 Feb 2017 10:09:50 +0000 (12:09 +0200)]
doveadm director map: Fix checking if host parameter is required
Timo Sirainen [Fri, 10 Feb 2017 09:58:17 +0000 (11:58 +0200)]
lib: Avoid unnecessary Coverity warnings in MALLOC_*()
There doesn't seem to be any other nice way of avoiding these without
separately marking every instance.
Timo Sirainen [Thu, 9 Feb 2017 14:33:35 +0000 (16:33 +0200)]
TODO: Remove some of the implemented features
Timo Sirainen [Mon, 6 Feb 2017 16:34:05 +0000 (18:34 +0200)]
sdbox: Fix assert-crash on mailbox create race
If another process created the mailbox at the same time, the mailbox_guid
wasn't set and opening the mailbox assert-crashed:
Panic: file mail-storage.c: line 1744 (mailbox_get_metadata): assertion failed: ((items & MAILBOX_METADATA_GUID) == 0 || !guid_128_is_empty(metadata_r->guid))
Timo Sirainen [Tue, 7 Feb 2017 19:07:54 +0000 (21:07 +0200)]
quota: Clarify quota_count() return value.
Timo Sirainen [Tue, 7 Feb 2017 18:41:41 +0000 (20:41 +0200)]
quota: Make sure quota_warning doesn't wrap "quota before" value.
This could happen in some race conditions (and with bugs).
Timo Sirainen [Tue, 7 Feb 2017 16:26:50 +0000 (18:26 +0200)]
quota: When executing quota_warning/over_flag script, log the reason why.
Aki Tuomi [Tue, 7 Feb 2017 11:19:17 +0000 (13:19 +0200)]
lib: Check that output max size is non-zero when version specified
Otherwise we try to send version to non-existent output
stream.
Stephan Bosch [Sun, 22 Jan 2017 12:40:00 +0000 (13:40 +0100)]
lib-storage: Added mail_user_init_ssl_client_settings().
johnkwoods [Wed, 28 Dec 2016 18:02:14 +0000 (12:02 -0600)]
lib-ldap: Remove extra return
The ldap_connection_queue_request() function returns void. Trying to
"return" something from a void function caused compiling issues on
Solaris (Oracle Developer Studio 12.5).
J. Nick Koston [Sun, 22 Jan 2017 23:24:02 +0000 (17:24 -0600)]
fts-solr: Allow username/password for solr connction
Solr comes open to the world by default. For better
security, we protect our solr installs with a user
and password. This change allows dovecot to connect
to these instances.
Example usage in a fts.conf (permissions 0600)
fts_solr = url=http://nick:pass@127.0.0.1:8983/solr/dovecot/
Timo Sirainen [Wed, 8 Feb 2017 21:01:32 +0000 (23:01 +0200)]
pop3c: Increase timeout for PASS to 5 minutes.
Timo Sirainen [Mon, 6 Feb 2017 12:05:47 +0000 (14:05 +0200)]
indexer: Don't send more requests directly from worker status callback
This causes assert-crashes when workers disconnect while having multiple
requests:
indexer: Error: Indexer worker disconnected, discarding 2 requests for user@domain
indexer: Panic: file indexer.c: line 69 (queue_try_send_more): assertion failed: (worker_connection_is_connected(conn))
Timo Sirainen [Sun, 5 Feb 2017 14:49:05 +0000 (16:49 +0200)]
imap: Add imap_fetch_failure setting
This controls what happens when FETCH fails for some mails. The possible
values are:
disconnect-immediately: This is the original behavior. Whenever FETCH
fails for a mail, the FETCH is aborted and client is disconnected.
disconnect-after: The FETCH runs for all the requested mails, skipping
any mails that returned failures, but at the end the client is still
disconnected.
no-after: The FETCH runs for all the requested mails, skipping any mails
that returned failures. At the end tagged NO reply is returned. If the
client attempts to FETCH the same failed mail more than once, the client
is disconnected. This is to avoid clients from going into infinite loops
trying to FETCH a broken mail.
Martti Rannanjärvi [Mon, 2 May 2016 10:26:05 +0000 (13:26 +0300)]
lib-imap, imap: BINARY [UNKNOWNCTE] to [PARSE]
Timo Sirainen [Sun, 5 Feb 2017 14:24:08 +0000 (16:24 +0200)]
imap: Share mailbox closing code in SELECT/UNSELECT/CLOSE/LOGOUT/deinit
Timo Sirainen [Sun, 5 Feb 2017 14:23:35 +0000 (16:23 +0200)]
imap: Free search updates on CLOSE
Timo Sirainen [Sun, 5 Feb 2017 14:10:44 +0000 (16:10 +0200)]
imap: Don't send empty FETCH () on failure
It violates IMAP RFC. Send FETCH (UID n) instead.
Timo Sirainen [Mon, 6 Feb 2017 09:02:46 +0000 (11:02 +0200)]
lib-ssl-iostream: Fix memory leak in RSA_generate_key_ex() usage
Timo Sirainen [Mon, 6 Feb 2017 09:23:50 +0000 (11:23 +0200)]
auth: Handle delayed credentials identically in auth-workers
Timo Sirainen [Mon, 6 Feb 2017 08:55:40 +0000 (10:55 +0200)]
lib: Make sure NULL is defined to be ((void *)0)
This avoids us having to do explicit (void *)NULL casts in e.g.
io_add(..., NULL) context parameter.
Timo Sirainen [Sat, 4 Feb 2017 11:51:13 +0000 (13:51 +0200)]
lib-storage: Don't duplicate service user's settings into mail_user
The mail_storage_service_user.user_set isn't used afterwards, so it can be
directly used to avoid wasting memory.
Timo Sirainen [Sat, 4 Feb 2017 11:38:17 +0000 (13:38 +0200)]
lib-storage: Don't unnecessarily duplicate user's all setting strings
user->unexpanded_set and user->set have the same life-time, so they can
point to same strings.
Timo Sirainen [Sun, 5 Feb 2017 18:29:10 +0000 (20:29 +0200)]
lib-ssl-iostream: Remove libdovecot_openssl_common.la
Using such a library results in the same code being duplicated (in OSX) in
both libssl_iostream_openssl.so and libdcrypt_openssl.so. This breaks the
idea of openssl_init_refcount, because each one will have their own one.
libdcrypt_openssl.so now links to libssl_iostream_openssl.so, which
shouldn't really be a problem, because lib-ssl-iostream is part of the core
libdovecot.so already. It would have been possible to also install
libdovecot_openssl_common.so and link it to both libssl_iostream_openssl.so
and libdcrypt_openssl.so, but that seems unnecessarily complicated.
Timo Sirainen [Sun, 5 Feb 2017 18:28:04 +0000 (20:28 +0200)]
lib-ssl-iostream: Remove empty $(ssl_sources) from Makefile
Timo Sirainen [Sun, 5 Feb 2017 18:26:12 +0000 (20:26 +0200)]
lib-dcrypt: Link unit tests with libssl_iostream.la
libssl_iostream_openssl.so requires this, and it doesn't get added from
anywhere automatically.
Timo Sirainen [Sun, 5 Feb 2017 18:24:41 +0000 (20:24 +0200)]
lib-dcrypt: Remove unnecessary -shared link flag
Not sure if this is harmful, but since no other plugin uses this it's not
needed either.
Timo Sirainen [Sun, 5 Feb 2017 18:22:27 +0000 (20:22 +0200)]
lib-dcrypt: Don't link liblib.la to libdcrypt_openssl.so
At best this does nothing, at worst (like with OSX) it duplicates the
entire liblib and creates split state between the two instances.
Timo Sirainen [Sun, 5 Feb 2017 18:20:37 +0000 (20:20 +0200)]
lib-dcrypt: If dcrypt can't be initialized, log also the reason.
This is very helpful when debugging linking issues.
Timo Sirainen [Sun, 5 Feb 2017 19:38:33 +0000 (21:38 +0200)]
lib-ssl-iostream: Detect whether to call ERR_remove_[thread_]state() via configure
Timo Sirainen [Sun, 5 Feb 2017 19:31:08 +0000 (21:31 +0200)]
lib-ssl-iostream: Call OBJ_cleanup() for all OpenSSL versions
Just to reduce the #if checks that uglify the code.
Timo Sirainen [Sun, 5 Feb 2017 19:10:04 +0000 (21:10 +0200)]
lib-ssl-iostream: Detect OPENSSL_cleanup() via configure
It's ugly to have both OpenSSL version number check and a special LibreSSL
check.
Timo Sirainen [Sun, 5 Feb 2017 19:04:35 +0000 (21:04 +0200)]
lib-ssl-iostream: Detect OpenSSL memory functions' parameters via configure
The version number check doesn't work correctly for LibreSSL.
Timo Sirainen [Sun, 5 Feb 2017 19:56:20 +0000 (21:56 +0200)]
lib-ssl-iostream: Use ASN1_STRING_get0_data() if it exists
This avoids deprecation warnings about ASN1_STRING_data() in OpenSSL v1.1.
Timo Sirainen [Sun, 5 Feb 2017 19:51:29 +0000 (21:51 +0200)]
lib-ssl-iostream: Use RSA_generate_key_ex() if it exists
This avoids deprecation warnings about RSA_generate_key() in OpenSSL v1.1.
Timo Sirainen [Sun, 5 Feb 2017 22:11:14 +0000 (00:11 +0200)]
dict-sql: Move USING TIMESTAMP to correct location for INSERTs
Timo Sirainen [Sun, 5 Feb 2017 22:48:18 +0000 (00:48 +0200)]
auth: Pass through passdb extra fields to auth-worker requests
Timo Sirainen [Sun, 5 Feb 2017 22:46:55 +0000 (00:46 +0200)]
auth: Code cleanup - Move userdb extra fields exporting to its own function
Timo Sirainen [Wed, 25 Jan 2017 21:26:35 +0000 (23:26 +0200)]
lib-storage: Expunging now uses GUID only if it's in cache.
Otherwise the GUID lookup may be expensive, which is especially bad when
deleting a large number of mails.
Timo Sirainen [Fri, 3 Feb 2017 17:40:54 +0000 (19:40 +0200)]
lib-storage: Fix autoexpunge locking to actually work correctly.
It wasn't actually skipping the autoexpunging if the lock already existed.
It autoexpunged anyway.
Aki Tuomi [Fri, 3 Feb 2017 12:22:02 +0000 (14:22 +0200)]
fts: Use mailbox_list_created hook
Otherwise the deinit hook might get lost and fts would not be deinitialized.
Reverts
11f12ca1c97583b551a4286fa6cd1ab33aa67680 which seems to have been unnecessary
Fixes indexer-worker signal 11 crash
Timo Sirainen [Fri, 3 Feb 2017 14:16:26 +0000 (16:16 +0200)]
lib-storage: Once hooks have run, set vlast to NULL to make sure it's not used
The functions can't be correctly overridden outside their own specific
hooks. It would work only if hook_build_update() is called afterwards and
currently there's no public API for that.
Aki Tuomi [Sat, 4 Feb 2017 08:42:21 +0000 (10:42 +0200)]
lib-storage: Put vsize in index only if it's not there
Timo Sirainen [Mon, 30 Jan 2017 19:28:20 +0000 (21:28 +0200)]
lib-storage: Add assert to make sure header parsing isn't recursed
Stephan Bosch [Thu, 2 Feb 2017 00:36:50 +0000 (01:36 +0100)]
lib-http: client: Fixed peer reconnection failure handling.
The addressed problem occurs in a very specific situation in which the original successful connection is dropped, yet a new connection fails.
It manifests as an assertion failure or panic:
Panic: file ioloop-epoll.c: line 189 (io_loop_handler_run_internal): assertion failed: (msecs >= 0)
Panic: BUG: No IOs or timeouts set. Not waiting for infinity.
The timing is very critical. However, this doesn't mean that the occurrence of this problem is very unlikely; it can happen frequently under high load.
Stephan Bosch [Thu, 2 Feb 2017 00:34:35 +0000 (01:34 +0100)]
lib-http: client: Respect the connection idle timeout, even when all queues have unlinked from a peer.
Otherwise, the DNS TTL timeout dictates the connection idle timeout in some situations.
Timo Sirainen [Thu, 2 Feb 2017 09:47:24 +0000 (11:47 +0200)]
dict: Fix error logging if TIMESTAMP parameters are wrong.
Timo Sirainen [Thu, 2 Feb 2017 09:32:50 +0000 (11:32 +0200)]
dict-sql: Add missing USING TIMESTAMP for DELETE queries
Timo Sirainen [Tue, 31 Jan 2017 19:03:29 +0000 (21:03 +0200)]
imap: Fix panic on FETCH X-MAILBOX in virtual mailbox when mail is expunged
Stephan Bosch [Tue, 31 Jan 2017 12:41:48 +0000 (13:41 +0100)]
lib-http: server: Fix premature connection destroy in http_server_connection_output().
Added a reference to the connection object while it is sending the remainder of a response's payload.
This is necessary, since http_server_response_send_more() can destroy the connection, for example when the request has a "Connection: close" header.
This will only occur for responses with a very large payload, because otherwise the payload is fully sent in in the initial pass.
Timo Sirainen [Mon, 9 Jan 2017 21:13:03 +0000 (23:13 +0200)]
lib-storage: When logging corrupted mail size, disable logging Message-ID for now
This was causing crashes in some situations. It was originally added to
figure out if there were problems with dovecot.index.cache containing
data for wrong messages. This was never found to happen, although now
thinking about it, the problem may have been
741287129c22cadc14c05584704685b31169dbce . So perhaps this code could be
removed permanently as well.
6b44fc75c0039d1006ce4d543544552449b8e229 also attempted to fix this, but it
wasn't enough. There was still some code path that lead to recursive header
parsing.
Timo Sirainen [Mon, 30 Jan 2017 13:12:04 +0000 (15:12 +0200)]
lib-storage: Set vsize extension when copying mails.
Timo Sirainen [Mon, 30 Jan 2017 13:11:45 +0000 (15:11 +0200)]
lib-storage: Add index_mail_get_vsize_extension()
Timo Sirainen [Mon, 30 Jan 2017 13:06:46 +0000 (15:06 +0200)]
lib-storage: Move index_mail.vsize_ext_id to mailbox.mail_vsize_ext_id
It's mailbox-specific, so it doesn't have to be looked up every time.
Also this is needed for the following fix.
Timo Sirainen [Wed, 14 Dec 2016 16:13:25 +0000 (18:13 +0200)]
imapc: Allow using LAYOUT=none without crashing.
Timo Sirainen [Sat, 28 Jan 2017 22:24:33 +0000 (00:24 +0200)]
imap: Don't unregister internal commands at deinit.
This allows plugins to unregister commands without errors being logged.
Timo Sirainen [Thu, 26 Jan 2017 20:42:09 +0000 (22:42 +0200)]
lib-storage: Lock autoexpunging so only a single process does it.
This hopefully helps to avoid duplicates with lazy_expunge plugin.
Timo Sirainen [Sat, 28 Jan 2017 23:08:23 +0000 (01:08 +0200)]
imap: Use struct mailbox_status.flags for FLAGS reply
Timo Sirainen [Sat, 28 Jan 2017 23:06:55 +0000 (01:06 +0200)]
lib-storage: Add struct mailbox_status.flags
This is similar to permanent_flags, except it tells which flags can be
changed at all in the session. Mainly it allows plugins to make changes to
IMAP's untagged FLAGS reply.
Timo Sirainen [Fri, 27 Jan 2017 19:36:14 +0000 (21:36 +0200)]
lib: io_loop_set_current() - do nothing if ioloop doesn't change
There's no need to call the switch callbacks if the ioloop doesn't change.
Martti Rannanjärvi [Fri, 27 Jan 2017 11:56:30 +0000 (13:56 +0200)]
doveadm: add doveadm_http_rawlog_dir setting
Timo Sirainen [Tue, 24 Jan 2017 15:18:07 +0000 (17:18 +0200)]
lib-fts: Fix assert-crash in fts_icu_lcase()
Fixes:
Panic: file fts-icu.c: line 152 (fts_icu_lcase): assertion failed: (err != U_BUFFER_OVERFLOW_ERROR)
Aki Tuomi [Fri, 27 Jan 2017 07:41:36 +0000 (09:41 +0200)]
lib-storage: Fix comparison to use virtual size instead of body virtual size
Was forgotten on
7f1ecb14
Timo Sirainen [Thu, 26 Jan 2017 07:55:22 +0000 (09:55 +0200)]
lib-index: Don't log error on dovecot.index.cache delete if it doesn't exist
For example if a cache is marked as corrupted and there is no cache, it's
not really an error that it doesn't exist.
Fixes:
Error: unlink(.../dovecot.index.cache) failed: No such file or directory (in mail-cache.c:29)
Timo Sirainen [Thu, 26 Jan 2017 17:51:34 +0000 (19:51 +0200)]
lib-storage: Filling vsize to index on read used wrong size
Aki Tuomi [Thu, 26 Jan 2017 07:42:26 +0000 (09:42 +0200)]
lib-storage: Clear virtual size from index if size is corrupted
Timo Sirainen [Sat, 14 Jan 2017 16:34:11 +0000 (18:34 +0200)]
fts: Fix search query generation when tokens are filtered out.
For example with English stopwords when searching "foo and bar" it should
be equilevant to "foo bar", since "and" is filtered out.
Timo Sirainen [Mon, 23 Jan 2017 16:02:05 +0000 (18:02 +0200)]
director: "doveadm director move" to same host now refreshes user's timeout
This allows keeping user constantly in the same backend by just periodically
moving the user there.
Aki Tuomi [Mon, 16 Jan 2017 12:01:57 +0000 (14:01 +0200)]
dict-sql: Do not increment on set
When merging sets do not use increment mode in builder.
Aki Tuomi [Tue, 17 Jan 2017 07:59:54 +0000 (09:59 +0200)]
dict-sql: Fix iterator to not fail
When iterating a prefix without exact key flag,
do not fail when no more maps are matched if at least
one map has already matched.
Fixes
Error: dict_iterate_deinit failed: sql dict iterate failed for ...: Invalid/unmapped path
Timo Sirainen [Sun, 16 Oct 2016 19:55:26 +0000 (22:55 +0300)]
dict-sql: Error handling fix & code cleanup
Only the first sql_dict_iterate_next_query() error was handled correctly.
Aki Tuomi [Tue, 24 Jan 2017 10:42:25 +0000 (12:42 +0200)]
lib-sasl: Fix oauthbearer compatibility with 2.2