]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
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 agoAdded doc/man/doveadm-save.1 to .gitignore.
Stephan Bosch [Fri, 12 May 2017 00:37:22 +0000 (02:37 +0200)] 
Added doc/man/doveadm-save.1 to .gitignore.

8 years agodoc: Add manpage for doveadm-save
Aki Tuomi [Thu, 11 May 2017 06:24:57 +0000 (09:24 +0300)] 
doc: Add manpage for doveadm-save

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-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 agossl-proxy-openssl: Fix comparison to stricly boolean
Aki Tuomi [Wed, 10 May 2017 09:40:27 +0000 (12:40 +0300)] 
ssl-proxy-openssl: Fix comparison to stricly boolean

8 years ago{lib,lib-fts}: fix builds with BSD make
Josef 'Jeff' Sipek [Tue, 9 May 2017 09:51:49 +0000 (12:51 +0300)] 
{lib,lib-fts}: fix builds with BSD make

Without this change, BSD make doesn't know how to make a couple of the
generated files because the BUILT_SOURCES file names don't match exactly
the left hand sides of the rules.  (GNU make somehow manages to match the
rule even though it is not an exact match.)

8 years agolib: use full path to unicode data script
Josef 'Jeff' Sipek [Tue, 9 May 2017 09:43:46 +0000 (12:43 +0300)] 
lib: use full path to unicode data script

This is a step toward fixing builds where object dir != source dir.

8 years agolib-fts: use full path to word-properties script
Josef 'Jeff' Sipek [Tue, 9 May 2017 09:42:48 +0000 (12:42 +0300)] 
lib-fts: use full path to word-properties script

This is a step toward fixing builds where object dir != source dir.

8 years agolib-fts: download data files into srcdir
Josef 'Jeff' Sipek [Tue, 9 May 2017 09:36:40 +0000 (12:36 +0300)] 
lib-fts: download data files into srcdir

This is a step toward fixing builds where object dir != source dir.

8 years agolib: download unicode data into srcdir
Josef 'Jeff' Sipek [Tue, 9 May 2017 09:34:40 +0000 (12:34 +0300)] 
lib: download unicode data into srcdir

This is a step toward fixing builds where object dir != source dir.

8 years agoremove mystery file that appears to be unused
Josef 'Jeff' Sipek [Wed, 10 May 2017 07:55:49 +0000 (10:55 +0300)] 
remove mystery file that appears to be unused

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 agolib: Add dec2str_buf()
Timo Sirainen [Tue, 2 May 2017 12:38:00 +0000 (15:38 +0300)] 
lib: Add dec2str_buf()

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 agoconfigure: Remove --with-storages parameter
Josef 'Jeff' Sipek [Tue, 9 May 2017 07:07:55 +0000 (10:07 +0300)] 
configure: Remove --with-storages parameter

Just compile all the storages, since the only benefit in limiting them
is to save a tiny bit of disk space. The recently added imapc quota code
fails to link if imapc storage isn't compiled in. This is the simplest
way to fix that.

8 years agolib-master,login-common: Add dual cert support
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

8 years agolib-fs: unit tests for fs-api/fs-posix
Phil Carmody [Mon, 6 Mar 2017 17:42:18 +0000 (19:42 +0200)] 
lib-fs: unit tests for fs-api/fs-posix

A core component, really ought to be covered by the unit tests.
This barely scrapes the surface, but is better than nothing:
filesystem/files/iterators, read/write/exists, good and bad cases.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
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 agolib-lda: mail-send: Compose var_expand table only once.
Stephan Bosch [Sun, 6 Nov 2016 00:33:04 +0000 (01:33 +0100)] 
lib-lda: mail-send: Compose var_expand table only once.

8 years agolib-lda: mail-send: Fixed debug message in mail_send_rejection() to use correct address.
Stephan Bosch [Sun, 6 Nov 2016 12:17:26 +0000 (13:17 +0100)] 
lib-lda: mail-send: Fixed debug message in mail_send_rejection() to use correct address.

8 years agolib-lda: Fixed indentation in mail-send.c.
Stephan Bosch [Sat, 5 Nov 2016 16:44:07 +0000 (17:44 +0100)] 
lib-lda: Fixed indentation in mail-send.c.

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 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.

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-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 agolmtp: Fix assert-crash when proxy overrides mail_max_lock_timeout
Timo Sirainen [Tue, 2 May 2017 14:57:40 +0000 (17:57 +0300)] 
lmtp: Fix assert-crash when proxy overrides mail_max_lock_timeout

Time unit is required or the call fails.

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

8 years agolib-index: mail-index-transaction-export: Fixed handling of transaction_flag_updates_...
Stephan Bosch [Mon, 1 May 2017 20:23:36 +0000 (22:23 +0200)] 
lib-index: mail-index-transaction-export: Fixed handling of transaction_flag_updates_have_non_internal() return value.

Found using Clang -Wstrict-bool.

8 years agolib-imap-client: Fixed NULL check in assertion to be proper boolean.
Stephan Bosch [Mon, 1 May 2017 20:19:43 +0000 (22:19 +0200)] 
lib-imap-client: Fixed NULL check in assertion to be proper boolean.

Found using Clang -Wstrict-bool.

8 years agoauth: Organize code into two unit tests
Aki Tuomi [Fri, 28 Apr 2017 11:42:31 +0000 (14:42 +0300)] 
auth: Organize code into two unit tests

auth-cache needs special setup

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()

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: 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 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 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 agoauth: Fixed dovecot/auth hanging when child ntlm_auth crashes while processing an...
Andriy Syrovenko [Sun, 16 Apr 2017 22:14:02 +0000 (01:14 +0300)] 
auth: Fixed dovecot/auth hanging when child ntlm_auth crashes while processing an authentication request

8 years agoimapc: Fix memory leak when closing mailbox with delayed changes
Timo Sirainen [Wed, 26 Apr 2017 11:20:49 +0000 (14:20 +0300)] 
imapc: Fix memory leak when closing mailbox with delayed changes

8 years agoimapc: Use UID SEARCH instead of SEARCH
Timo Sirainen [Tue, 25 Apr 2017 09:39:04 +0000 (12:39 +0300)] 
imapc: Use UID SEARCH instead of SEARCH

UIDs work better for some broken IMAP servers, so it's safer to use it.

Keep using sequences for ESEARCH, since servers supporting it aren't at
least yet known to be broken and the search result with sequences is
smaller.

8 years agoquota: Add imapc backend
Timo Sirainen [Mon, 24 Apr 2017 14:59:53 +0000 (17:59 +0300)] 
quota: Add imapc backend

This allows using imapc storage with imapc quota. The quota acts as
read-only, so it's used only when the current quota usage is explicitly
asked.

The quota can be looked up using either a mailbox name or quota root name.
By default INBOX's quota is looked up. If there are multiple quota roots
returned for the mailbox, only the first quota root returned by the
QUOTAROOT reply is used.

8 years agoquota: Fix namespace deduplication when mailboxes don't have paths.
Timo Sirainen [Mon, 24 Apr 2017 14:58:53 +0000 (17:58 +0300)] 
quota: Fix namespace deduplication when mailboxes don't have paths.

Nothing requires a mailbox path for quota backends, especially imapc.
Still do namespace deduplication based on alias_for settings.

8 years agoimapc: include imapc-client.h in imapc-storage.h
Timo Sirainen [Mon, 24 Apr 2017 14:10:10 +0000 (17:10 +0300)] 
imapc: include imapc-client.h in imapc-storage.h

It was already required to be able to successfully include imapc-storage.h.

8 years agoimap-plugins: Use client_add_capability() for adding dynamic capabilities
Timo Sirainen [Mon, 24 Apr 2017 15:13:13 +0000 (18:13 +0300)] 
imap-plugins: Use client_add_capability() for adding dynamic capabilities

8 years agoimap: Use client_add_capability() for adding all dynamic capabilities
Timo Sirainen [Mon, 24 Apr 2017 15:51:53 +0000 (18:51 +0300)] 
imap: Use client_add_capability() for adding all dynamic capabilities

8 years agoimap: Add client_add_capability()
Timo Sirainen [Mon, 24 Apr 2017 15:12:55 +0000 (18:12 +0300)] 
imap: Add client_add_capability()

8 years agoimapc: Add imapc_features=fetch-bodystructure
Timo Sirainen [Mon, 24 Apr 2017 10:29:13 +0000 (13:29 +0300)] 
imapc: Add imapc_features=fetch-bodystructure

This allows using the remote IMAP server's BODY and BODYSTRUCTURE replies.

8 years agolib-storage: Add mail_storage.nonbody_access_fields
Timo Sirainen [Mon, 24 Apr 2017 10:27:43 +0000 (13:27 +0300)] 
lib-storage: Add mail_storage.nonbody_access_fields

This avoids index_mail_update_access_parts_pre() from opening the mail
stream unnecessarily for fields that can be looked up via other methods
by the storage.

8 years agolib-storage: Add index_mail_get_cached_body[structure]()
Timo Sirainen [Mon, 24 Apr 2017 10:05:48 +0000 (13:05 +0300)] 
lib-storage: Add index_mail_get_cached_body[structure]()

This just moves the code to these functions without changing any of the
logic.

8 years agolib-imap: Make imap_bodystructure_parse_args() public
Timo Sirainen [Mon, 24 Apr 2017 11:04:01 +0000 (14:04 +0300)] 
lib-imap: Make imap_bodystructure_parse_args() public

8 years agolib-imap: Add imap_write_arg() to write only a single arg
Timo Sirainen [Mon, 24 Apr 2017 09:50:10 +0000 (12:50 +0300)] 
lib-imap: Add imap_write_arg() to write only a single arg

8 years agolib-imap-client: Fix imapc_client_get_capabilities() when called without connections
Timo Sirainen [Sun, 23 Apr 2017 16:57:11 +0000 (19:57 +0300)] 
lib-imap-client: Fix imapc_client_get_capabilities() when called without connections

8 years agoimapc: Fix crash in mailbox_exists() when LAYOUT isn't imapc.
Timo Sirainen [Sun, 23 Apr 2017 14:19:36 +0000 (17:19 +0300)] 
imapc: Fix crash in mailbox_exists() when LAYOUT isn't imapc.

Especially breaks LAYOUT=none.

8 years agoimapc: Support imapc_features=search without ESEARCH extension
Timo Sirainen [Sun, 23 Apr 2017 10:35:18 +0000 (13:35 +0300)] 
imapc: Support imapc_features=search without ESEARCH extension

8 years agoimapc: Make sure client is logged in when checking capabilities
Timo Sirainen [Sun, 23 Apr 2017 16:14:54 +0000 (19:14 +0300)] 
imapc: Make sure client is logged in when checking capabilities

Especially with imapc_features=delay-login the capability could have been
looked at before the client was even connected.

8 years agoimapc: Add imapc_mailbox.capabilities
Timo Sirainen [Sun, 23 Apr 2017 15:51:02 +0000 (18:51 +0300)] 
imapc: Add imapc_mailbox.capabilities

Use it instead of imapc_client_get_capabilities(). Simplifies the
following patch.

8 years agoimapc: Rename imapc_storage_has_modseqs() to imapc_mailbox_has_modseqs()
Timo Sirainen [Sun, 23 Apr 2017 15:57:15 +0000 (18:57 +0300)] 
imapc: Rename imapc_storage_has_modseqs() to imapc_mailbox_has_modseqs()

Simplifies the following patch.

8 years agocassandra: Use fallback consistency for CASS_ERROR_LIB_NO_HOSTS_AVAILABLE errors
Timo Sirainen [Fri, 21 Apr 2017 09:54:17 +0000 (12:54 +0300)] 
cassandra: Use fallback consistency for CASS_ERROR_LIB_NO_HOSTS_AVAILABLE errors

I'm not entirely sure if this is always appropriate, but at least this error
happens every time when attempting to use write_consistency=two when there
is only a single Cassandra node.

8 years agodsync-server: Fix support for dsync_features=empty-header-workaround
Timo Sirainen [Fri, 21 Apr 2017 17:59:55 +0000 (20:59 +0300)] 
dsync-server: Fix support for dsync_features=empty-header-workaround

Fixes:
Panic: Unknown key: empty_hdr_workaround

8 years ago*-login: Require client_vfuncs.send_raw_data() to be set
Timo Sirainen [Fri, 21 Apr 2017 10:36:27 +0000 (13:36 +0300)] 
*-login: Require client_vfuncs.send_raw_data() to be set

This removes backwards compatibility for managesieve-login.

8 years ago*-login: Add client_vfuncs.send_raw_data()
Timo Sirainen [Fri, 21 Apr 2017 10:35:33 +0000 (13:35 +0300)] 
*-login: Add client_vfuncs.send_raw_data()

This allows login plugins to hook into seeing all the data that is sent to
the imap/pop3 client.

8 years agoimap: Add imap_client_vfuncs.send_tagline()
Timo Sirainen [Fri, 21 Apr 2017 10:27:18 +0000 (13:27 +0300)] 
imap: Add imap_client_vfuncs.send_tagline()

This allows plugins to catch all the IMAP command replies.

8 years ago*-login: Unload plugins at deinit.
Timo Sirainen [Tue, 18 Apr 2017 07:23:37 +0000 (10:23 +0300)] 
*-login: Unload plugins at deinit.

8 years agolib-storage: Allow mail_add_temp_wanted_fields() to be called before mail_set_seq*()
Timo Sirainen [Wed, 19 Apr 2017 12:01:19 +0000 (15:01 +0300)] 
lib-storage: Allow mail_add_temp_wanted_fields() to be called before mail_set_seq*()

Quota plugin was already doing this, but it didn't actually work. It was
also crashing with imapc:

Panic: file mail-cache-lookup.c: line 341 (mail_cache_field_exists): assertion failed: (seq > 0)

8 years agolib-storage: Add mailbox_attribute_unregister_internal[s]()
Timo Sirainen [Thu, 20 Apr 2017 16:16:46 +0000 (19:16 +0300)] 
lib-storage: Add mailbox_attribute_unregister_internal[s]()

This allows plugins to unregister internal attributes when they're unloaded.

8 years agolib-storage: mail_search_args_simplify() - deduplicate flags
Timo Sirainen [Thu, 13 Apr 2017 12:13:19 +0000 (15:13 +0300)] 
lib-storage: mail_search_args_simplify() - deduplicate flags

This needs to be done in a bit more complicated way because multiple
SEARCH_FLAGS parameters are wanted to be merged together using a single
shared value.flags. Move this merging last after all the deduplication is
done.

8 years agolib-storage: mail_search_args_simplify() - simplify "x AND NOT x"
Timo Sirainen [Thu, 13 Apr 2017 12:09:19 +0000 (15:09 +0300)] 
lib-storage: mail_search_args_simplify() - simplify "x AND NOT x"

Implemented for SEARCH_KEYWORD, SEARCH_TEXT, SEARCH_BODY and SEARCH_HEADER*.
Dates and sizes would need special code, which gets a bit complicated.

8 years agolib-storage: Add more tests to test-mail-search-args-simplify
Timo Sirainen [Thu, 13 Apr 2017 11:05:55 +0000 (14:05 +0300)] 
lib-storage: Add more tests to test-mail-search-args-simplify

8 years agolib-storage: mail_search_arg_to_imap() - remove () around a single flag/keyword
Timo Sirainen [Thu, 13 Apr 2017 10:57:41 +0000 (13:57 +0300)] 
lib-storage: mail_search_arg_to_imap() - remove () around a single flag/keyword

8 years agolib-storage: mail_search_args_simplify() - deduplicate KEYWORDs
Timo Sirainen [Thu, 13 Apr 2017 10:04:25 +0000 (13:04 +0300)] 
lib-storage: mail_search_args_simplify() - deduplicate KEYWORDs

8 years agolib-storage: mail_search_args_to_cmdline() - Fix writing FLAGS & KEYWORDS
Timo Sirainen [Thu, 13 Apr 2017 09:51:25 +0000 (12:51 +0300)] 
lib-storage: mail_search_args_to_cmdline() - Fix writing FLAGS & KEYWORDS

8 years agolib-storage: mail_search_args_to_cmdline() - Write MAILBOX glob without X- prefix
Timo Sirainen [Thu, 13 Apr 2017 09:36:30 +0000 (12:36 +0300)] 
lib-storage: mail_search_args_to_cmdline() - Write MAILBOX glob without X- prefix

Since SEARCH_MAILBOX is written out as "MAILBOX", SEARCH_MAILBOX_GLOB should
also be written as "MAILBOX" rather than "X-MAILBOX".

8 years agoMakefile: Another fix for make distcheck when using scan-build
Timo Sirainen [Wed, 12 Apr 2017 09:24:05 +0000 (12:24 +0300)] 
Makefile: Another fix for make distcheck when using scan-build

It seems to run two configures with different parameters, which results in
some of the files not being cleaned up. So this hopefully fixes:

ERROR: files left in build directory after distclean:
./src/util/tcpwrap

8 years agolib-imap: imap-bodystructure: Fixed handling of a multipart part without children...
Stephan Bosch [Tue, 11 Apr 2017 07:34:11 +0000 (09:34 +0200)] 
lib-imap: imap-bodystructure: Fixed handling of a multipart part without children in imap_bodystructure_parse().

In imap_bodystructure_write(), an empty multipart part is addressed by generating an empty text/plain part.
However, when parsing that back with imap_bodystructure_parse() against a parsed message_part tree, this case needs to be considered explicitly.
Otherwise, it will not be able to match the message part hierarchies.

This adds a test suite item that tests both the write (previous commit) and parse functions.

8 years agolib-imap: imap-bodystructure: Fixed handling of a multipart part without children...
Stephan Bosch [Wed, 12 Apr 2017 08:13:15 +0000 (10:13 +0200)] 
lib-imap: imap-bodystructure: Fixed handling of a multipart part without children in imap_bodystructure_write().

In that case it writes an empty text/plain part to prevent generating an invalid BODYSTRUCURE.
However, it always generated the basic BODY version without the extra fields for a full BODYSTRUCTURE.

8 years agoauth: Check var_expand error in vpopmail
Aki Tuomi [Tue, 11 Apr 2017 17:39:55 +0000 (20:39 +0300)] 
auth: Check var_expand error in vpopmail

8 years agoauth: Fix compile problem with vpopmail
Aki Tuomi [Tue, 11 Apr 2017 17:32:19 +0000 (20:32 +0300)] 
auth: Fix compile problem with vpopmail

79fe1b28df44ba22b230326bee895583c1df5a28 forgot to remove const from table.