]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Mon, 29 May 2017 10:52:42 +0000 (13:52 +0300)]
lib-storage: Add mailbox-list-iter-private.h with autocreate context structs
Needed for the following ACL change.
Timo Sirainen [Sat, 20 May 2017 15:13:45 +0000 (18:13 +0300)]
config: When showing an "Unknown setting" error, show the full section path
For example with:
service foo {
inet_listener bar {
key = value
}
}
Instead of showing just:
Unknown setting: key
Show the entire path:
Unknown setting: service { inet_listener { key
Any filters won't be shown, because they don't affect the result.
Aki Tuomi [Wed, 17 May 2017 12:20:35 +0000 (15:20 +0300)]
lib-storage: Apply mailbox_list_iter_autocreate_filter on mailbox_list_index_iter_next
It skips mailbox_list_iter_next, so it needs to be applied here as well.
Aki Tuomi [Wed, 17 May 2017 12:19:44 +0000 (15:19 +0300)]
lib-storage: Rename autocreate_iter_existing to mailbox_list_iter_autocreate_filter
It makes next commit possible
Aki Tuomi [Wed, 17 May 2017 09:16:31 +0000 (12:16 +0300)]
lib-storage: Do not drop autocreate boxes when listing them
Otherwise we skip folders, because array_delete() is removing boxes while they're being iterated.
Aki Tuomi [Thu, 6 Apr 2017 13:09:00 +0000 (16:09 +0300)]
lib-master,login-common: Add dual cert support
Adds new settings ssl_alt_cert and ssl_alt_key
Aki Tuomi [Fri, 2 Jun 2017 18:11:19 +0000 (21:11 +0300)]
lib-dict: Update cdb_dict_init to match with new API
Stephan Bosch [Sat, 30 Apr 2016 10:50:53 +0000 (12:50 +0200)]
lib: Added ostream-unix for writing fd sockets via ostream.
Timo Sirainen [Mon, 5 Jun 2017 16:05:58 +0000 (19:05 +0300)]
push-notification: Fix crash in OX driver's deinit
The http_client doesn't always exist.
Aki Tuomi [Mon, 5 Jun 2017 09:14:57 +0000 (12:14 +0300)]
auth: Access always first entry when flushing failures
The code is deleting the first item after accessing
it, and then moving forward. It will eventually go
beyond the array and get NULL ptr and fail.
Instead we need to always get the first item,
since the array deletion is moving the queued items
forward.
Broken by
e18b4e41
Aki Tuomi [Wed, 31 May 2017 07:09:41 +0000 (10:09 +0300)]
auth: Fix vpopmail for 2.2
Aki Tuomi [Wed, 31 May 2017 10:03:47 +0000 (13:03 +0300)]
quota: Update version number for script client
Aki Tuomi [Tue, 30 May 2017 11:03:23 +0000 (14:03 +0300)]
mail-filter: tabescape args, this is required by script client 4
Aki Tuomi [Tue, 30 May 2017 11:01:39 +0000 (14:01 +0300)]
welcome: tabescape args, this is required by script client 4
Aki Tuomi [Tue, 30 May 2017 11:01:17 +0000 (14:01 +0300)]
global: Update script client version number
Broken by
b383ed51d75bce0f69f126bc4ff7192985ca30f2
Timo Sirainen [Tue, 30 May 2017 13:24:52 +0000 (16:24 +0300)]
auth: Fix unescaping tabs in auth client input.
This mainly broke forward_fields when there was more than one of them.
Timo Sirainen [Tue, 30 May 2017 08:30:10 +0000 (11:30 +0300)]
auth: Fix crash on passdb lookup when all passdbs were skipped
Finishes the fix in
614f5b6febaf3c825f9200ab3b62d9d047197b0e
Fixes:
auth: Panic: file auth-request.c: line 2493 (get_log_prefix): assertion failed: (auth_request->mech != NULL)
Timo Sirainen [Tue, 30 May 2017 07:01:20 +0000 (10:01 +0300)]
lib-storage: Fix compiler warning in test-mail-storage
Timo Sirainen [Wed, 24 May 2017 20:49:43 +0000 (23:49 +0300)]
lib-storage: Fix crash in test-mail-storage
Aki Tuomi [Mon, 15 May 2017 12:35:37 +0000 (15:35 +0300)]
mail-crypt-plugin: Set copy-hook only if save_version > 0
Otherwise we might use it in read-only mode, too.
Aki Tuomi [Thu, 4 May 2017 06:14:17 +0000 (09:14 +0300)]
mail-crypt: Re-encrypt mails when copying/moving
Otherwise the mail cannot be opened after moving
Timo Sirainen [Wed, 24 May 2017 19:31:59 +0000 (22:31 +0300)]
lib-storage: Fix memory leak in test-mail-storage
Timo Sirainen [Wed, 24 May 2017 18:56:03 +0000 (21:56 +0300)]
lib-storage: Add unit test for set/get/push/pop storage error operations
Timo Sirainen [Wed, 24 May 2017 18:29:49 +0000 (21:29 +0300)]
lib-storage: Fix mail_storage_set_critical() when input parameter is an old internal error
This could have caused garbage in the error string.
Timo Sirainen [Wed, 24 May 2017 16:16:03 +0000 (19:16 +0300)]
lib-storage: Fix mail_storage_last_error_push/pop() to work with internal errors
Timo Sirainen [Mon, 22 May 2017 14:56:15 +0000 (17:56 +0300)]
imap: Fix unhibernation after earlier change
Timo Sirainen [Wed, 17 May 2017 16:02:06 +0000 (19:02 +0300)]
imap NOTIFY: Flush any pending notifications on NOOP
This is mainly to allow testing NOTIFY easily with imaptest scripts.
This is cheap anyway, because mailbox_list_notify_flush() doesn't do any
syscalls when there's no work.
Timo Sirainen [Wed, 17 May 2017 16:01:57 +0000 (19:01 +0300)]
lib-storage: Implement mailbox_list_notify_flush()
This flushes any pending notifications. For now it only checks if there's
a pending notification waiting for a timeout. It could also stat() the
files to make sure, but that's probably unnecessary.
Timo Sirainen [Wed, 17 May 2017 15:13:09 +0000 (18:13 +0300)]
lib-storage: Explicitly name function pointers in mailbox lists
This allows adding more fields to struct mailbox_list_vfuncs without
compiler warnings.
Timo Sirainen [Wed, 17 May 2017 14:49:25 +0000 (17:49 +0300)]
lib-storage: Always update highestmodseq in mailbox list index
This is required for mailbox-list-notify API to work correctly. For
example IMAP NOTIFY session with CONDSTORE enabled could be listening for
FlagChanges, but another session without CONDSTORE enabled could be updating
flags in a mailbox that has never been opened with CONDSTORE enabled.
NOTIFY wouldn't see this change, unless it was always written to
dovecot.list.index.
Timo Sirainen [Wed, 17 May 2017 14:14:05 +0000 (17:14 +0300)]
lib-storage: Fix mailbox list index notifications when modseqs aren't enabled.
No notifications were sent if highest_modseqs weren't updated in mailbox
list index.
Josef 'Jeff' Sipek [Wed, 17 May 2017 08:40:53 +0000 (11:40 +0300)]
imap: login reply should be sent sooner
Stephan Bosch [Mon, 3 Apr 2017 22:32:07 +0000 (00:32 +0200)]
lib-http: client: Fixed race condition between DNS refresh lookup and a soft connection timeout.
The refreshing DNS lookup cleared all the IPs, but the soft connection timeout (and maybe other code) still relied on them.
Adding tests everywhere for host->ips_count == 0 is annoying, so I changed the DNS lookup code such that the stale IPs remain present while the DNS lookup is being performed.
The pending lookup prevents new connections through http_client_host_refresh(), so this will not create potentially useless connections.
Timo Sirainen [Wed, 24 May 2017 14:19:36 +0000 (17:19 +0300)]
lib-master: Replace listeners with /dev/null in SIGQUIT instead of closing
This should be somewhat safer.
Timo Sirainen [Mon, 22 May 2017 07:13:21 +0000 (10:13 +0300)]
lib-index: Fix crash in mail_transaction_log_view_set_all() error handling
Timo Sirainen [Mon, 22 May 2017 07:11:30 +0000 (10:11 +0300)]
lib-index: Fix start_offset > sync_offset error handling for in-memory indexes
Timo Sirainen [Fri, 19 May 2017 07:45:09 +0000 (10:45 +0300)]
auth: Fix linking duplicate .a libraries to unit test
Stephan Bosch [Mon, 8 May 2017 10:49:39 +0000 (12:49 +0200)]
util: script: Increased the major protocol version due to earlier changes.
Stephan Bosch [Tue, 9 May 2017 11:33:23 +0000 (13:33 +0200)]
util: script: Amended protocol with the ability to convey a set of environment variables that are passed to the script.
The acceptable environment variables are selected using the -e parameter; others are ignored silently.
Stephan Bosch [Mon, 8 May 2017 10:48:08 +0000 (12:48 +0200)]
util: script: Amended the protocol to pass arguments escaped to prevent problems with newlines.
Newlines are used as argument delimiters in the protocol, which will cause problems.
Stephan Bosch [Tue, 9 May 2017 11:43:39 +0000 (13:43 +0200)]
lib-program-client: local: Fixed use of unterminated string array of environment variables in exec_child().
Stephan Bosch [Tue, 9 May 2017 12:22:06 +0000 (14:22 +0200)]
lib-program-client: Made the test suite ignore the protocol version.
Stephan Bosch [Thu, 20 Oct 2016 13:41:54 +0000 (15:41 +0200)]
lib-program-client: Gave variables pointing to a program-client more logical names.
Was still based on when it was called the script-client.
Timo Sirainen [Fri, 19 May 2017 14:44:30 +0000 (17:44 +0300)]
imap: Move struct client_sync_context to imap-sync-private.h and add imap_ prefix
Timo Sirainen [Fri, 19 May 2017 13:34:29 +0000 (16:34 +0300)]
imap: Allow plugins to replace existing FETCH handlers
They can use imap_fetch_handler_lookup() to get the old init() function.
Then they can imap_fetch_handler_unregister() the existing handler and
register a new handler, which can do its own work and call the old init()
if needed.
Timo Sirainen [Wed, 17 May 2017 13:47:43 +0000 (16:47 +0300)]
lib-index: Improve "start_offset > current sync_offset" error message.
Try to make it clear what is the root cause of it.
Timo Sirainen [Wed, 17 May 2017 13:28:58 +0000 (16:28 +0300)]
lib-index: mail_transaction_log_file_get_highest_modseq_at() - return error string
This can help figuring out why some error happened when more context is
provided in the caller's error messages.
Timo Sirainen [Wed, 17 May 2017 13:21:54 +0000 (16:21 +0300)]
lib-index: Add missing error logging for mail_index_view_sync_begin()
Timo Sirainen [Wed, 17 May 2017 10:33:44 +0000 (13:33 +0300)]
lib-index: mail_transaction_log_file_map() - return reason/error string
This can help figuring out why some error happened when more context is
provided in the caller's error messages.
Timo Sirainen [Wed, 17 May 2017 10:31:09 +0000 (13:31 +0300)]
lib-index: mail_transaction_log_view_set_all() - don't entirely ignore corrupted logs
Ignore them only if it's followed by an index reset.
Timo Sirainen [Thu, 18 May 2017 20:13:38 +0000 (23:13 +0300)]
lib-storage: Fix mailbox list index records without guid having invalid flags
With LAYOUT=index the mailbox is found with its GUID. If it doesn't exist,
the mailbox has to be either \NonExistent or \NoSelect. It probably doesn't
make much difference which one, so we'll fix them by adding \NoSelect.
With other layouts the GUID is allowed to be empty, because it can be looked
up from the actual mailbox.
Timo Sirainen [Thu, 18 May 2017 20:06:20 +0000 (23:06 +0300)]
lib-storage: Fix mailbox list index records with name_id=0
name_id=0 isn't valid, so it needs to be changed and writen to the disk.
The write-to-disk part wasn't working.
Timo Sirainen [Fri, 19 May 2017 06:45:28 +0000 (09:45 +0300)]
lib: Fix memory leak in test-istream-concat
Timo Sirainen [Thu, 18 May 2017 19:18:15 +0000 (22:18 +0300)]
lib: Fix crash when seeking istream-concat to EOF and trying to read it
Timo Sirainen [Thu, 18 May 2017 18:10:33 +0000 (21:10 +0300)]
imapc: Make sure a valid UIDVALIDITY is returned by SELECT
Fixes errors such as:
Error: Synchronization corrupted index header (in-memory index): uidvalidity=0, but next_uid=9
Timo Sirainen [Thu, 18 May 2017 18:08:23 +0000 (21:08 +0300)]
imapc: Fix assert-crash if server doesn't send EXISTS reply to SELECT
Fixes:
Panic: file imapc-sync.c: line 477 (imapc_sync_index): assertion failed: (mbox->sync_fetch_first_uid == 1)
Timo Sirainen [Thu, 18 May 2017 17:18:24 +0000 (20:18 +0300)]
lib-imap-client: Change server IP only on connect() failures
Also log an warning-level message about it. This is mainly useful to see
that a slow connection could be caused by a connect() timeout. Since more
IPs are still available, it's not yet an error.
Timo Sirainen [Thu, 18 May 2017 16:42:03 +0000 (19:42 +0300)]
imapc: Fix infinite reconnection when server keeps sending corrupted state
When corrupted state was found, imapc_client_mailbox_reconnect() is called
to reconnect. This call skipped the normal "is it safe to reconnect?"
checks causing potentially infinite reconnections.
Timo Sirainen [Thu, 18 May 2017 16:40:04 +0000 (19:40 +0300)]
lib-imap: imap_parser_unref() should always set parser=NULL
Not just when the last reference is cleared. This is how *_unref()s should
work everywhere in Dovecot. This fixes a bug in lib-imap-client where a
parser could have been accessed after it was already freed.
Timo Sirainen [Thu, 18 May 2017 15:09:56 +0000 (18:09 +0300)]
imapc: Avoid resending duplicate FETCH when reconnecting during the initial sync
Timo Sirainen [Thu, 18 May 2017 15:01:27 +0000 (18:01 +0300)]
imapc: If initial SELECT fails, don't resend it twice on reconnect.
Timo Sirainen [Thu, 18 May 2017 14:36:27 +0000 (17:36 +0300)]
lib-imap-client: Avoid infinite reconnection loops when retrying command fails
reconnect_command_count wasn't calculated correctly, because the SELECT and
potentially other following sync commands weren't included in it.
Timo Sirainen [Thu, 18 May 2017 09:32:12 +0000 (12:32 +0300)]
lib: Add dovecot_build_info variable containing Dovecot build information.
By default this includes the version, including the git hash. The idea is
that this version information would be available in all the core dumps.
The DOVECOT_BUILD_INFO can be overridden by compiling with:
DOVECOT_BUILD_INFO='"build info"' make
Timo Sirainen [Tue, 16 May 2017 14:53:23 +0000 (17:53 +0300)]
auth: If passdb/userdb ldap has blocking=yes, auth master shouldn't connect to ldap
Timo Sirainen [Thu, 18 May 2017 08:57:38 +0000 (11:57 +0300)]
director: Add old host's up/down and vhost count parameters to director_flush_socket
The "down" status allows the script to determine whether it should try to
perform any work on the old host. The vhost count may be unnecessary, but
might be useful for some purpose.
Timo Sirainen [Sun, 30 Apr 2017 09:31:48 +0000 (12:31 +0300)]
dsync: Try to commit transactions every dsync_commit_msgs_interval messages
This was first attempted to be implemented by
ec0cc8fa647794e44a1afaa448f495a713048dc4 , but it was later partially
reverted by
5973d496b16721af6d2c1fa90b016aacddf13554 . This current
commit should fix its problems.
Josef 'Jeff' Sipek [Fri, 12 May 2017 09:44:27 +0000 (12:44 +0300)]
lib-storage: add a mail user pre-deinit vfunc
This allows plugins to perform checks right before the deinit call.
Timo Sirainen [Thu, 4 May 2017 16:59:41 +0000 (19:59 +0300)]
imapc: Try to merge STOREs together as much as possible when syncing
Timo Sirainen [Fri, 5 May 2017 12:20:05 +0000 (15:20 +0300)]
lib-storage: Avoid unnecessary UIDNEXT lookups after saving a mail
The vsize checking code was expecting that this would always be a cheap
operation, but with imapc code it could trigger a remote STATUS (UIDNEXT)
call. Do this only when we've checked that this mailbox is updating vsize
header at all.
Timo Sirainen [Fri, 12 May 2017 12:42:31 +0000 (15:42 +0300)]
imapc-quota: Avoid sending unnecessarily many GETQUOTA[ROOT] commands
The last_refresh == ioloop_timeval check didn't work, because the refresh
itself updated ioloop_timeval. This caused a single quota lookup to issue
multiple GETQUOTA[ROOT] commands to imapc.
Timo Sirainen [Wed, 10 May 2017 09:44:25 +0000 (12:44 +0300)]
doveadm mailbox status: Add "firstsaved" field.
Aki Tuomi [Tue, 9 May 2017 11:29:04 +0000 (14:29 +0300)]
lib-index: Add mail_cache_expunge_count
It can be called to correctly handle cache counters
when records are removed.
Timo Sirainen [Tue, 2 May 2017 09:18:40 +0000 (12:18 +0300)]
lib-imap: imap_append_string_for_humans() - Change CR/LF to space
Practically this shouldn't matter, because in email headers a CR/LF is
always followed by a space/tab. But maybe this can be used for some
other purposes in future, and it makes the unit tests clearer. :)
Timo Sirainen [Fri, 12 May 2017 08:13:09 +0000 (11:13 +0300)]
lib-storage: Add missing ATTR_FORMAT to mail_set_mail_cache_corrupted()
Aki Tuomi [Tue, 9 May 2017 11:01:07 +0000 (14:01 +0300)]
lib-storage: Use new mail_cache_set_seq_corrupted_reason
Aki Tuomi [Tue, 9 May 2017 11:00:38 +0000 (14:00 +0300)]
lib-index: Add mail_cache_set_seq_corrupted_reason
Marks a seq in cache corrupted, and removes
that instead of the whole cache.
Aki Tuomi [Fri, 12 May 2017 10:35:06 +0000 (13:35 +0300)]
lib-storage: Remove index_storage_save_continue
It was not intended for v2.2
Aki Tuomi [Fri, 12 May 2017 04:47:56 +0000 (07:47 +0300)]
lib-storage: Unconstify test functions
Removes a compiler warning
Aki Tuomi [Fri, 12 May 2017 04:41:27 +0000 (07:41 +0300)]
lib: Use t_malloc instead of t_malloc_no0
Broken in
4792d4bd
Timo Sirainen [Tue, 2 May 2017 12:38:00 +0000 (15:38 +0300)]
lib: Add dec2str_buf()
Conflicts:
src/lib/strfuncs.c
Timo Sirainen [Tue, 2 May 2017 15:40:43 +0000 (18:40 +0300)]
master: Send SIGQUIT to processes running at deinit to close socket listeners.
This allows Dovecot to be restarted even when some lmtp/doveadm process is
running for a long time. Otherwise it would keep the inet_listener socket
open and prevent the new Dovecot from binding to the port.
Timo Sirainen [Tue, 2 May 2017 13:13:08 +0000 (16:13 +0300)]
lib-master: When running under master, close listeners immediately on SIGQUIT
Timo Sirainen [Tue, 2 May 2017 15:39:06 +0000 (18:39 +0300)]
lib-master: Remove listener's IO earlier if possible
This is needed for the next change to work properly.
Timo Sirainen [Tue, 2 May 2017 12:56:40 +0000 (15:56 +0300)]
master: Wait more precisely 5 secs at deinit for child processes to die.
Use milliseconds granularity instead of seconds.
Timo Sirainen [Tue, 2 May 2017 12:41:41 +0000 (15:41 +0300)]
lib: Use lib_signals_syscall_error() for write() failure in signal handler
Timo Sirainen [Tue, 2 May 2017 12:41:04 +0000 (15:41 +0300)]
lib: Add lib_signals_syscall_error()
Timo Sirainen [Tue, 9 May 2017 10:15:42 +0000 (13:15 +0300)]
man: Fix doveadm-flags examples
Patch by Frank Ebert
Aki Tuomi [Tue, 9 May 2017 09:25:49 +0000 (12:25 +0300)]
auth: Do not use AUTH_SUBSYS_MECH in logging when request->mech is NULL
This can happen when a lookup is done instead of authentication.
Fixes auth: Panic: file auth-request.c: line 2560 (get_log_prefix): assertion failed: (auth_request->mech != NULL)
Aki Tuomi [Mon, 8 May 2017 09:24:52 +0000 (12:24 +0300)]
passdb-imap: Make sure ssl verification is possible with current settings
Aki Tuomi [Mon, 8 May 2017 09:24:21 +0000 (12:24 +0300)]
passdb-imap: Add ssl_ca_file setting
Allow setting SSL trust roots from a file
Aki Tuomi [Fri, 28 Apr 2017 17:28:23 +0000 (20:28 +0300)]
passdb-imap: Add option to control certificate verification
Turn it on by default
Aki Tuomi [Mon, 8 May 2017 10:35:35 +0000 (13:35 +0300)]
lib-ssl-iostream: Support IP address SANs
Timo Sirainen [Fri, 5 May 2017 09:35:23 +0000 (12:35 +0300)]
imap: Set FETCH transactions hidden only when \Seen flags are implicitly set
This simplifies implementing some plugins and has no downsides to core
functionality.
Timo Sirainen [Thu, 4 May 2017 14:31:47 +0000 (17:31 +0300)]
lib-storage: Fix memory leak in mail_search_args_simplify()
The leaks happened when search args were already initialized (which they
usually were at this point) and some of the args were dropped entirely.
Improved the unit test to initialize search args before calling the
simplify, so valgrind would notice if there are any leaks.
Conflicts:
src/lib-storage/test-mail-search-args-simplify.c
Timo Sirainen [Tue, 2 May 2017 12:02:25 +0000 (15:02 +0300)]
lib-master: Add comments to struct master_service_connection
Conflicts:
src/lib-master/master-service.h
Timo Sirainen [Fri, 28 Apr 2017 11:35:36 +0000 (14:35 +0300)]
lib-storage: When save is aborted, close dest_mail without crashing
Fixes:
Panic: file mail-index-transaction-update.c: line 1023 (mail_index_update_ext): assertion failed: (seq > 0 && (seq <= mail_index_view_get_messages_count(t->view) || seq <= t->last_new_seq))
Because cache was still attempted to be updated, but the mail was already
expunged from index.
Timo Sirainen [Fri, 28 Apr 2017 11:06:43 +0000 (14:06 +0300)]
lib-storage: Move backend code to a common index_storage_save_abort_last()
Conflicts:
src/lib-storage/index/index-storage.c
src/lib-storage/index/index-storage.h
Aki Tuomi [Thu, 27 Apr 2017 11:09:08 +0000 (14:09 +0300)]
auth: Log reason for skipping passdb
Aki Tuomi [Fri, 28 Apr 2017 09:49:37 +0000 (12:49 +0300)]
auth: Add test suite for username filter
Aki Tuomi [Fri, 28 Apr 2017 07:25:14 +0000 (10:25 +0300)]
auth: Refactor auth to use libauth.la
This makes writing new unit tests easier, as you can link
to libauth.la.