]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
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?)
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.
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.
Aki Tuomi [Fri, 13 May 2016 10:10:04 +0000 (13:10 +0300)]
dict: Set default transaction commit callback
Removes need for NULL check on drivers
Timo Sirainen [Tue, 10 May 2016 21:09:02 +0000 (17:09 -0400)]
lib-storage: Fixed istream error handling while saving mails.
We might have logged them as write errors, or we might have ignored the
error if i_stream_read() failed. Now the behavior is consistent.
Timo Sirainen [Tue, 10 May 2016 21:06:54 +0000 (17:06 -0400)]
lib-storage: Moved common code to index_storage_save_continue()
Stephan Bosch [Tue, 10 May 2016 18:37:55 +0000 (20:37 +0200)]
Added LIBDOVECOT_SQL_INCLUDE to dovecot-config and dovecot.m4.
Martti Rannanjärvi [Mon, 9 May 2016 08:08:33 +0000 (11:08 +0300)]
lib: remove failed bool from sized_istream struct
This is no longer needed as we are now checking for
stream_errno also in istream.c
Martti Rannanjärvi [Tue, 10 May 2016 10:51:29 +0000 (13:51 +0300)]
doc: remove doveadm mount manpages
Timo Sirainen [Thu, 12 May 2016 19:10:47 +0000 (15:10 -0400)]
lib-fs: Added FS_PROPERTY_FASTCOPY_CHANGED_METADATA
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.
Timo Sirainen [Thu, 12 May 2016 11:24:39 +0000 (07:24 -0400)]
lib-fs: Minor code cleanup
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.
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
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.
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.
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.
Timo Sirainen [Thu, 12 May 2016 09:40:29 +0000 (05:40 -0400)]
lmtp: Removed (Dovecot) from Received header.
Some people want to hide it, and I don't really see much benefit in
including it anyway. So lets just hide it from everyone.
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.
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.
Timo Sirainen [Wed, 11 May 2016 09:19:14 +0000 (05:19 -0400)]
dsync: Fixed potential crash
This seems to be possible with dsync_mailbox_find_common_expunged_uid() ->
dsync_mailbox_common_uid_found() -> dsync_mailbox_rewind_search() -> following
search doesn't find anything.
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.
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.
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.
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.
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.
Baofeng Wang [Wed, 20 Apr 2016 14:23:12 +0000 (17:23 +0300)]
lib-storage: Add %{session} to mail_log_prefix by default
Parameter is added to initialization string.
Martti Rannanjärvi [Mon, 9 May 2016 07:40:56 +0000 (10:40 +0300)]
lib: check stream_errno too when checking whether istream is closed
Aki Tuomi [Sun, 24 Apr 2016 18:06:41 +0000 (21:06 +0300)]
lib: Use arc4random if present
Aki Tuomi [Tue, 12 Apr 2016 07:25:09 +0000 (10:25 +0300)]
lib: Do not use OpenSSL to read random bytes
Timo Sirainen [Mon, 9 May 2016 05:04:39 +0000 (08:04 +0300)]
README: Added missing supported RFCs
Timo Sirainen [Sun, 8 May 2016 21:55:21 +0000 (00:55 +0300)]
lib-dict: Compiler warning fix
I don't think it's possible that error was used uninitialized, but some gcc
version seems to think so.
Timo Sirainen [Fri, 6 May 2016 14:28:33 +0000 (17:28 +0300)]
dict-client: Use standard str_tabescape-functions
There's no reason to reimplement them here separately.
Timo Sirainen [Fri, 6 May 2016 12:14:02 +0000 (15:14 +0300)]
lib-dict: dict_transaction_commit*() returns now error string
Timo Sirainen [Fri, 6 May 2016 10:45:34 +0000 (13:45 +0300)]
lib-dict: Changed internal transaction_commit() to return void
Somewhat simplifies the code now that it doesn't have to both call a
callback and return the same ret.
Timo Sirainen [Fri, 6 May 2016 10:44:15 +0000 (13:44 +0300)]
dict-memcached-ascii: Fixed async commit
Timo Sirainen [Fri, 6 May 2016 10:42:11 +0000 (13:42 +0300)]
dict-redis: Fixed memory leak in async commit
Timo Sirainen [Fri, 6 May 2016 10:29:27 +0000 (13:29 +0300)]
lib-dict: dict_iterate_deinit() returns now error string
Timo Sirainen [Fri, 6 May 2016 10:10:42 +0000 (13:10 +0300)]
lib-dict: Changed dict_wait() to return void.
If it encounters any failures, it should just make sure to abort any pending
async requests before returning.
Timo Sirainen [Fri, 6 May 2016 10:08:06 +0000 (13:08 +0300)]
dict-client: dict_wait() can't really fail
Timo Sirainen [Fri, 6 May 2016 09:59:38 +0000 (12:59 +0300)]
dict: Pass through dict_lookup() error from dict server to client
Timo Sirainen [Fri, 6 May 2016 09:33:11 +0000 (12:33 +0300)]
lib-dict: dict_lookup() returns now error string
Timo Sirainen [Fri, 6 May 2016 09:19:21 +0000 (12:19 +0300)]
lib-dict: Moved/removed explicit stack frames in dict drivers.
Added them back to dict_set/unset/atomic_inc() in dict.c. Others are
unlikely to be called many times.
Timo Sirainen [Fri, 6 May 2016 08:43:45 +0000 (11:43 +0300)]
lib-dict: Renamed dict_init_full() to dict_init()
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)
Timo Sirainen [Sun, 8 May 2016 19:22:25 +0000 (22:22 +0300)]
lib-http: Allow http_client_settings.ssl==NULL
Timo Sirainen [Sat, 7 May 2016 17:06:02 +0000 (20:06 +0300)]
config: Added support for SET_TIME_MSECS
Timo Sirainen [Fri, 6 May 2016 18:45:44 +0000 (21:45 +0300)]
cassandra: Support milliseconds for request/connect_timeout
Timo Sirainen [Fri, 6 May 2016 18:44:22 +0000 (21:44 +0300)]
lib-settings: Added SET_TIME_MSECS type.
Timo Sirainen [Fri, 6 May 2016 18:43:04 +0000 (21:43 +0300)]
lib-settings: Added settings_get_time_msecs()
Timo Sirainen [Fri, 6 May 2016 18:38:30 +0000 (21:38 +0300)]
lib-settings: settings_get_time() requires explicit unit now, except for 0.
This means that all the time interval settings in dovecot.conf must no
longer be simply a number.
Timo Sirainen [Tue, 3 May 2016 16:42:08 +0000 (19:42 +0300)]
doveadm fetch: Translate commas to spaces in body|binary.<section> with
This way we can do e.g.:
doveadm fetch 'uid body.header.fields(from,to,subject)' ...
Although in theory we could also change the parser to allow spaces as long
as they're inside (..), but this is probably too much extra effort.
Timo Sirainen [Tue, 3 May 2016 16:39:44 +0000 (19:39 +0300)]
lib-imap-storage: Allow HEADER.FIELDS(..) without space before '('
This is to allow doveadm fetch to use it. Attempting to do this without a
space in IMAP already fails elsewhere:
x fetch 1 body.peek[header.fields(from to)]
x BAD Error in IMAP command FETCH: Invalid characters in atom
Timo Sirainen [Tue, 3 May 2016 11:58:37 +0000 (14:58 +0300)]
doveadm fetch: Fixed logging errors for istream failures
Timo Sirainen [Tue, 3 May 2016 11:54:28 +0000 (14:54 +0300)]
doveadm fetch: Added body.<section> and binary.<section> fields
These correspond to IMAP BODY[<section>].
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.
Martti Rannanjärvi [Wed, 20 Apr 2016 11:33:57 +0000 (14:33 +0300)]
doveadm: error to print formatted without format
This changes the segfault of `doveadm -f formatted ...` to an error.
Martti Rannanjärvi [Fri, 8 Apr 2016 11:19:52 +0000 (14:19 +0300)]
lib: Fixed potential collision in guid_generate()
There wasn't enough padding for tv_nsec and it was also assuming 16 bit
PIDs. Because of these there was a tiny possibility of two
guid_generate() calls returning the same GUID.
This changes the GUID format a bit, but it was used only by sdbox code,
which doesn't assume anything about the GUID format.
Martti Rannanjärvi [Tue, 26 Apr 2016 07:39:21 +0000 (10:39 +0300)]
lib-http: use ssl_iostream_settings in http_client_settings
Martti Rannanjärvi [Tue, 26 Apr 2016 07:32:16 +0000 (10:32 +0300)]
lib-ssl-iostream: move ssl_iostream_settings_dup to iostream-ssl.c
Baofeng Wang [Wed, 20 Apr 2016 14:27:19 +0000 (17:27 +0300)]
lib-storage: remove mdbox_purge_preserve_alt setting
remove setting and its reference.
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
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.
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
Aki Tuomi [Fri, 6 May 2016 09:51:28 +0000 (12:51 +0300)]
dict-ldap: Properly duplicate result
Timo Sirainen [Fri, 6 May 2016 14:24:42 +0000 (17:24 +0300)]
lib: Added t_str_tabunescape()
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
Timo Sirainen [Fri, 6 May 2016 11:34:57 +0000 (14:34 +0300)]
lib: Added i_stream_get_disconnect_reason()
Timo Sirainen [Fri, 6 May 2016 11:22:29 +0000 (14:22 +0300)]
lib: Improved connection_disconnect_reason()
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.
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.
Timo Sirainen [Thu, 5 May 2016 11:58:46 +0000 (14:58 +0300)]
stats: Fixed ADD-USER stats tracking (auth stats)
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.
Timo Sirainen [Wed, 4 May 2016 15:24:03 +0000 (18:24 +0300)]
lib: istream's max_buffer_size=0 means 0, not unlimited.
Make sure we don't grow the buffer size then.
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.
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))
Timo Sirainen [Tue, 3 May 2016 17:28:42 +0000 (20:28 +0300)]
lib-mail: Fixed istream-header-filter unit test names
Timo Sirainen [Tue, 3 May 2016 17:20:28 +0000 (20:20 +0300)]
doveadm who: Fixed listing LMTP sessions
Timo Sirainen [Tue, 3 May 2016 17:17:12 +0000 (20:17 +0300)]
lib: Added more unit tests to str_*()
Timo Sirainen [Tue, 3 May 2016 17:15:23 +0000 (20:15 +0300)]
config: Fixed namespaces to work again
Broken by
26a6ff7f0 . old_settings_handle() should have returned FALSE for
settings it didn't handle.
Baofeng Wang [Tue, 26 Apr 2016 13:43:15 +0000 (16:43 +0300)]
global: Use mail_user_plugin_getenv_bool() wherever possible
New API is used to check boolean setting OR exsitence of an env variable.
Baofeng Wang [Wed, 20 Apr 2016 14:21:51 +0000 (17:21 +0300)]
lib-storage: add mail_user_plugin_getenv_bool
New API will check boolean-like env setting OR its exsitence.
Function returns FALSE when:
* Read out a null string,
"Or" * String starts with any letter in set {'N', 'n', 'F','f','0'}
To keep downward compatibility, For other cases including an empty
string, function returns TRUE.
Timo Sirainen [Sat, 30 Apr 2016 11:05:42 +0000 (14:05 +0300)]
lib: Optimize str_append_n()
Timo Sirainen [Sat, 30 Apr 2016 11:03:32 +0000 (14:03 +0300)]
lib: Make str_*() inline which are simple buffer_* wrappers.
Timo Sirainen [Sat, 30 Apr 2016 10:59:32 +0000 (13:59 +0300)]
global: Avoid using buffer_get_data()
Especially buffer_get_data(buf, NULL) generates worse code than just
using buf->data directly.
Timo Sirainen [Sat, 30 Apr 2016 10:49:06 +0000 (13:49 +0300)]
global: Replace buffer_get_used_size(buf) with buf->used
Doesn't make any diffence to code generation, but it's somewhat simpler code.
It's also more consistent since most of the code nowadays uses the ->used.
Baofeng Wang [Wed, 20 Apr 2016 14:27:50 +0000 (17:27 +0300)]
config: Remove old_namespace()
From config/old-set-parser.c, and its caller. The namespace section
named "private", "shared" or "public" is obsolete accordingly.
Martti Rannanjärvi [Mon, 2 May 2016 10:26:05 +0000 (13:26 +0300)]
lib-imap, imap: BINARY [UNKNOWNCTE] to [PARSE]
Timo Sirainen [Mon, 2 May 2016 20:43:15 +0000 (23:43 +0300)]
lib-storage: Make it easier to debug mail's unclosed istream
Timo Sirainen [Tue, 3 May 2016 15:25:50 +0000 (18:25 +0300)]
lib-mail: istream-header-filter - fixed adding headers at eoh
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
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.
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
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.
Timo Sirainen [Tue, 3 May 2016 12:49:00 +0000 (15:49 +0300)]
lib: Added o_stream_unix_write_fd() assert: fd>=0
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.
Timo Sirainen [Mon, 2 May 2016 21:25:43 +0000 (00:25 +0300)]
lib-storage: Another fix to mail storage initialization.
Allow mail_namespaces_init_location() to add the namespace directly to user,
since that's what the current callers always want. But compared to the
original code we're now calling mail_namespaces_init_finish() rather than
doing the same things ourself.
Aki Tuomi [Mon, 2 May 2016 14:31:30 +0000 (17:31 +0300)]
lib-ldap: Handle various LDAP failures correctly
Aki Tuomi [Mon, 2 May 2016 13:21:27 +0000 (16:21 +0300)]
lib-ldap: Do not retry with bad credentials
Timo Sirainen [Mon, 2 May 2016 14:00:22 +0000 (17:00 +0300)]
lib-storage: Changed mail storage initialization.
Most importantly require mail_namespaces_init_finish() after
mail_storage_create(). This was needed so that
mail_namespaces_created/added hook would always have the ns->list set, which
is required for several of the hooks to work (e.g. mailbox list index)