]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Thu, 15 Feb 2018 16:13:20 +0000 (18:13 +0200)]
imap: When running standalone, delay initializing namespaces until PREAUTH is sent
Most importantly this makes the code paths similar for standalone and
non-standalone clients, which is needed by the following commits.
Timo Sirainen [Mon, 19 Feb 2018 12:44:04 +0000 (14:44 +0200)]
lib-storage: Unless LAYOUT=index, don't rebuild list index on missing INBOX
Timo Sirainen [Mon, 19 Feb 2018 10:54:53 +0000 (12:54 +0200)]
lib-storage: mailbox_list_index_handle_corruption() - Lock mailbox list while rebuilding
This guards against simultaneous mailbox create/delete/rename.
Timo Sirainen [Mon, 19 Feb 2018 10:53:46 +0000 (12:53 +0200)]
lib-storage: mailbox_list_index_handle_corruption() - Move actual handling to its own function
Martti Rannanjärvi [Thu, 30 Nov 2017 10:03:36 +0000 (12:03 +0200)]
lib-ssl-iostream,login-common: Use SSL_CTX_set_min_proto_version
Use SSL_CTX_set_min_proto_version to set the minimum ssl protocol
version where available.
Martti Rannanjärvi [Sat, 11 Nov 2017 02:28:57 +0000 (04:28 +0200)]
lib-ssl-iostream: Add ssl_protocols_to_min_protocol()
This detects minimum SSL protocol version from the ssl_protocols
setting.
Martti Rannanjärvi [Thu, 30 Nov 2017 09:15:50 +0000 (11:15 +0200)]
configure.ac: Add SSL_CTX_set_min_proto_version detection
Martti Rannanjärvi [Mon, 19 Feb 2018 12:51:41 +0000 (14:51 +0200)]
login-common: Explicitly ignore SSL_CTX_set_ecdh_auto() return value
This is to fix a compiler warning.
Aki Tuomi [Mon, 19 Feb 2018 07:54:09 +0000 (09:54 +0200)]
login-common,lib-ssl-iostream: Use SSL_CTX_set_ecdh_auto
This macro is same for 1.0.2 and 1.1.0 and libressl.
Aki Tuomi [Sun, 18 Feb 2018 16:11:18 +0000 (18:11 +0200)]
imap: If snippet is not available return NIL
Timo Sirainen [Sat, 17 Feb 2018 22:53:12 +0000 (00:53 +0200)]
imap: Fix FETCH SNIPPET
1) _BUFFERED flag wasn't set, which caused a missing space before the "SNIPPET".
2) It caused \Seen flag to be added to the mail
Timo Sirainen [Fri, 16 Feb 2018 12:49:59 +0000 (14:49 +0200)]
imap: Don't enforce sending SNIPPET reply as literal
Also change it to use "cur_str" since the reply is never very long.
Timo Sirainen [Fri, 16 Feb 2018 12:46:36 +0000 (14:46 +0200)]
imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response
Otherwise it violates the RFC 3501 text about FETCH responses.
Martti Rannanjärvi [Fri, 16 Feb 2018 14:59:35 +0000 (16:59 +0200)]
charset-alias: Fix keyvalues iteration
charset-alias-plugin.c:113:27: error: comparison between pointer and zero
character constant [-Werror=pointer-compare]
for (i = 0; keyvalues[i] != '\0'; i++) {
^~
charset-alias-plugin.c:113:14: note: did you mean to dereference the pointer?
for (i = 0; keyvalues[i] != '\0'; i++) {
Martti Rannanjärvi [Fri, 16 Feb 2018 14:53:04 +0000 (16:53 +0200)]
charset-alias: Cleanup whitespace
Remove \r from end of lines and remove trailing whitespace.
Hideo Yoshizane [Thu, 25 Jan 2018 00:36:22 +0000 (19:36 -0500)]
charset-alias-plugin
Timo Sirainen [Thu, 9 Nov 2017 13:18:29 +0000 (15:18 +0200)]
lib-charset: Allow plugins to replace charset_* functions
They just need to point charset_utf8_vfuncs to their own implementation.
Timo Sirainen [Thu, 9 Nov 2017 13:12:05 +0000 (15:12 +0200)]
lib-charset: Move non-iconv UTF-8 only translation code to its own file
Stephan Bosch [Fri, 9 Feb 2018 22:57:29 +0000 (23:57 +0100)]
lib-http: server: Recreate connection IO after streams change.
Stephan Bosch [Fri, 9 Feb 2018 22:56:55 +0000 (23:56 +0100)]
lib-http: client: Recreate connection IO after streams change.
Stephan Bosch [Sat, 10 Feb 2018 09:29:44 +0000 (10:29 +0100)]
lib-http: server: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:27:19 +0000 (10:27 +0100)]
lib-http: client: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Fri, 9 Feb 2018 16:24:28 +0000 (17:24 +0100)]
lib-ssl-iostream: ostream-openssl: Fix behavior of o_stream_flush() so that 1 is only returned when buffer is empty.
Stephan Bosch [Thu, 15 Feb 2018 14:47:48 +0000 (15:47 +0100)]
lib-ssl-iostream: ostream-openssl: Create local variable for sstream->ssl_io->plain_output in o_stream_ssl_flush().
Stephan Bosch [Sat, 10 Feb 2018 08:55:43 +0000 (09:55 +0100)]
lib: connection: Add connection_input_halt() and connection_input_resume().
These are convenience functions that remove and add conn->io respectively.
Aki Tuomi [Mon, 12 Feb 2018 10:28:37 +0000 (12:28 +0200)]
auth: Set correct context type when bypassing reporting in auth_success
Broken in
41ff6e6a4a085786d4c15a58c7c50a28e2110c3f
Timo Sirainen [Thu, 8 Feb 2018 00:22:18 +0000 (02:22 +0200)]
lib: Add i_stream_get_root_io() and use it to deduplicate code
Timo Sirainen [Thu, 8 Feb 2018 08:52:57 +0000 (10:52 +0200)]
lib: Add connection_streams_changed()
Originally by Stephan Bosch
Timo Sirainen [Thu, 8 Feb 2018 00:38:23 +0000 (02:38 +0200)]
doveadm: client: Set IO only after enabling SSL
io_add_istream() needs to be used with the SSL istream, otherwise it can
cause hangs.
Timo Sirainen [Thu, 8 Feb 2018 00:28:54 +0000 (02:28 +0200)]
lib-imap-client: Fix IO after enabling SSL
io_add_istream() needs to be used with the SSL istream, otherwise it can
cause hangs.
Timo Sirainen [Fri, 22 Dec 2017 09:25:06 +0000 (11:25 +0200)]
doveadm-server: Fix potential hangs with SSL connections
Aki Tuomi [Tue, 6 Feb 2018 07:48:11 +0000 (09:48 +0200)]
auth: Add policy check configuration options
Allows disabling before/after auth checks, or reporting.
Aki Tuomi [Mon, 5 Feb 2018 12:26:15 +0000 (14:26 +0200)]
auth: Use correct username is auth policy requests
When doing master authentication as first, use
the username of the user, not master user, for policy lookup.
Aki Tuomi [Fri, 1 Dec 2017 11:49:31 +0000 (13:49 +0200)]
auth: Use rip instead of real_rip in policy server attributes
real_rip contains proxy IP, not client IP
Timo Sirainen [Tue, 6 Feb 2018 13:12:26 +0000 (15:12 +0200)]
replication: Don't send notification for changes done by dsync transactions
Timo Sirainen [Tue, 6 Feb 2018 13:10:48 +0000 (15:10 +0200)]
lib-storage: Set mailbox_transaction_context.flags earlier
Set it in index_transaction_init() so plugins' transaction_begin() methods
see it after calling super.transaction_begin().
Stephan Bosch [Tue, 17 Oct 2017 01:19:19 +0000 (03:19 +0200)]
doveadm-server: http: Fixed lingering connections after the request is sent.
Turns out conn->http_client is already NULL while doveadm_http_server_connection_destroy() is called.
This is because http_server_connection_unref() sets it to NULL;
Fixed by removing useless HTTP connection reference.
Stephan Bosch [Sun, 18 Jun 2017 17:55:23 +0000 (19:55 +0200)]
doveadm-server: http: Fixed crash occurring when disconnecting a client at server deinit.
Aki Tuomi [Thu, 8 Feb 2018 11:04:48 +0000 (13:04 +0200)]
old-stats: Set process dumpable during stats gathering
/proc/self/io is not accessible otherwise
Aki Tuomi [Thu, 8 Feb 2018 11:03:37 +0000 (13:03 +0200)]
lib: Add restrict_access_get/set_dumpable
Aki Tuomi [Thu, 8 Feb 2018 11:01:50 +0000 (13:01 +0200)]
lib: Clarify restrict_access_allow_coredumps
Timo Sirainen [Wed, 7 Feb 2018 14:17:13 +0000 (16:17 +0200)]
lib-index: Fix assert-crash with lock_method=dotlock
The dotlock wasn't deleted in all code paths. Fix this by simplifying
the unlocking to be done the same way with and without dotlock.
Fixes:
Panic: file mail-cache.c: line 624 (mail_cache_lock_file): assertion failed: (cache->dotlock == NULL)
Timo Sirainen [Tue, 9 Jan 2018 20:37:25 +0000 (15:37 -0500)]
lib-storage: Lock mailbox_list for mailbox create/delete/rename
This is only required for mailbox creation to fix a race condition with
LAYOUT=index: If INBOX doesn't exist it will rescan the mailboxes to
find out if there are any missing ones. If INBOX creation isn't locked,
it's possible that the first process hasn't finished creating INBOX
before the second process find it and attempts to open it.
The delete and rename locking are probably useful to guard against race
conditions when clients intentionally issues create/delete/rename commands
concurrently.
Timo Sirainen [Tue, 9 Jan 2018 20:36:58 +0000 (15:36 -0500)]
lib-storage: Add mailbox_list_[un]lock()
Timo Sirainen [Tue, 9 Jan 2018 20:35:13 +0000 (15:35 -0500)]
lib-storage: mailbox_delete() - Fix cleanup in error handling
If removing index deletion mark failed, box->deleting wasn't set to FALSE
and the mailbox was left opened.
Timo Sirainen [Tue, 9 Jan 2018 20:33:26 +0000 (15:33 -0500)]
lib-storage: mailbox_rename() - Use source storage for errors
It was documented to use source storage for errors, but some of the errors
were set to destination storage.
Timo Sirainen [Tue, 6 Feb 2018 16:01:04 +0000 (18:01 +0200)]
lib-storage: mail_storage_lock_create() - add support for dotlocks
Timo Sirainen [Tue, 6 Feb 2018 15:49:15 +0000 (17:49 +0200)]
lib-storage: Change mail_user_lock_file_create() to use mail_storage_lock_create()
Timo Sirainen [Tue, 6 Feb 2018 15:47:37 +0000 (17:47 +0200)]
lib-storage: Add mail_storage_lock_create()
This is split off of mailbox_lock_file_create().
Timo Sirainen [Tue, 6 Feb 2018 15:35:18 +0000 (17:35 +0200)]
lib: Add file_lock_from_dotlock()
The dotlock creation requires various settings, so the file-lock.h API can't
easily be used to create it. But once created, it's simpler to keep all lock
types in the same struct file_lock, which can be unlocked/freed once
finished.
Timo Sirainen [Wed, 13 Dec 2017 13:48:17 +0000 (15:48 +0200)]
LAYOUT=index: Fix crash in doveadm force-resync if storage doesn't implement list_index_corrupted()
Broken by recent changes.
Timo Sirainen [Tue, 12 Dec 2017 16:10:40 +0000 (18:10 +0200)]
LAYOUT=index: Fix updating STATUS changes in mailbox list index
Mailbox list index backend code was overriding sync_init and sync_deinit
methods, which STATUS handling had already already overridden. They both
used the same super struct, so STATUS's sync_* were never called.
Timo Sirainen [Tue, 6 Feb 2018 10:37:34 +0000 (12:37 +0200)]
fs-posix: Fix iterating directories when readdir() returns DT_UNKNOWN
Files were iterated correctly, but directories weren't. This mainly broke
directory iteration with NFS when nordirplus mount option was used.
Timo Sirainen [Mon, 5 Feb 2018 20:21:13 +0000 (22:21 +0200)]
fts: Don't reindex FTS mails if .cache file is deleted
This means that if fts is enabled, "doveadm index" no longer adds mails
to dovecot.index.cache if it's deleted. However, it was rarely used for
that purpose. More likely due to a corrupted cache file all the mails were
unnecessarily being opened and reindexed.
Timo Sirainen [Wed, 7 Feb 2018 13:28:45 +0000 (15:28 +0200)]
cassandra: Make sure timestamp is always logged (if set) with debug_queries=y
It wasn't logged in some code paths.
Timo Sirainen [Wed, 7 Feb 2018 13:27:07 +0000 (15:27 +0200)]
cassandra: Fix setting timestamp for transaction queries with v3 protocol
It was working for prepared statements, but not for non-prepared statements.
Stephan Bosch [Mon, 29 Jan 2018 18:10:38 +0000 (19:10 +0100)]
doveadm: dsync: Switch ioloop for input/output streams while making TCP connection.
This task is performed in a sub-ioloop, and when returning from that ioloop, the
output stream would sometimes still have an object on the sub-ioloop that was
just destroyed.
Stephan Bosch [Mon, 29 Jan 2018 17:28:25 +0000 (18:28 +0100)]
lib-ssl-iostream: openssl: Make verbose logging robust against i_debug() writing to stream itself.
In dsync, i_debug() is overridden to write to the SSL stream itself through a
multiplexed data stream. So, during the i_debug() call all kinds of things can
happen to the persisted error string in the stream, which caused problems.
Timo Sirainen [Mon, 5 Feb 2018 21:54:33 +0000 (23:54 +0200)]
fts: Fix searching headers with TEXT/BODY
TEXT is searching headers and BODY is searching MIME headers. Those headers
were indexed with data language, so search must also include data language
when looking up words. We'll just include the data language for all
searches now, so it should always work correctly.
Timo Sirainen [Mon, 5 Feb 2018 21:51:51 +0000 (23:51 +0200)]
fts: Fix searching SEARCH_HEADER_ADDRESS/COMPRESS_LWSP
These are "non-language" headers that are being searched, so they need to be
searched using data language.
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.
Stephan Bosch [Tue, 6 Feb 2018 14:50:19 +0000 (15:50 +0100)]
lib: time-util: Fix timeval_cmp_margin() to correctly handle a margin crossing the second boundary.
The timeval_cmp_margin() function incorrectly assumed that the margin is
irrelevent when the tv_sec values are different.
Stephan Bosch [Tue, 6 Feb 2018 15:51:23 +0000 (16:51 +0100)]
lib: test-time-util: Put all test data for timeval_cmp() test in a single struct array.
Sergey Kitov [Mon, 5 Feb 2018 11:38:16 +0000 (13:38 +0200)]
lib-imap-client: continue imapc operation on parsing errors.
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 14:55:51 +0000 (09:55 -0500)]
imap: Iterate over ns settings when deciding to add SPECIAL-USE capability
To determine whether we should add the SPECIAL-USE capability to the
OK response to LOGIN, we have to iterate over namespace and mailbox
*settings* since the namespaces haven't been set up yet.
Aki Tuomi [Tue, 5 Dec 2017 15:05:27 +0000 (17:05 +0200)]
lib: test-var-expand - Ensure var_get_key_range_full handles nested ifs correctly
Aki Tuomi [Fri, 1 Dec 2017 17:46:58 +0000 (19:46 +0200)]
lib: var-expand - handle \{ and \} correctly
Do not treat these as embedded braces
Aki Tuomi [Fri, 1 Dec 2017 12:53:46 +0000 (14:53 +0200)]
lib: Support nested keys in var_get_key_range_full
Fixes problems with %{if...}
failed: if: requires four or five parameters, got 1
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.
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
Timo Sirainen [Thu, 25 Jan 2018 10:35:35 +0000 (12:35 +0200)]
lib-index: Update comments for mail_cache_decision_*()
Aki Tuomi [Sun, 4 Feb 2018 11:40:12 +0000 (13:40 +0200)]
imap,pop3: Properly terminate logout tab.
Fixes Fatal: master: service(imap): child killed with signal 11
Broken in
e0a42caee5a04d29cfa95ae7719aeaa708001255 and
1ecc087ee90439787de7df9b9a60e0d35b5dda07
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 [Mon, 4 Dec 2017 09:01:31 +0000 (11:01 +0200)]
pop3: Include mail user variables in logout format
Aki Tuomi [Mon, 4 Dec 2017 09:01:05 +0000 (11:01 +0200)]
imap: Include mail user variables in logout format
Aki Tuomi [Tue, 5 Dec 2017 21:49:27 +0000 (23:49 +0200)]
lib: var-expand - Add table size and merge utility functions
Stephan Bosch [Sat, 20 Jan 2018 20:32:07 +0000 (21:32 +0100)]
lib-program-client: local: Add test for big data I/O.
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.
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.
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 [Mon, 22 Jan 2018 11:33:29 +0000 (13:33 +0200)]
Timo Sirainen [Mon, 6 Nov 2017 23:33:57 +0000 (01:33 +0200)]
log: Fix log reopening on SIGUSR1
Aki Tuomi [Fri, 26 Jan 2018 08:55:54 +0000 (10:55 +0200)]
lib-auth: Remove request after abort
Otherwise the request will still stay in hash table
and get dereferenced when all requests are aborted
causing an attempt to access free'd memory.
Found by Apollon Oikonomopoulos <apoikos@debian.org>
Broken in
1a29ed2f96da1be22fa5a4d96c7583aa81b8b060
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
Aki Tuomi [Thu, 16 Nov 2017 11:27:23 +0000 (13:27 +0200)]
mail-crypt: Do not free global keys if no error has occured
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.
Timo Sirainen [Wed, 24 Jan 2018 16:01:23 +0000 (18:01 +0200)]
lib-index: Code cleanup for reading caching decisions
No functional changes.
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.
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.
Timo Sirainen [Mon, 20 Nov 2017 15:03:47 +0000 (17:03 +0200)]
mdbox: Fix rebuilding when dovecot.map.index is missing map/ref extension
The rebuild kept just repeatedly failing with:
Error: mdbox map .../dovecot.map.index corrupted: missing map extension
Josef 'Jeff' Sipek [Thu, 4 Jan 2018 17:44:16 +0000 (12:44 -0500)]
imap: support for FETCH SNIPPET
Sergey Kitov [Tue, 21 Nov 2017 11:27:18 +0000 (13:27 +0200)]
lib: Call prctl(PR_SET_DUMPABLE) only when PR_SET_DUMPABLE env variable is set
Sergey Kitov [Wed, 22 Nov 2017 09:34:47 +0000 (11:34 +0200)]
lib: Add logging of prctl(PR_SET_DUMPABLE) failure.