]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
9 years agolazy-expunge: Don't fail expunge if mail was already expunged.
Timo Sirainen [Fri, 27 May 2016 18:34:26 +0000 (21:34 +0300)] 
lazy-expunge: Don't fail expunge if mail was already expunged.

9 years agolazy-expunge: Fixed error logging.
Timo Sirainen [Fri, 27 May 2016 18:32:23 +0000 (21:32 +0300)] 
lazy-expunge: Fixed error logging.

9 years agodsync: Debug logging improvement.
Timo Sirainen [Fri, 27 May 2016 15:30:01 +0000 (18:30 +0300)] 
dsync: Debug logging improvement.

9 years agolib-fs: Fix to previous fs-metawrap commit
Timo Sirainen [Fri, 27 May 2016 11:38:17 +0000 (14:38 +0300)] 
lib-fs: Fix to previous fs-metawrap commit

Argh. I was sure I compiled this before pushing it.

9 years agolib-fs: fs-metawrap: Improved error logging on corrupted files.
Timo Sirainen [Fri, 27 May 2016 11:33:47 +0000 (14:33 +0300)] 
lib-fs: fs-metawrap: Improved error logging on corrupted files.

9 years agodoveadm: Fixed sending command -parameters to doveadm-server
Timo Sirainen [Thu, 26 May 2016 16:13:40 +0000 (19:13 +0300)] 
doveadm: Fixed sending command -parameters to doveadm-server

9 years agosdbox: Make sure we don't crash when altmove-flag is set but alt path is missing.
Timo Sirainen [Thu, 26 May 2016 18:40:30 +0000 (21:40 +0300)] 
sdbox: Make sure we don't crash when altmove-flag is set but alt path is missing.

9 years agodict-sql: Fixed memory leak
Timo Sirainen [Thu, 26 May 2016 15:25:06 +0000 (18:25 +0300)] 
dict-sql: Fixed memory leak

9 years agocassandra: Added metrics=path connect setting.
Timo Sirainen [Wed, 25 May 2016 19:29:47 +0000 (22:29 +0300)] 
cassandra: Added metrics=path connect setting.

Cassandra's metrics are written to the path in JSON format. It can be a file
or a FIFO. The path supports expanding the standard global %variables, such
as %{pid}

9 years agodict: Added missing main.h from previous commit
Timo Sirainen [Wed, 25 May 2016 19:08:04 +0000 (22:08 +0300)] 
dict: Added missing main.h from previous commit

9 years agodict: Show command statistics in process title.
Timo Sirainen [Wed, 25 May 2016 17:00:01 +0000 (20:00 +0300)] 
dict: Show command statistics in process title.

9 years agolib: Fixed crashes in timing_get_median() and timing_get_95th()
Timo Sirainen [Wed, 25 May 2016 16:56:47 +0000 (19:56 +0300)] 
lib: Fixed crashes in timing_get_median() and timing_get_95th()

These were writing outside allocated memory. They weren't actually used
anywhere yet though.

9 years agolib: Added timing_reset()
Timo Sirainen [Wed, 25 May 2016 16:45:58 +0000 (19:45 +0300)] 
lib: Added timing_reset()

9 years agodsync: race condition where done/finish is received after one side has closed
J. Nick Koston [Fri, 20 May 2016 00:15:49 +0000 (19:15 -0500)] 
dsync: race condition where done/finish is received after one side has closed

We do not tell the remote we are closing if they have
already told us because they close the
connection after sending ITEM_FINISH or ITEM_DONE and will
not be ever receive anything else from us unless
it just happens to get combined into the same packet
as a previous response and is already in the buffer.

9 years agolib-stats: Allow unregistering + re-registering stats.
Timo Sirainen [Tue, 24 May 2016 12:52:37 +0000 (15:52 +0300)] 
lib-stats: Allow unregistering + re-registering stats.

Fixes:
Panic: stats_register() called after stats_alloc_size() was already called - this will break existing allocations

This could have happened with doveadm HTTP API when using multiple commands
in same HTTP connection.

9 years agolib-index: Fixed assert-crash caused by previous cache compression change.
Timo Sirainen [Mon, 23 May 2016 20:24:31 +0000 (23:24 +0300)] 
lib-index: Fixed assert-crash caused by previous cache compression change.

We can't call mail_cache_map() when cache file isn't open or we'll crash:

Panic: file mail-cache.c: line 468 (mail_cache_map): assertion failed: (cache->need_compress_file_seq != 0 || MAIL_INDEX_IS_IN_MEMORY(cache->index))

9 years agolib-index: Make sure cache compression doesn't clear the file unneededly.
Timo Sirainen [Mon, 23 May 2016 15:46:09 +0000 (18:46 +0300)] 
lib-index: Make sure cache compression doesn't clear the file unneededly.

This probably never happened with current code, except when the cache file
was already broken.

mail_cache_compress() unmapped cache when map_with_read==TRUE, but we never
mapped it back. This would cause cache copying code to think cache was
unusable and not copy anything.

9 years agolib-ldap: Use ldap_unbind_ext() instead of ldap_destroy()
Timo Sirainen [Mon, 23 May 2016 10:12:41 +0000 (13:12 +0300)] 
lib-ldap: Use ldap_unbind_ext() instead of ldap_destroy()

This allows it to compile with older LDAP libraries. Their behavior (at least
in OpenLDAP) is identical as long as LDAP_OPT_CLIENT_CONTROLS haven't been
changed, which we haven't.

9 years agolib-ldap: Support libldap without LDAP_OPT_X_TLS_NEWCTX.
Timo Sirainen [Mon, 23 May 2016 10:08:20 +0000 (13:08 +0300)] 
lib-ldap: Support libldap without LDAP_OPT_X_TLS_NEWCTX.

9 years agodoveadm backup: Fixed unnecessary mailbox deletion.
Timo Sirainen [Fri, 20 May 2016 12:55:52 +0000 (15:55 +0300)] 
doveadm backup: Fixed unnecessary mailbox deletion.

Broken by 79490ec1a. The idea is to delete the mailbox early to avoid
unnecessary work, but we deleted it too early. If the last mail(s) were
deleted instead of just expunging them we deleted the whole mailbox.

9 years agolib-mail: Fixed istream-header-filter calling callback(hdr=NULL)
Timo Sirainen [Thu, 19 May 2016 20:19:29 +0000 (23:19 +0300)] 
lib-mail: Fixed istream-header-filter calling callback(hdr=NULL)

It should do it on the following parsings as well if there were any
callbacks that were called, or if the hdr==NULL callback added any
headers. This is important because the hdr==NULL call could do some
cleanups.

9 years agoconfig: fix possible out-of-bound access in parsing function
Baofeng Wang [Mon, 16 May 2016 08:34:05 +0000 (11:34 +0300)] 
config: fix possible out-of-bound access in parsing function

Add low-bound check when decreasing string pointer from tail.

9 years agolib-fs: istream-metawrap can't have a readable fd currently
Timo Sirainen [Wed, 18 May 2016 19:26:50 +0000 (22:26 +0300)] 
lib-fs: istream-metawrap can't have a readable fd currently

9 years agolib-mail: istream-header-filter - Don't return -2 too early
Timo Sirainen [Wed, 18 May 2016 11:56:59 +0000 (14:56 +0300)] 
lib-mail: istream-header-filter - Don't return -2 too early

We returned -2 after we already added the data to the buffer. We should
have returned -2 only on the next read() call if nothing was skipped.

9 years agolib-http: Fixed checking if istream or ostream needs waiting.
Timo Sirainen [Wed, 18 May 2016 15:51:55 +0000 (18:51 +0300)] 
lib-http: Fixed checking if istream or ostream needs waiting.

9 years agolib: If epoll_ctl() fails, panic instead of just fatal.
Timo Sirainen [Wed, 18 May 2016 15:48:27 +0000 (18:48 +0300)] 
lib: If epoll_ctl() fails, panic instead of just fatal.

This makes it easier to fix such bugs.

9 years agodoveadm-mailbox-delete: Restore recursive parameter
Aki Tuomi [Wed, 18 May 2016 06:33:15 +0000 (09:33 +0300)] 
doveadm-mailbox-delete: Restore recursive parameter

9 years agodict: Fix crash when no dictionaries defined
Aki Tuomi [Wed, 18 May 2016 06:29:04 +0000 (09:29 +0300)] 
dict: Fix crash when no dictionaries defined

9 years agoimap: Include sync timing information in tagged command replies.
Timo Sirainen [Mon, 16 May 2016 21:00:43 +0000 (00:00 +0300)] 
imap: Include sync timing information in tagged command replies.
Show it only when it's larger than 0 to avoid unnecessary output.

9 years agodoveadm-mailbox: Add update subcommand
Aki Tuomi [Tue, 17 May 2016 20:31:29 +0000 (23:31 +0300)] 
doveadm-mailbox: Add update subcommand

9 years agolib-ldap: Fixed assert-crash when killing LDAP connection.
Timo Sirainen [Thu, 12 May 2016 21:45:34 +0000 (17:45 -0400)] 
lib-ldap: Fixed assert-crash when killing LDAP connection.

libldap may have already closed the fd, so with epoll io_remove() would
try to remove it and crash with:

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

9 years agolib: istream - provide alternatives to i_stream_read_data()
Phil Carmody [Mon, 8 Feb 2016 16:32:10 +0000 (18:32 +0200)] 
lib: istream - provide alternatives to i_stream_read_data()

Providing as a parameter the number of bytes that you would be
disappointed to receive was confusing compared to providing the
number that you would be happy to receive. This lets us get rid
of all the '-1's in the callers. The callers which used 0 as
a parameter were so common that it's worth providing a separate
API just to simplify their demands.

Deep down, these are still the same underlying function. Currently
we route the new API through the old one, but eventually, the old
API can be routed through the new one, so that the friendlier
interface has the simplest implementation.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
9 years agolib-ldap: Do not create new context and lose settings
Aki Tuomi [Sun, 15 May 2016 14:25:17 +0000 (17:25 +0300)] 
lib-ldap: Do not create new context and lose settings

9 years agolib-ldap: Compiling fix - don't pass through void return
Timo Sirainen [Sat, 14 May 2016 22:17:18 +0000 (01:17 +0300)] 
lib-ldap: Compiling fix - don't pass through void return

9 years agolib-sql: Memory leak fix when freeing sql dbs from cache
Timo Sirainen [Wed, 11 May 2016 20:57:33 +0000 (16:57 -0400)] 
lib-sql: Memory leak fix when freeing sql dbs from cache

Normally happened only at deinit.

9 years agodict-redis: Fixed memory leak in async commit
Timo Sirainen [Fri, 6 May 2016 10:42:11 +0000 (13:42 +0300)] 
dict-redis: Fixed memory leak in async commit

9 years agoimap: Set command start timestamps earlier.
Timo Sirainen [Fri, 13 May 2016 18:22:40 +0000 (14:22 -0400)] 
imap: Set command start timestamps earlier.

Previously timing statistics in taglines weren't shown commands that didn't
read any parameters.

Also the timings now include the time speng reading command parameters from
client. For example:

a list "" {1}
+ OK
%
* LIST (\HasNoChildren) "/" INBOX
a OK List completed (0.001 + 1.214 secs).

9 years agolib: Fixed istream_seekable.stat() to return correct size.
Timo Sirainen [Fri, 13 May 2016 17:35:50 +0000 (13:35 -0400)] 
lib: Fixed istream_seekable.stat() to return correct size.

It was supposed to read until end of the stream, but it did it only when
stat() was called while stream was still fully in memory.

9 years agolib-fs: Make sure fs-metawrap catches all write errors.
Timo Sirainen [Fri, 13 May 2016 13:56:08 +0000 (09:56 -0400)] 
lib-fs: Make sure fs-metawrap catches all write errors.

The full istream may not have been written in case ostream only partially
wrote the data (e.g. out of disk space?)

9 years agolib-fs: If fs-metawrap sees truncated header, it should return error.
Timo Sirainen [Fri, 13 May 2016 13:48:13 +0000 (09:48 -0400)] 
lib-fs: If fs-metawrap sees truncated header, it should return error.

9 years agolib: Fixed potential crash in i_stream_stat() failures.
Timo Sirainen [Fri, 13 May 2016 13:23:52 +0000 (09:23 -0400)] 
lib: Fixed potential crash in i_stream_stat() failures.

We shouldn't have been copying parent's stream_errno here. Especially
because the parent can be NULL.

9 years agolib-fs: Added FS_PROPERTY_FASTCOPY_CHANGED_METADATA
Timo Sirainen [Thu, 12 May 2016 19:10:47 +0000 (15:10 -0400)] 
lib-fs: Added FS_PROPERTY_FASTCOPY_CHANGED_METADATA

9 years agolib-fs: Allow multiple fs_read_stream() calls to seekable istreams.
Timo Sirainen [Thu, 28 Apr 2016 09:45:01 +0000 (12:45 +0300)] 
lib-fs: Allow multiple fs_read_stream() calls to seekable istreams.

This fixes for example calling fs_default_copy() for an istream which was
already opened:

Panic: file fs-api.c: line 528 (fs_read_stream): assertion failed: (!file->istream_open)

9 years agolib-fs: Fixed multiple concurrent fs_read_stream() calls
Timo Sirainen [Thu, 28 Apr 2016 09:47:02 +0000 (12:47 +0300)] 
lib-fs: Fixed multiple concurrent fs_read_stream() calls

Return a new limit-istream, so each istream can have its own independent
offset.

9 years agolib-http: Queue's delayed timeout handler wasn't removed after work was done.
Timo Sirainen [Thu, 12 May 2016 12:09:56 +0000 (08:09 -0400)] 
lib-http: Queue's delayed timeout handler wasn't removed after work was done.

9 years agodict-sql: Cache reading settings files.
Timo Sirainen [Wed, 11 May 2016 20:58:59 +0000 (16:58 -0400)] 
dict-sql: Cache reading settings files.

The settings were read for every dict init, which was done for every new
dict connection. This was using a lot of CPU. There are usually only a
couple dict-sql settings files, so we cache all of the ones we read.

9 years agolib-fs: Minor code cleanup
Timo Sirainen [Thu, 12 May 2016 11:24:39 +0000 (07:24 -0400)] 
lib-fs: Minor code cleanup

9 years agolib-fs: Set fs error on fs_write_stream_abort()
Timo Sirainen [Thu, 12 May 2016 11:23:51 +0000 (07:23 -0400)] 
lib-fs: Set fs error on fs_write_stream_abort()

Probably would be nice for fs_write_stream_abort() to have an error string
parameter, which could be used instead of this generic error.

9 years agolib-fs: Added asserts to make sure async writes are finished before close
Timo Sirainen [Thu, 12 May 2016 11:23:04 +0000 (07:23 -0400)] 
lib-fs: Added asserts to make sure async writes are finished before close

9 years agofs-metawrap: Minor code cleanup
Timo Sirainen [Thu, 12 May 2016 11:21:38 +0000 (07:21 -0400)] 
fs-metawrap: Minor code cleanup

temp_output==NULL, so these calls are equal.

9 years agofs-metawrap: Propagate fs_write_stream_abort() to parent always
Timo Sirainen [Thu, 12 May 2016 11:18:49 +0000 (07:18 -0400)] 
fs-metawrap: Propagate fs_write_stream_abort() to parent always

It needed to be done also when temp_output==NULL, because we had already
started sending it to parent, but async parent wasn't being finished.

9 years agofs-randomfail: Set fs error always when injecting failure.
Timo Sirainen [Thu, 12 May 2016 11:15:41 +0000 (07:15 -0400)] 
fs-randomfail: Set fs error always when injecting failure.

It was done in some places, but not everywhere.

9 years agolib-ldap: Reverted previous commit for now.
Timo Sirainen [Tue, 10 May 2016 21:35:43 +0000 (17:35 -0400)] 
lib-ldap: Reverted previous commit for now.

We don't have libdovecot built at at this stage. But we can't build it
earlier, because it needs lib-dict-extra, which needs lib-ldap. So we have
cyclical dependencies now.

9 years agolib-ldap: Add libdovecot dependency to libdovecot-ldap
Timo Sirainen [Tue, 10 May 2016 21:25:20 +0000 (17:25 -0400)] 
lib-ldap: Add libdovecot dependency to libdovecot-ldap

Required for linking to work on OSX.

9 years agolib: Fixed crash when closing a failed istream-concat
Timo Sirainen [Tue, 10 May 2016 20:22:23 +0000 (16:22 -0400)] 
lib: Fixed crash when closing a failed istream-concat

i_stream_concat_seek() could have set cur_input==NULL and we still
attempted to seek the cur_input at close time.

9 years agolib-index: "first saved UID of the day" wasn't updated right always.
Timo Sirainen [Tue, 10 May 2016 14:42:33 +0000 (10:42 -0400)] 
lib-index: "first saved UID of the day" wasn't updated right always.

It was using the UID of the first append. But it may not have been the
lowest UID. Do this after the appends are first sorted by their UID.

9 years agoAdded liblzma bug to Valgrind suppressions file.
Stephan Bosch [Mon, 9 May 2016 22:42:51 +0000 (00:42 +0200)] 
Added liblzma bug to Valgrind suppressions file.

It caused `make test` to fail with valgrind.
Occurred at least for Debian Jessie with liblzma package version 5.1.1alpha+20120614-2+b3.

9 years agoREADME: Added missing supported RFCs
Timo Sirainen [Mon, 9 May 2016 05:04:39 +0000 (08:04 +0300)] 
README: Added missing supported RFCs

9 years agolib-http: If connect fails, include attempt count and total time in error.
Timo Sirainen [Thu, 5 May 2016 21:17:31 +0000 (00:17 +0300)] 
lib-http: If connect fails, include attempt count and total time in error.

This will produce errors such as:
9002 connect(1.2.3.4:801) failed: Connection timed out in 1.001 secs (4 attempts in 4.706 secs)

9 years agodict-client: Added idle_msecs=<n> parameter
Timo Sirainen [Fri, 6 May 2016 14:35:10 +0000 (17:35 +0300)] 
dict-client: Added idle_msecs=<n> parameter

This can be useful when connected to dict-async server where extra idling
connections don't matter so much as with blocking dict servers.

9 years agoimap: Avoid assert-crash after a failed mailbox sync.
Timo Sirainen [Fri, 6 May 2016 19:24:20 +0000 (22:24 +0300)] 
imap: Avoid assert-crash after a failed mailbox sync.

We didn't close the mailbox and we didn't update message counts, so we could
have crashed with:

Panic: Message count decreased

9 years agostats: Handle getrusage() errors better
Timo Sirainen [Thu, 5 May 2016 18:26:37 +0000 (21:26 +0300)] 
stats: Handle getrusage() errors better

I'm not aware of these errors actually happening anywhere, but its
error handling wouldn't have been correct if previous getrusage() calls
had succeeded. Now if it fails, log an error once and just keep on using
the last working rusage.

9 years agostats: Work around shrinking system CPU usage
Timo Sirainen [Thu, 5 May 2016 18:23:17 +0000 (21:23 +0300)] 
stats: Work around shrinking system CPU usage

Happening at least in Debian's Linux kernel 4.3.0-1-amd64.

getrusage() may returns ru_stime = 4000 or 8000, but later it drops to 0.
We'll just work around this by switching to the previous working ru_stime.

This fixes errors like:
Error: stats: session stats shrank: sys_cpu 0.0 < 0.4000

9 years agodict-ldap: Properly duplicate result
Aki Tuomi [Fri, 6 May 2016 09:51:28 +0000 (12:51 +0300)] 
dict-ldap: Properly duplicate result

9 years agoauth: Makefile dependency fix
Timo Sirainen [Tue, 3 May 2016 14:43:00 +0000 (17:43 +0300)] 
auth: Makefile dependency fix

Hopefully fixes:
mv: cannot stat '.deps/auth-stats.Tpo': No such file or directory

9 years agolib: Added i_stream_get_disconnect_reason()
Timo Sirainen [Fri, 6 May 2016 11:34:57 +0000 (14:34 +0300)] 
lib: Added i_stream_get_disconnect_reason()

9 years agolib: Improved connection_disconnect_reason()
Timo Sirainen [Fri, 6 May 2016 11:22:29 +0000 (14:22 +0300)] 
lib: Improved connection_disconnect_reason()

9 years agolazy-expunge: Handle mailbox create race conditions.
Timo Sirainen [Thu, 5 May 2016 15:10:46 +0000 (18:10 +0300)] 
lazy-expunge: Handle mailbox create race conditions.

Don't log an error if another process just created the lazy-expunge mailbox.

9 years agolib-fs: Fixes to stats count tracking
Timo Sirainen [Thu, 5 May 2016 13:15:15 +0000 (16:15 +0300)] 
lib-fs: Fixes to stats count tracking

fs_exists(), fs_copy(), fs_rename() and fs_delete() could have increased the
count multiple times on async operations.

9 years agostats: Fixed ADD-USER stats tracking (auth stats)
Timo Sirainen [Thu, 5 May 2016 11:58:46 +0000 (14:58 +0300)] 
stats: Fixed ADD-USER stats tracking (auth stats)

9 years agolib-fs: fs-metawrap stat() error handling improvement.
Timo Sirainen [Wed, 4 May 2016 15:34:59 +0000 (18:34 +0300)] 
lib-fs: fs-metawrap stat() error handling improvement.

We can't just treat i_stream_get_size() returning 0 as the reason being
istream is async and not fully read. It might be, but it might also be
because of other reasons. And since we're closing the istream we couldn't
even properly finish up the async handling. So for now just return an
error if we see this happening.

9 years agolib-mail: Fixed istream-header-filter unit test names
Timo Sirainen [Tue, 3 May 2016 17:28:42 +0000 (20:28 +0300)] 
lib-mail: Fixed istream-header-filter unit test names

9 years agodoveadm who: Fixed listing LMTP sessions
Timo Sirainen [Tue, 3 May 2016 17:20:28 +0000 (20:20 +0300)] 
doveadm who: Fixed listing LMTP sessions

9 years agolib-storage: Make it easier to debug mail's unclosed istream
Timo Sirainen [Mon, 2 May 2016 20:43:15 +0000 (23:43 +0300)] 
lib-storage: Make it easier to debug mail's unclosed istream

9 years agolib-mail: istream-header-filter - fixed adding headers at eoh
Timo Sirainen [Tue, 3 May 2016 15:25:50 +0000 (18:25 +0300)] 
lib-mail: istream-header-filter - fixed adding headers at eoh

9 years agolib-mail: istream-header-filter: Fixed stat() with HEADER_FILTER_HIDE_BODY
Timo Sirainen [Tue, 3 May 2016 14:38:34 +0000 (17:38 +0300)] 
lib-mail: istream-header-filter: Fixed stat() with HEADER_FILTER_HIDE_BODY

9 years agolib-mail: istream-header-filter HEADER_FILTER_ADD_MISSING_EOH fixes
Timo Sirainen [Tue, 3 May 2016 14:25:07 +0000 (17:25 +0300)] 
lib-mail: istream-header-filter HEADER_FILTER_ADD_MISSING_EOH fixes

When using HEADER_FILTER_CRLF_PRESERVE, add CR to the EOH if the previous
header line ended with CRLF.

When header ends to a header without newline, add two newlines so we can get
the actual EOH added.

9 years agolib-mail: istream-header-filter: Fixed stat() with HEADER_FILTER_END_BODY_WITH_LF
Timo Sirainen [Tue, 3 May 2016 14:08:24 +0000 (17:08 +0300)] 
lib-mail: istream-header-filter: Fixed stat() with HEADER_FILTER_END_BODY_WITH_LF

9 years agolib-mail: istream-header-filter - Check errors reading header
Timo Sirainen [Tue, 3 May 2016 13:54:46 +0000 (16:54 +0300)] 
lib-mail: istream-header-filter - Check errors reading header

This probably doesn't affect the results much, since the stream_errno is set
anyway. But it's better to abort early, just in case the broken state might
end up asserting later.

9 years agolib-storage: Fixed potential crash in mailbox_sync_deinit() error handling
Timo Sirainen [Tue, 3 May 2016 12:27:22 +0000 (15:27 +0300)] 
lib-storage: Fixed potential crash in mailbox_sync_deinit() error handling

If mailbox_sync*() was called before mailbox was opened, the automatic
mailbox opening could fail. mailbox_sync_deinit() would still try to access
box->view, which would be NULL.

9 years agolib-ldap: Handle various LDAP failures correctly
Aki Tuomi [Mon, 2 May 2016 14:31:30 +0000 (17:31 +0300)] 
lib-ldap: Handle various LDAP failures correctly

9 years agolib-ldap: Do not retry with bad credentials
Aki Tuomi [Mon, 2 May 2016 13:21:27 +0000 (16:21 +0300)] 
lib-ldap: Do not retry with bad credentials

9 years agoimap: Set client_command_context.tagline_reply before syncing.
Timo Sirainen [Wed, 4 May 2016 12:36:44 +0000 (15:36 +0300)] 
imap: Set client_command_context.tagline_reply before syncing.

Command post-hooks can't see it otherwise.

9 years agodsync: Fixed assert-crash if mailbox_attribute_set() fails
Timo Sirainen [Tue, 3 May 2016 19:18:54 +0000 (22:18 +0300)] 
dsync: Fixed assert-crash if mailbox_attribute_set() fails

We shouldn't set importer->mail_error, because we're not going to
fail the import.

Fixes assert-crash:
dsync-mailbox-import.c: line 2812 (dsync_mailbox_import_deinit): assertion failed: (importer->failed == (importer->mail_error != 0))

9 years agolib-ldap: Added initial connection pooling code.
Timo Sirainen [Mon, 2 May 2016 12:20:18 +0000 (15:20 +0300)] 
lib-ldap: Added initial connection pooling code.

This is mainly about allowing multiple dict-ldaps to use the same
ldap-connection. In future we could support load balancing with multiple
concurrent LDAP connections.

9 years agodict-ldap: Removed caching of ldap-clients
Timo Sirainen [Mon, 2 May 2016 11:35:40 +0000 (14:35 +0300)] 
dict-ldap: Removed caching of ldap-clients

With the previous per-username caching there could be a huge number of
dict-ldaps.

9 years agodict-ldap: Don't reuse dict for different usernames.
Timo Sirainen [Mon, 2 May 2016 11:21:06 +0000 (14:21 +0300)] 
dict-ldap: Don't reuse dict for different usernames.

Fixes doing priv/* lookups for multiple usernames.

This currently also means that each username will create a separate LDAP
connection, which isn't ideal. But this is probably better fixed in
lib-ldap code similar to how lib-sql does connection pooling.

9 years agoimap: Added struct client_command_context.tagline_reply
Timo Sirainen [Mon, 2 May 2016 09:01:40 +0000 (12:01 +0300)] 
imap: Added struct client_command_context.tagline_reply

Can be used by plugins.

9 years agoauth: Added %{auth_user/username/domain} variables
Timo Sirainen [Mon, 2 May 2016 07:14:20 +0000 (10:14 +0300)] 
auth: Added %{auth_user/username/domain} variables

9 years agolib-storage: Clear list error before mailbox_list_get_hierarchy_sep()
Timo Sirainen [Sat, 30 Apr 2016 11:55:14 +0000 (14:55 +0300)] 
lib-storage: Clear list error before mailbox_list_get_hierarchy_sep()

With ACL plugin enabled the call could have triggered dovecot-acl-list
rebuild, which in turn could have set list errors if it didn't have
permissions to all the mailboxes. This caused IMAP logins to fail.

9 years agolib-mail: message-parser assert-crashfix
Timo Sirainen [Sat, 30 Apr 2016 11:19:02 +0000 (14:19 +0300)] 
lib-mail: message-parser assert-crashfix

Crashes when multipart MIME header is missing end-of-headers line and the
boundary begins with the same prefix as one of the parent boundaries.
Broken by 7a12331c6

9 years agoquota: Fix to earlier commit 62f2f6baf
Timo Sirainen [Fri, 29 Apr 2016 22:27:27 +0000 (01:27 +0300)] 
quota: Fix to earlier commit 62f2f6baf

expunge_uids may become empty with prev_idx > 0

9 years agolib-fs: Fixed fs_get_metadata() with fs-metawrap
Timo Sirainen [Fri, 29 Apr 2016 22:05:47 +0000 (01:05 +0300)] 
lib-fs: Fixed fs_get_metadata() with fs-metawrap

If mail was already read to EOF.

9 years agoman: Add stub for doveadm-fs command
Michael Slusarz [Tue, 26 Apr 2016 20:27:39 +0000 (14:27 -0600)] 
man: Add stub for doveadm-fs command

9 years agolmtp: Connect to anvil earlier while still running as root
Timo Sirainen [Tue, 26 Apr 2016 15:51:55 +0000 (18:51 +0300)] 
lmtp: Connect to anvil earlier while still running as root

This was a problem only with lmtp_rcpt_check_quota=yes.

9 years agolib: Set timestamp part more accurately in guid_128_generate()
Timo Sirainen [Thu, 28 Apr 2016 19:33:14 +0000 (22:33 +0300)] 
lib: Set timestamp part more accurately in guid_128_generate()

Previously a long-running process would keep the timestamp close to its
original start time. This doesn't really matter as long as GUIDs are treated
opaque, but some pieces of code prefer to try to use the timestamp fields
since they're already there. This makes such code work more nicely.

9 years agolib-ldap: Make static analyzer happier
Timo Sirainen [Fri, 29 Apr 2016 18:57:36 +0000 (21:57 +0300)] 
lib-ldap: Make static analyzer happier

Remove dead assignment.

9 years agoauth: Fixed final result in multiple userdbs
Timo Sirainen [Fri, 29 Apr 2016 17:23:00 +0000 (20:23 +0300)] 
auth: Fixed final result in multiple userdbs

We don't want to return the last result's success/failure, but
the entire userdb chain's success/failure.

9 years agoauth: Session ID wasn't exported to auth workers.
Timo Sirainen [Fri, 29 Apr 2016 16:59:36 +0000 (19:59 +0300)] 
auth: Session ID wasn't exported to auth workers.

Most importantly this means that log messages didn't contain them.

9 years agoquota: Added quota_over_flag_lazy_check flag.
Timo Sirainen [Fri, 29 Apr 2016 16:25:52 +0000 (19:25 +0300)] 
quota: Added quota_over_flag_lazy_check flag.

By default the quota_over_flag is checked immediately at startup. With this
option the check is done only at a time when the quota is anyway being read.