]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
9 years agoReleased v2.2.24. release-2.2.24 2.2.24
Timo Sirainen [Tue, 26 Apr 2016 14:30:35 +0000 (17:30 +0300)] 
Released v2.2.24.

9 years agostats: Support multiple FIFO listeners.
Timo Sirainen [Tue, 26 Apr 2016 14:12:25 +0000 (17:12 +0300)] 
stats: Support multiple FIFO listeners.

9 years agodoveadm -u: Use mail_storage_service_all_init_mask()
Timo Sirainen [Tue, 26 Apr 2016 08:12:45 +0000 (11:12 +0300)] 
doveadm -u: Use mail_storage_service_all_init_mask()

9 years agolib-storage: Added mail_storage_service_all_init_mask()
Timo Sirainen [Tue, 26 Apr 2016 08:11:57 +0000 (11:11 +0300)] 
lib-storage: Added mail_storage_service_all_init_mask()

This allows providing a usermask hint to the userdb iteration lookup. For example
with LDAP this allows setting the base based on the @domain.

9 years agolib-storage: fixup the broken search result with \seen or \delete
Baofeng Wang [Tue, 26 Apr 2016 08:10:35 +0000 (11:10 +0300)] 
lib-storage: fixup the broken search result with \seen or \delete

remove side effects of match_always flag during search.

9 years agolib-sql: Fixed building Cassandra as plugin
Timo Sirainen [Tue, 26 Apr 2016 07:31:49 +0000 (10:31 +0300)] 
lib-sql: Fixed building Cassandra as plugin

9 years agofts-lucene: Rescan skipped namespace roots.
Timo Sirainen [Mon, 25 Apr 2016 17:14:19 +0000 (20:14 +0300)] 
fts-lucene: Rescan skipped namespace roots.

9 years agofts-lucene: Cleanup - move code to a separate function
Timo Sirainen [Mon, 25 Apr 2016 17:13:54 +0000 (20:13 +0300)] 
fts-lucene: Cleanup - move code to a separate function

9 years agolib-mail: More fixes to istream-header-filter with large input.
Timo Sirainen [Mon, 25 Apr 2016 13:58:30 +0000 (16:58 +0300)] 
lib-mail: More fixes to istream-header-filter with large input.

Don't assume that when reading the header the second time we'll get exactly
the same header blocks as the first time.

This commit also prevents the filter callback from switching the
matching-decision on non-first header line. This shouldn't be needed and it
could just cause confusion. (It also made it a bit easier to implement this
fix.)

9 years agolib-mail: Improved istream-header-filter unit test.
Timo Sirainen [Mon, 25 Apr 2016 13:34:59 +0000 (16:34 +0300)] 
lib-mail: Improved istream-header-filter unit test.

Existing code already assumes that the callback is called for all the header
data. So it's not used just for filtering headers but also parsing the
header contents. Make this assumption now explicit as a unit test.

9 years agolib-mail: istream-header-filter didn't limit memory usage.
Timo Sirainen [Mon, 25 Apr 2016 13:25:46 +0000 (16:25 +0300)] 
lib-mail: istream-header-filter didn't limit memory usage.

A large header was always added to hdr_buf, ignoring any max_buffer_size
limits.

9 years agolib-mail: Code cleanup to istream-header-filter unit test
Timo Sirainen [Mon, 25 Apr 2016 13:22:12 +0000 (16:22 +0300)] 
lib-mail: Code cleanup to istream-header-filter unit test

The exclude_headers arrays were used in a confusing way. The X-Drop header
wasn't actually even used in the exclude_headers.

9 years agodsync: If state is invalid, exit with code 2 instead of tempfail.
Timo Sirainen [Mon, 25 Apr 2016 11:38:35 +0000 (14:38 +0300)] 
dsync: If state is invalid, exit with code 2 instead of tempfail.

We'll have dsync_mailbox_import_*() just return success to everything until
_deinit() is called. The _deinit() will return a failure and set "resync
needed"-flag, which caller will know how to handle.

9 years agodsync: If full resync is requested, return empty state string.
Timo Sirainen [Mon, 25 Apr 2016 11:35:21 +0000 (14:35 +0300)] 
dsync: If full resync is requested, return empty state string.

If the state is wrong, it's better to fully resync all the mailboxes rather
than just the one where a problem was noticed.

9 years agodsync: Improved detecting state state string.
Timo Sirainen [Mon, 25 Apr 2016 11:08:37 +0000 (14:08 +0300)] 
dsync: Improved detecting state state string.

9 years agolib-storage: Don't use same session ID for multiple mail_storage_service_next() calls.
Timo Sirainen [Fri, 15 Apr 2016 13:12:44 +0000 (16:12 +0300)] 
lib-storage: Don't use same session ID for multiple mail_storage_service_next() calls.

dsync does multiple mail_storage_service_next() calls for the same
mail_storage_service_user. This causes stats plugin to send the same
session ID to stats process, which complains about duplicates. Solved this
in a generic way by having the following mail_storage_service_next() calls
append :counter to session ID.

9 years agofs-posix: If link() fails, preserve its errno through the following unlink()
Timo Sirainen [Mon, 11 Apr 2016 14:25:51 +0000 (17:25 +0300)] 
fs-posix: If link() fails, preserve its errno through the following unlink()

9 years agofs-posix: Minor code cleanup - removed unnecessary code.
Timo Sirainen [Mon, 11 Apr 2016 14:20:52 +0000 (17:20 +0300)] 
fs-posix: Minor code cleanup - removed unnecessary code.

If success==TRUE, temp_path==NULL always also.

9 years agocassandra: Added num_threads, connect_timeout and request_timeout settings.
Timo Sirainen [Fri, 22 Apr 2016 16:37:57 +0000 (19:37 +0300)] 
cassandra: Added num_threads, connect_timeout and request_timeout settings.

9 years agolib-dovecot: Avoid duplication of listing *.la in both Makefile.am and configure
Timo Sirainen [Thu, 21 Apr 2016 16:18:55 +0000 (19:18 +0300)] 
lib-dovecot: Avoid duplication of listing *.la in both Makefile.am and configure

9 years agolib-dict: Moved dict-ldap to lib-dict-extra
Timo Sirainen [Thu, 21 Apr 2016 15:58:10 +0000 (18:58 +0300)] 
lib-dict: Moved dict-ldap to lib-dict-extra

This also allows moving lib-ldap away from LIBDOVECOT_SUBDIRS in
src/Makefile.am, which was wrong because it's not really part of
libdovecot.la.

9 years agoSplit parts of lib-dict into lib-dict-extra.
Timo Sirainen [Thu, 21 Apr 2016 15:51:57 +0000 (18:51 +0300)] 
Split parts of lib-dict into lib-dict-extra.

Otherwise there's a circular dependency because lib-dict/dict-fs.c depends
on lib-fs, while lib-fs/fs-dict.c depends on lib-dict. This becomes a problem
when compiling --without-shared-libs, although for some reason it works for
me while linking the Dovecot core, but not when linking external plugins.

9 years agodoveadm user: Added -e <value> parameter to expand %variables in <value>
Timo Sirainen [Tue, 19 Apr 2016 16:08:52 +0000 (19:08 +0300)] 
doveadm user: Added -e <value> parameter to expand %variables in <value>

This allows expanding any %variable that the mail processes normally expand.
For example:

% doveadm user -e "%u's home is %h" testuser@example.com
testuser@example.com's home is /var/mail/testuser@example.com

9 years agodoveadm user: Code cleanup - move field printing to its own function.
Timo Sirainen [Tue, 19 Apr 2016 16:07:51 +0000 (19:07 +0300)] 
doveadm user: Code cleanup - move field printing to its own function.

No functional changes.

9 years agolib-mail: Improved test-message-parser further
Timo Sirainen [Fri, 22 Apr 2016 15:35:04 +0000 (18:35 +0300)] 
lib-mail: Improved test-message-parser further

9 years agolib-mail: Fixed inner MIME part boundary being a prefix of outer boundary.
Timo Sirainen [Fri, 22 Apr 2016 15:28:20 +0000 (18:28 +0300)] 
lib-mail: Fixed inner MIME part boundary being a prefix of outer boundary.

9 years agolib-mail: Fixed handling duplicate boundary prefixes.
Timo Sirainen [Fri, 22 Apr 2016 15:15:44 +0000 (18:15 +0300)] 
lib-mail: Fixed handling duplicate boundary prefixes.

If inner MIME part had the same --boundary prefix as its parent(s) and
the MIME part body started with the inner --boundary prefix, we didn't yet
have it in the list of valid boundaries, so we thought that the outer
boundary was found and the MIME headers were truncated. But due to an extra
bug we still treated it as if it were the inner boundary, except the MIME
part sizes/offsets were set wrong.

This for example fixes a situation where FETCH [1.2.MIME] returns an extra
newline before the actual headers.

9 years agodsync: Fixed assert-crash in rename algorithm
Timo Sirainen [Fri, 22 Apr 2016 13:39:49 +0000 (16:39 +0300)] 
dsync: Fixed assert-crash in rename algorithm

Fixes a crash:
Panic: file dsync-mailbox-tree-sync.c: line 1308 (sync_mailbox_child_dirs): assertion failed: (!node_is_existent(local_node))

9 years agodsync: Determine better when rename-algorithm might have gotten stuck.
Timo Sirainen [Fri, 22 Apr 2016 13:28:56 +0000 (16:28 +0300)] 
dsync: Determine better when rename-algorithm might have gotten stuck.

A hardcoded value of 100 isn't necessarily enough if there are a lot of
mailboxes with a lot of renames. Base the max count on the total number
of mailboxes on both local and remote. And just in case multiple it by 3.
Probably smaller number would be fine too.

9 years agodsync: Fixed crash when rename algorithm thinks it has gone to infinite loop.
Timo Sirainen [Fri, 22 Apr 2016 13:25:00 +0000 (16:25 +0300)] 
dsync: Fixed crash when rename algorithm thinks it has gone to infinite loop.

ctx->brain was NULL, so trying to access it crashed.

9 years agolib-fs: fs-metawrap stat() and get_metadata(): use existing istream if possible
Timo Sirainen [Thu, 21 Apr 2016 14:55:51 +0000 (17:55 +0300)] 
lib-fs: fs-metawrap stat() and get_metadata(): use existing istream if possible

This may reduce reads from parent fs, but it's at least required for the
following commit.

9 years agolib-fs: Added initial fs-metawrap unit test.
Timo Sirainen [Thu, 21 Apr 2016 14:54:54 +0000 (17:54 +0300)] 
lib-fs: Added initial fs-metawrap unit test.

9 years agolib-fs: Added fs-test backend for helping with creation of fs-wrapper unit tests.
Timo Sirainen [Thu, 21 Apr 2016 14:52:44 +0000 (17:52 +0300)] 
lib-fs: Added fs-test backend for helping with creation of fs-wrapper unit tests.

9 years agolib: var_expand() now expands %{nonexistent} to UNSUPPORTED_VARIABLE_nonexistent
Timo Sirainen [Wed, 20 Apr 2016 20:01:45 +0000 (23:01 +0300)] 
lib: var_expand() now expands %{nonexistent} to UNSUPPORTED_VARIABLE_nonexistent

Earlier it was expanded to "nonexistent}", which looked more like a bug.
This change hopefully makes it clear enough to understand when a variable isn't
supported.

9 years agolib-ssl-iostream: Return stacked errors as single combined string.
Timo Sirainen [Thu, 21 Apr 2016 18:45:02 +0000 (21:45 +0300)] 
lib-ssl-iostream: Return stacked errors as single combined string.

Instead of logging stacked errors as separate log lines, which don't provide
any context of what created them.

9 years agolib-http: Include information about number of request attempts and its timing in...
Timo Sirainen [Tue, 19 Apr 2016 13:55:02 +0000 (16:55 +0300)] 
lib-http: Include information about number of request attempts and its timing in response reason.

Because the reason is usually logged as part of the error string, this
causes all of the error messages to include the attempts count and how long
the requests took in total. This should make it easier to understand problems
in error logs.

http_client_request_set_preserve_exact_reason() can be used to disable
modifying the reason string. This may also apply to other reason
modifications that may be done in the future.

9 years agopush-notification: Small optimization - don't lookup uidvalidity for each message.
Timo Sirainen [Fri, 22 Apr 2016 13:00:36 +0000 (16:00 +0300)] 
push-notification: Small optimization - don't lookup uidvalidity for each message.

9 years agoimapc: Added support for imapc_features=modseq
Timo Sirainen [Thu, 21 Apr 2016 21:21:12 +0000 (00:21 +0300)] 
imapc: Added support for imapc_features=modseq

If the remote server supports CONDSTORE or QRESYNC extensions we'll use the
remote's MODSEQ and HIGHESTMODSEQ counts.

There are some situations where the HIGHESTMODSEQ isn't updated exactly
correctly on an open mailbox, so this feature shouldn't be fully relied on.
It was primarily implemented for dsync+imapc support - both for preserving
modseqs and also for HIGHESTMODSEQ lookups.

9 years agolib: Fix to previous istream-timeout commit
Timo Sirainen [Fri, 22 Apr 2016 17:31:02 +0000 (20:31 +0300)] 
lib: Fix to previous istream-timeout commit

The one commit I didn't bother putting through all the automated testing
stages and I of course forgot to even compile after the last change :(

9 years agolib: Improved istream-timeout error message.
Timo Sirainen [Fri, 22 Apr 2016 17:10:34 +0000 (20:10 +0300)] 
lib: Improved istream-timeout error message.

We're supposed to check that timeout isn't triggered after a long-running
code, but it's not perfect. So provide the actual timing information we
saw instead of the expected timeout.

9 years agocassandra: Added support for user and password settings.
Timo Sirainen [Sun, 17 Apr 2016 18:15:30 +0000 (21:15 +0300)] 
cassandra: Added support for user and password settings.

9 years agolib-ssl-iostream: Fixed reporting errors returned by OpenSSL.
Timo Sirainen [Thu, 21 Apr 2016 18:41:23 +0000 (21:41 +0300)] 
lib-ssl-iostream: Fixed reporting errors returned by OpenSSL.

We were always logging all errors as "Stacked error" and then returning
"Unknown error".

9 years agolib-http: client: Implemented means to set request payload buffer rather than an...
Stephan Bosch [Fri, 15 Apr 2016 21:59:24 +0000 (23:59 +0200)] 
lib-http: client: Implemented means to set request payload buffer rather than an input stream.

This is not purely a convenience function: there have been bugs caused by allocating a data input stream from a datastack buffer.
With this function, the buffer is copied to the request pool, so that it is durably allocated while the request exists.
This prevents futher mishaps. The server already has an equivalent function for its response object.

9 years agozlib: Compiling fix to a1630a3b3 - don't return a void function
Timo Sirainen [Wed, 20 Apr 2016 16:34:05 +0000 (19:34 +0300)] 
zlib: Compiling fix to a1630a3b3 - don't return a void function

9 years agolazy-expunge: Fixed using a mailbox (instead of namespace) as lazy_expunge destination.
Timo Sirainen [Wed, 20 Apr 2016 14:10:17 +0000 (17:10 +0300)] 
lazy-expunge: Fixed using a mailbox (instead of namespace) as lazy_expunge destination.

The initial implementation in f2d7ae020bda762f78e8e639a69fb129230cbb7d was
completely broken.

9 years agolib-index: If opening a cache file fails, try again later.
Timo Sirainen [Tue, 19 Apr 2016 23:23:31 +0000 (02:23 +0300)] 
lib-index: If opening a cache file fails, try again later.

The previous code would never retry opening the cache file within the same
session.

9 years agolib-index: Fixed calling mail_cache_open_and_verify() on an already open cache.
Timo Sirainen [Tue, 19 Apr 2016 21:29:49 +0000 (00:29 +0300)] 
lib-index: Fixed calling mail_cache_open_and_verify() on an already open cache.

This was done at least by index_index_rebuild_init().

Either the currently open cache->fd was leaked, or if the cache file open()
failed we left the cache in an inconsistent state where cache->fd == -1, but
cache->hdr != NULL, so it caused MAIL_CACHE_IS_UNUSABLE() to also be TRUE. This
could have ended up in an assert:

Panic: file mail-index-lock.c: line 31 (mail_index_lock_fd): assertion failed: (MAIL_INDEX_IS_IN_MEMORY(index))

9 years agozlib plugin: Make sure we don't keep mail istream referenced after mail is closed.
Timo Sirainen [Tue, 19 Apr 2016 23:47:13 +0000 (02:47 +0300)] 
zlib plugin: Make sure we don't keep mail istream referenced after mail is closed.

9 years agolazy-expunge: Allow lazy_expunge setting to point to a mailbox in any namespace.
Timo Sirainen [Thu, 14 Apr 2016 16:04:28 +0000 (19:04 +0300)] 
lazy-expunge: Allow lazy_expunge setting to point to a mailbox in any namespace.

This way we can use an existing namespace without having to create a new one
just for a single lazy_expunge mailbox.

9 years agolib: Implement utc_mktime() with timegm() if it exists.
Timo Sirainen [Mon, 18 Apr 2016 13:40:49 +0000 (16:40 +0300)] 
lib: Implement utc_mktime() with timegm() if it exists.

It should be more efficient than repeatedly calling gmtime() many times.

9 years agoauth: Added passdb/userdb { auth_verbose } setting.
Timo Sirainen [Tue, 19 Apr 2016 08:55:00 +0000 (11:55 +0300)] 
auth: Added passdb/userdb { auth_verbose } setting.

If this is explicitly set to yes or no, it overrides the global auth_verbose
setting. However, auth_debug=yes overrides all of the auth_verbose settings.

9 years agolib-storage: Added MAIL_STORAGE_CLASS_FLAG_NO_LIST_DELETES and MAILBOX_LIST_FLAG_NO_D...
Timo Sirainen [Tue, 19 Apr 2016 13:59:48 +0000 (16:59 +0300)] 
lib-storage: Added MAIL_STORAGE_CLASS_FLAG_NO_LIST_DELETES and MAILBOX_LIST_FLAG_NO_DELETES

9 years agostats plugin: stats_notify_path can now specify path to the stats-mail FIFO
Timo Sirainen [Fri, 15 Apr 2016 11:51:42 +0000 (14:51 +0300)] 
stats plugin: stats_notify_path can now specify path to the stats-mail FIFO

9 years agolib-stats: Handle better write() to stats process failing with EAGAIN
Timo Sirainen [Fri, 15 Apr 2016 12:01:20 +0000 (15:01 +0300)] 
lib-stats: Handle better write() to stats process failing with EAGAIN

It only means that the stats process is too busy and the FIFO is filled up.
Retrying the write later should work. We also don't want to log too much about
the same warning, so do it only once per 30 seconds.

9 years agolib-http: server: Prevent aborting finished or already aborted requests again.
Stephan Bosch [Wed, 13 Apr 2016 21:12:00 +0000 (23:12 +0200)] 
lib-http: server: Prevent aborting finished or already aborted requests again.

9 years agoconfigure: Fixed building lib-ldap / dict-ldap --with-ldap=plugin
Timo Sirainen [Wed, 13 Apr 2016 14:19:52 +0000 (17:19 +0300)] 
configure: Fixed building lib-ldap / dict-ldap --with-ldap=plugin

9 years agolib-dict: Don't build dict-ldap if --with-ldap=no
Timo Sirainen [Wed, 13 Apr 2016 14:17:53 +0000 (17:17 +0300)] 
lib-dict: Don't build dict-ldap if --with-ldap=no

9 years agodoveconf: Improved the warning message about global setting not overriding a filter
Timo Sirainen [Wed, 13 Apr 2016 10:47:51 +0000 (13:47 +0300)] 
doveconf: Improved the warning message about global setting not overriding a filter

9 years agolib-dict: Disable debug log unless debug enabled
Aki Tuomi [Wed, 13 Apr 2016 08:22:12 +0000 (11:22 +0300)] 
lib-dict: Disable debug log unless debug enabled

9 years agolib-ldap: Allow disabling of TLS
Aki Tuomi [Wed, 13 Apr 2016 08:01:29 +0000 (11:01 +0300)] 
lib-ldap: Allow disabling of TLS

9 years agolib-dict: Add option to enforce SSL
Aki Tuomi [Mon, 11 Apr 2016 19:56:40 +0000 (22:56 +0300)] 
lib-dict: Add option to enforce SSL

9 years agolib-ldap: Hard fail when SSL is required
Aki Tuomi [Mon, 11 Apr 2016 19:56:37 +0000 (22:56 +0300)] 
lib-ldap: Hard fail when SSL is required

9 years agolib-ldap: Allow and warn insecure LDAP connection
Aki Tuomi [Mon, 11 Apr 2016 17:44:41 +0000 (20:44 +0300)] 
lib-ldap: Allow and warn insecure LDAP connection

9 years agolib-ldap: Remove callback from connection_connect
Aki Tuomi [Mon, 11 Apr 2016 17:32:55 +0000 (20:32 +0300)] 
lib-ldap: Remove callback from connection_connect

9 years agolib-dict: Reuse LDAP connections
Aki Tuomi [Mon, 11 Apr 2016 14:29:35 +0000 (17:29 +0300)] 
lib-dict: Reuse LDAP connections

9 years agolib-ldap: Max idle time is seconds
Aki Tuomi [Mon, 11 Apr 2016 14:29:02 +0000 (17:29 +0300)] 
lib-ldap: Max idle time is seconds

9 years agolib-ldap: Do not call NULL callback
Aki Tuomi [Mon, 11 Apr 2016 14:27:31 +0000 (17:27 +0300)] 
lib-ldap: Do not call NULL callback

9 years agolib: Moved enum iostream_rawlog_flags to public iostream-rawlog.h
Timo Sirainen [Tue, 12 Apr 2016 18:22:48 +0000 (21:22 +0300)] 
lib: Moved enum iostream_rawlog_flags to public iostream-rawlog.h

This allows using [io]stream-rawlog.h APIs directly.

9 years agolib: Added ostream-null
Timo Sirainen [Tue, 12 Apr 2016 17:00:51 +0000 (20:00 +0300)] 
lib: Added ostream-null

9 years agolib-storage: Fixed crash when using SEARCH INTHREAD
Timo Sirainen [Tue, 12 Apr 2016 13:48:34 +0000 (16:48 +0300)] 
lib-storage: Fixed crash when using SEARCH INTHREAD

mail_search_args_init() -> mail_search_args_simplify() -> .. ->
mail_search_arg_one_equals(), which assumed SEARCH_INTHREAD was already
initialized.

9 years agodoveconf: Log a warning if a global setting is updated after it was already set insid...
Timo Sirainen [Sun, 10 Apr 2016 11:41:28 +0000 (14:41 +0300)] 
doveconf: Log a warning if a global setting is updated after it was already set inside a filter

For example:

protocol imap {
  mail_plugins = $mail_plugins imap_quota
}
mail_plugins = $mail_plugins quota

Will result in:

doveconf: Warning: dovecot.conf line 4: Global setting mail_plugins won't
change the setting inside an earlier filter at dovecot.conf line 2

9 years agodoveconf, config: Free all memory at deinit
Timo Sirainen [Sun, 10 Apr 2016 11:39:22 +0000 (14:39 +0300)] 
doveconf, config: Free all memory at deinit

9 years agoimapc: Mark most of the commands retriable.
Timo Sirainen [Wed, 6 Apr 2016 11:45:01 +0000 (14:45 +0300)] 
imapc: Mark most of the commands retriable.

9 years agoimapc: If root separator lookup fails, fail all further lookups.
Timo Sirainen [Wed, 6 Apr 2016 11:44:00 +0000 (14:44 +0300)] 
imapc: If root separator lookup fails, fail all further lookups.

We already returned a potentially wrong separator (since there's no way to
return error), so we don't want to continue and possibly make things worse.

9 years agoimapc: Added missing error handling to subscriptions list refreshing.
Timo Sirainen [Wed, 6 Apr 2016 11:43:02 +0000 (14:43 +0300)] 
imapc: Added missing error handling to subscriptions list refreshing.

9 years agoimapc: Fixed mailbox_exists() error handling.
Timo Sirainen [Wed, 6 Apr 2016 11:41:16 +0000 (14:41 +0300)] 
imapc: Fixed mailbox_exists() error handling.

9 years agoimapc: Support retrying after connect() failure.
Timo Sirainen [Wed, 6 Apr 2016 11:24:21 +0000 (14:24 +0300)] 
imapc: Support retrying after connect() failure.

9 years agoimapc: Support retrying after connect/authentication timeouts.
Timo Sirainen [Wed, 6 Apr 2016 11:17:02 +0000 (14:17 +0300)] 
imapc: Support retrying after connect/authentication timeouts.

9 years agoimapc: Support retrying for non-mailbox commands.
Timo Sirainen [Wed, 6 Apr 2016 11:16:13 +0000 (14:16 +0300)] 
imapc: Support retrying for non-mailbox commands.

9 years agoimapc: Prepare for non-mailbox command retrying: Set reconnect_command_count earlier
Timo Sirainen [Wed, 6 Apr 2016 11:12:25 +0000 (14:12 +0300)] 
imapc: Prepare for non-mailbox command retrying: Set reconnect_command_count earlier

This probably doesn't fix itself anything yet, but is needed for the
following changes.

9 years agoimapc: Fixed checking of whether same IMAP command keeps crashing server.
Timo Sirainen [Wed, 6 Apr 2016 11:09:13 +0000 (14:09 +0300)] 
imapc: Fixed checking of whether same IMAP command keeps crashing server.

reconnect_command_count was counting only the post-login commands, but we
were decreasing it also for pre-login commands. This caused it to shrink to
0 too early.

9 years agoimapc: Code cleanup - imapc_connection_reconnect() is now always called when reconnec...
Timo Sirainen [Wed, 6 Apr 2016 11:05:26 +0000 (14:05 +0300)] 
imapc: Code cleanup - imapc_connection_reconnect() is now always called when reconnect is ok.

9 years agoimapc: Code cleanup - Use a common function for checking/logging if we want to reconn...
Timo Sirainen [Wed, 6 Apr 2016 11:03:20 +0000 (14:03 +0300)] 
imapc: Code cleanup - Use a common function for checking/logging if we want to reconnect or disconnect

9 years agolib-storage: Fixed error handling for mailbox_list_iter_init_namespaces()
Timo Sirainen [Wed, 6 Apr 2016 10:52:24 +0000 (13:52 +0300)] 
lib-storage: Fixed error handling for mailbox_list_iter_init_namespaces()

If iteration for the first namespace failed, we tried to copy the error
string to error_list, which was the same first namespace's list. This caused
the error string to be freed while it was being copied, so the end result
was that the error became either an empty or garbage string.

9 years agodsync: Don't export header hashes if remote mailbox is empty.
Timo Sirainen [Wed, 6 Apr 2016 09:41:38 +0000 (12:41 +0300)] 
dsync: Don't export header hashes if remote mailbox is empty.

This avoids doing a lot of work of reading through all mails' headers and
hashing them, when the hashes aren't actually going to be used for anything.

9 years agolib-http: server: Fixed bug in request reference counting caused by earlier fix ...
Stephan Bosch [Tue, 12 Apr 2016 09:42:38 +0000 (11:42 +0200)] 
lib-http: server: Fixed bug in request reference counting caused by earlier fix (390b600a6f7fdb4ccc65950527ee30129f49a6ac).

The earlier change erroneously dropped two lines that unreferenced the request object after calling the callback.

9 years agolib-master: Fixed assert-crash when HAProxy aborts connections.
Timo Sirainen [Tue, 12 Apr 2016 07:49:50 +0000 (10:49 +0300)] 
lib-master: Fixed assert-crash when HAProxy aborts connections.

close() was called before io_remove(), which resulted in:

Panic: epoll_ctl(del, 14) failed: Bad file descriptor

9 years agodict-ldap: Compiler warning fix
Timo Sirainen [Mon, 11 Apr 2016 09:24:59 +0000 (12:24 +0300)] 
dict-ldap: Compiler warning fix

9 years agolib-dict: Add ldap driver
Aki Tuomi [Mon, 11 Apr 2016 06:40:22 +0000 (09:40 +0300)] 
lib-dict: Add ldap driver

9 years agoconfigure: Add lib-ldap
Aki Tuomi [Mon, 11 Apr 2016 06:38:27 +0000 (09:38 +0300)] 
configure: Add lib-ldap

9 years agolib-ldap: Add lib-ldap implementation
Aki Tuomi [Mon, 11 Apr 2016 06:37:39 +0000 (09:37 +0300)] 
lib-ldap: Add lib-ldap implementation

9 years agolib-master: Fixed memory leaks when failing to read settings.
Timo Sirainen [Sun, 10 Apr 2016 11:57:48 +0000 (14:57 +0300)] 
lib-master: Fixed memory leaks when failing to read settings.

9 years agovirtual plugin: struct mail_vfuncs.close() wasn't implemented.
Timo Sirainen [Thu, 7 Apr 2016 14:50:28 +0000 (17:50 +0300)] 
virtual plugin: struct mail_vfuncs.close() wasn't implemented.

This wasn't a problem normally, because the core code wouldn't try to call
this. It became a problem only after other plugins were trying to call it.

9 years agolib-master: Preserve LOG_STDERR_TIMESTAMP environment through doveconf exec.
Timo Sirainen [Thu, 7 Apr 2016 13:35:28 +0000 (16:35 +0300)] 
lib-master: Preserve LOG_STDERR_TIMESTAMP environment through doveconf exec.

This should be needed only for standalone programs, so don't bother trying
to preserve it otherwise.

9 years agolmtp: Use separate session ID suffixes for each RCPT TO delivery.
Timo Sirainen [Tue, 5 Apr 2016 17:14:15 +0000 (20:14 +0300)] 
lmtp: Use separate session ID suffixes for each RCPT TO delivery.

Otherwise each delivery will use the same session ID when talking to stats
process, which results in errors like:

Error: stats: FIFO input error: CONNECT: Duplicate session ID ME3ZHCi+A1dUDQAAvAUe3g for user foobar service lmtp
Warning: stats: Couldn't find session ID: ME3ZHCi+A1dUDQAAvAUe3g

(There was a DISCONNECT for the session ID between these two log lines.)

9 years agolib-storage: Changed separator between session_id_prefix and unique part to be ':'
Timo Sirainen [Tue, 5 Apr 2016 17:10:53 +0000 (20:10 +0300)] 
lib-storage: Changed separator between session_id_prefix and unique part to be ':'

Although '-' wasn't used by default either, it's much more likely that
custom session IDs might contain it. ':' is hopefully less likely to be used.
This allows log parsers that actually want to find out the original session's
all log lines to cut out everything after the initial ':'.

9 years agolmtp: Changed default LMTP proxy timeout to 125 seconds.
Timo Sirainen [Wed, 6 Apr 2016 19:43:52 +0000 (22:43 +0300)] 
lmtp: Changed default LMTP proxy timeout to 125 seconds.

The main problem with LMTP proxy timing out too early is that it causes
duplicates if the backend actually finishes the mail delivery.

The 30 seconds is bad, because there are various timeouts in backend set
to 30 seconds also. 125 seconds is hopefully large enough to hit most of
the 2 minute timeouts and we'll have a few extra seconds left to see the
failure.

9 years agodoveadm sync: -R parameter shouldn't switch to "doveadm backup -R" behavior.
Timo Sirainen [Wed, 6 Apr 2016 19:12:54 +0000 (22:12 +0300)] 
doveadm sync: -R parameter shouldn't switch to "doveadm backup -R" behavior.

Just ignore the -R parameter for doveadm sync, unless -1 parameter is also
used. Alternatively we could also fail the command, but maybe that's
unnecessary extra work.

9 years agodoveadm: Reverted 7a3b52b8f - doveadm sync -1 -R is useful.
Timo Sirainen [Wed, 6 Apr 2016 19:08:14 +0000 (22:08 +0300)] 
doveadm: Reverted 7a3b52b8f - doveadm sync -1 -R is useful.

9 years agodict-redis: When timeout was reached, we didn't actually stop but just continued...
Timo Sirainen [Wed, 6 Apr 2016 17:19:04 +0000 (20:19 +0300)] 
dict-redis: When timeout was reached, we didn't actually stop but just continued waiting.