]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agoReleased v2.2.30. release-2.2.30 2.2.30
Timo Sirainen [Tue, 30 May 2017 18:12:01 +0000 (21:12 +0300)] 
Released v2.2.30.

8 years agolib-storage: Fix compiler warning in test-mail-storage
Timo Sirainen [Tue, 30 May 2017 07:01:20 +0000 (10:01 +0300)] 
lib-storage: Fix compiler warning in test-mail-storage

8 years agoauth: Fix crash on passdb lookup when all passdbs were skipped
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)

8 years agolib-storage: Fix crash 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

8 years agomail-crypt-plugin: Set copy-hook only if save_version > 0
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.

8 years agomail-crypt: Re-encrypt mails when copying/moving
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

8 years agolib-storage: Fix memory leak in test-mail-storage
Timo Sirainen [Wed, 24 May 2017 19:31:59 +0000 (22:31 +0300)] 
lib-storage: Fix memory leak in test-mail-storage

8 years agolib-storage: Add unit test for set/get/push/pop storage error operations
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

8 years agolib-storage: Fix mail_storage_set_critical() when input parameter is an old internal...
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.

8 years agolib-storage: Fix mail_storage_last_error_push/pop() to work with internal errors
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

8 years agoimap: Fix unhibernation after earlier change
Timo Sirainen [Mon, 22 May 2017 14:56:15 +0000 (17:56 +0300)] 
imap: Fix unhibernation after earlier change

8 years agoimap NOTIFY: Flush any pending notifications on NOOP
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.

8 years agolib-storage: Implement mailbox_list_notify_flush()
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.

8 years agolib-storage: Explicitly name function pointers in mailbox lists
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.

8 years agolib-storage: Always update highestmodseq in mailbox list index
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.

8 years agolib-storage: Fix mailbox list index notifications when modseqs aren't enabled.
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.

8 years agoimap: login reply should be sent sooner
Josef 'Jeff' Sipek [Wed, 17 May 2017 08:40:53 +0000 (11:40 +0300)] 
imap: login reply should be sent sooner

8 years agolib-http: client: Fixed race condition between DNS refresh lookup and a soft connecti...
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.

8 years agolib-master: Replace listeners with /dev/null in SIGQUIT instead of closing
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.

8 years agolib-index: Fix crash in mail_transaction_log_view_set_all() error handling
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

8 years agolib-index: Fix start_offset > sync_offset error handling for in-memory indexes
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

8 years agoReleased v2.2.30.rc1. 2.2.30.rc1
Timo Sirainen [Wed, 24 May 2017 14:52:53 +0000 (17:52 +0300)] 
Released v2.2.30.rc1.

8 years agoauth: Fix linking duplicate .a libraries to unit test
Timo Sirainen [Fri, 19 May 2017 07:45:09 +0000 (10:45 +0300)] 
auth: Fix linking duplicate .a libraries to unit test

8 years agoutil: script: Increased the major protocol version due to earlier changes.
Stephan Bosch [Mon, 8 May 2017 10:49:39 +0000 (12:49 +0200)] 
util: script: Increased the major protocol version due to earlier changes.

8 years agoutil: script: Amended protocol with the ability to convey a set of environment variab...
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.

8 years agoutil: script: Amended the protocol to pass arguments escaped to prevent problems...
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.

8 years agolib-program-client: local: Fixed use of unterminated string array of environment...
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().

8 years agolib-program-client: Made the test suite ignore the protocol version.
Stephan Bosch [Tue, 9 May 2017 12:22:06 +0000 (14:22 +0200)] 
lib-program-client: Made the test suite ignore the protocol version.

8 years agolib-program-client: Gave variables pointing to a program-client more logical names.
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.

8 years agoimap: Move struct client_sync_context to imap-sync-private.h and add imap_ prefix
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

8 years agoimap: Allow plugins to replace existing FETCH handlers
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.

8 years agolib-index: Improve "start_offset > current sync_offset" error message.
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.

8 years agolib-index: mail_transaction_log_file_get_highest_modseq_at() - return error string
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.

8 years agolib-index: Add missing error logging for mail_index_view_sync_begin()
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()

8 years agolib-index: mail_transaction_log_file_map() - return reason/error string
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.

8 years agolib-index: mail_transaction_log_view_set_all() - don't entirely ignore corrupted...
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.

8 years agolib-storage: Fix mailbox list index records without guid having invalid flags
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.

8 years agolib-storage: Fix mailbox list index records with name_id=0
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.

8 years agolib: Fix memory leak in test-istream-concat
Timo Sirainen [Fri, 19 May 2017 06:45:28 +0000 (09:45 +0300)] 
lib: Fix memory leak in test-istream-concat

8 years agolib: Fix crash when seeking istream-concat to EOF and trying to read it
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

8 years agoimapc: Make sure a valid UIDVALIDITY is returned by SELECT
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

8 years agoimapc: Fix assert-crash if server doesn't send EXISTS reply to SELECT
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)

8 years agolib-imap-client: Change server IP only on connect() failures
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.

8 years agoimapc: Fix infinite reconnection when server keeps sending corrupted state
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.

8 years agolib-imap: imap_parser_unref() should always set parser=NULL
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.

8 years agoimapc: Avoid resending duplicate FETCH when reconnecting during the initial sync
Timo Sirainen [Thu, 18 May 2017 15:09:56 +0000 (18:09 +0300)] 
imapc: Avoid resending duplicate FETCH when reconnecting during the initial sync

8 years agoimapc: If initial SELECT fails, don't resend it twice on reconnect.
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.

8 years agolib-imap-client: Avoid infinite reconnection loops when retrying command fails
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.

8 years agolib: Add dovecot_build_info variable containing Dovecot build information.
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

8 years agoauth: If passdb/userdb ldap has blocking=yes, auth master shouldn't connect to ldap
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

8 years agodirector: Add old host's up/down and vhost count parameters to director_flush_socket
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.

8 years agodsync: Try to commit transactions every dsync_commit_msgs_interval messages
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.

8 years agolib-storage: add a mail user pre-deinit vfunc
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.

8 years agoimapc: Try to merge STOREs together as much as possible when syncing
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

8 years agolib-storage: Avoid unnecessary UIDNEXT lookups after saving a mail
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.

8 years agoimapc-quota: Avoid sending unnecessarily many GETQUOTA[ROOT] commands
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.

8 years agodoveadm mailbox status: Add "firstsaved" field.
Timo Sirainen [Wed, 10 May 2017 09:44:25 +0000 (12:44 +0300)] 
doveadm mailbox status: Add "firstsaved" field.

8 years agolib-index: Add mail_cache_expunge_count
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.

8 years agolib-imap: imap_append_string_for_humans() - Change CR/LF to space
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. :)

8 years agolib-storage: Add missing ATTR_FORMAT to mail_set_mail_cache_corrupted()
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()

8 years agolib-storage: Use new mail_cache_set_seq_corrupted_reason
Aki Tuomi [Tue, 9 May 2017 11:01:07 +0000 (14:01 +0300)] 
lib-storage: Use new mail_cache_set_seq_corrupted_reason

8 years agolib-index: Add 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.

8 years agolib-storage: Remove index_storage_save_continue
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

8 years agolib-storage: Unconstify test functions
Aki Tuomi [Fri, 12 May 2017 04:47:56 +0000 (07:47 +0300)] 
lib-storage: Unconstify test functions

Removes a compiler warning

8 years agolib: Use t_malloc instead of t_malloc_no0
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

8 years agolib: Add dec2str_buf()
Timo Sirainen [Tue, 2 May 2017 12:38:00 +0000 (15:38 +0300)] 
lib: Add dec2str_buf()

Conflicts:
src/lib/strfuncs.c

8 years agomaster: Send SIGQUIT to processes running at deinit to close socket listeners.
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.

8 years agolib-master: When running under master, close listeners immediately on SIGQUIT
Timo Sirainen [Tue, 2 May 2017 13:13:08 +0000 (16:13 +0300)] 
lib-master: When running under master, close listeners immediately on SIGQUIT

8 years agolib-master: Remove listener's IO earlier if possible
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.

8 years agomaster: Wait more precisely 5 secs at deinit for child processes to die.
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.

8 years agolib: Use lib_signals_syscall_error() for write() failure in signal handler
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

8 years agolib: Add lib_signals_syscall_error()
Timo Sirainen [Tue, 2 May 2017 12:41:04 +0000 (15:41 +0300)] 
lib: Add lib_signals_syscall_error()

8 years agoman: Fix doveadm-flags examples
Timo Sirainen [Tue, 9 May 2017 10:15:42 +0000 (13:15 +0300)] 
man: Fix doveadm-flags examples

Patch by Frank Ebert

8 years agoauth: Do not use AUTH_SUBSYS_MECH in logging when request->mech is NULL
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)

8 years agopassdb-imap: Make sure ssl verification is possible with current settings
Aki Tuomi [Mon, 8 May 2017 09:24:52 +0000 (12:24 +0300)] 
passdb-imap: Make sure ssl verification is possible with current settings

8 years agopassdb-imap: Add ssl_ca_file setting
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

8 years agopassdb-imap: Add option to control certificate verification
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

8 years agolib-ssl-iostream: Support IP address SANs
Aki Tuomi [Mon, 8 May 2017 10:35:35 +0000 (13:35 +0300)] 
lib-ssl-iostream: Support IP address SANs

8 years agoimap: Set FETCH transactions hidden only when \Seen flags are implicitly set
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.

8 years agolib-storage: Fix memory leak in mail_search_args_simplify()
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

8 years agolib-master: Add comments to struct master_service_connection
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

8 years agolib-storage: When save is aborted, close dest_mail without crashing
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.

8 years agolib-storage: Move backend code to a common index_storage_save_abort_last()
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

8 years agoauth: Log reason for skipping passdb
Aki Tuomi [Thu, 27 Apr 2017 11:09:08 +0000 (14:09 +0300)] 
auth: Log reason for skipping passdb

8 years agoauth: Add test suite for username filter
Aki Tuomi [Fri, 28 Apr 2017 09:49:37 +0000 (12:49 +0300)] 
auth: Add test suite for username filter

8 years agoauth: Refactor auth to use libauth.la
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.

8 years agoauth: Add username_filter for passdb block
Aki Tuomi [Fri, 28 Apr 2017 09:51:20 +0000 (12:51 +0300)] 
auth: Add username_filter for passdb block

username_filter lets you specify one or more pattern(s) for
including or excluding users. exclusion patterns are denoted
with ! prefix.

if any exclude matches the username, passdb will be skipped.
if any inclusions is specified, and the username does not match
one of them, passdb will be skipped.

8 years agoauth: Use MECH subsystem when logging error about skipping all password databases
Aki Tuomi [Thu, 27 Apr 2017 08:53:13 +0000 (11:53 +0300)] 
auth: Use MECH subsystem when logging error about skipping all password databases

Otherwise it will assert-crash because all password databases were skipped.

8 years agolib-storage: mail_search_arg_to_imap() - Fix writing invalid keywords
Timo Sirainen [Thu, 27 Apr 2017 09:54:20 +0000 (12:54 +0300)] 
lib-storage: mail_search_arg_to_imap() - Fix writing invalid keywords

Just write the original invalid keyword string as output. It might not be
entirely invalid - just invalid within this mailbox (e.g. a mailbox doesn't
allow new keywords).

8 years agolib-storage: Fix searching when search query has invalid keywords.
Timo Sirainen [Thu, 27 Apr 2017 09:53:18 +0000 (12:53 +0300)] 
lib-storage: Fix searching when search query has invalid keywords.

For example "SEARCH KEYWORD ]" was returning all mails instead of nothing.

8 years agolib-index: mail_index_update_keywords() - don't assert if adding/removing 0 keywords
Timo Sirainen [Thu, 27 Apr 2017 09:50:13 +0000 (12:50 +0300)] 
lib-index: mail_index_update_keywords() - don't assert if adding/removing 0 keywords

Although it would be nice for the caller to check it, it's easier to do
here. It's mainly a problem with mailbox_keywords_create_valid() that may
unexpectedly create empty keywords.

8 years agoquota: imapc backend now never enforces the quota itself
Timo Sirainen [Wed, 26 Apr 2017 20:41:03 +0000 (23:41 +0300)] 
quota: imapc backend now never enforces the quota itself

It just causes a lot of GETQUOTA/GETQUOTAROOT calls to remove. In theory we
could make this optional, but I doubt anyone would want it.

8 years agolib-storage: Fix crash in mail_get_parts() with a special plugin
Timo Sirainen [Wed, 26 Apr 2017 20:43:24 +0000 (23:43 +0300)] 
lib-storage: Fix crash in mail_get_parts() with a special plugin

If plugin hooks into mail_get_stream() which causes data->parts to be set,
this code crashed with:

Panic: file index-mail.c: line 1163 (index_mail_parse_body): assertion failed: (data->parser_ctx != NULL)

8 years agoimapc: Don't send NOOP on sync if MAILBOX_SYNC_FLAG_FAST is set
Timo Sirainen [Wed, 26 Apr 2017 20:13:20 +0000 (23:13 +0300)] 
imapc: Don't send NOOP on sync if MAILBOX_SYNC_FLAG_FAST is set

Fast syncing should do only the minimal amount of work.

8 years agoimap: Allow plugins to hook into syncing.
Timo Sirainen [Wed, 26 Apr 2017 12:04:23 +0000 (15:04 +0300)] 
imap: Allow plugins to hook into syncing.

Ideally all of the existing pieces in the syncing code would start using
this at some point, so their code could be moved to a more logical location.

8 years agoimap: Move struct imap_sync_context to imap-sync-private.h
Timo Sirainen [Wed, 26 Apr 2017 11:57:40 +0000 (14:57 +0300)] 
imap: Move struct imap_sync_context to imap-sync-private.h

8 years agolib-storage: mail_search_arg_to_imap() - minor keywords writing optimization
Timo Sirainen [Tue, 18 Apr 2017 12:55:08 +0000 (15:55 +0300)] 
lib-storage: mail_search_arg_to_imap() - minor keywords writing optimization

Avoid an extra str_delete() by checking whether the parenthesis are needed.

8 years agolib-storage: mail_search_arg_to_imap() - minor FLAGS writing optimization
Timo Sirainen [Tue, 18 Apr 2017 12:51:39 +0000 (15:51 +0300)] 
lib-storage: mail_search_arg_to_imap() - minor FLAGS writing optimization

Avoid an extra str_delete() by immediately calculating whether the
parenthesis are needed.

8 years agolib: Add bits_is_power_of_two()
Timo Sirainen [Tue, 18 Apr 2017 12:38:59 +0000 (15:38 +0300)] 
lib: Add bits_is_power_of_two()

8 years agolib: Fixed bits_required64() with 32bit systems.
Timo Sirainen [Tue, 19 Apr 2016 18:14:37 +0000 (21:14 +0300)] 
lib: Fixed bits_required64() with 32bit systems.

Broken by 84f697c5e30565823619abaaeb57164c789d4b66.