]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
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)
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.
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.
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.
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.
Timo Sirainen [Mon, 2 May 2016 07:14:20 +0000 (10:14 +0300)]
auth: Added %{auth_user/username/domain} variables
Stephan Bosch [Sat, 30 Apr 2016 10:50:53 +0000 (12:50 +0200)]
lib: Added ostream-unix for writing fd sockets via ostream.
Stephan Bosch [Sat, 30 Apr 2016 12:10:59 +0000 (14:10 +0200)]
lib: ostream-file: Allow creating derived file output streams.
Stephan Bosch [Sat, 30 Apr 2016 11:55:52 +0000 (13:55 +0200)]
lib: ostream-file: Split o_stream_file_writev() from o_stream_file_writev_full().
Stephan Bosch [Sat, 30 Apr 2016 11:51:59 +0000 (13:51 +0200)]
lib: ostream-file: Renamed o_stream_writev() to o_stream_file_writev_full().
Stephan Bosch [Sat, 30 Apr 2016 11:29:47 +0000 (13:29 +0200)]
lib: ostream-file: Renamed iov_size to iov_count everywhere and made it unsigned int for consistency.
Stephan Bosch [Sat, 30 Apr 2016 12:22:21 +0000 (14:22 +0200)]
lib-http: server: Fixed assert failure occurring when closing the connection while a request payload was still being read.
Timo Sirainen [Sat, 30 Apr 2016 12:26:27 +0000 (15:26 +0300)]
.gitignore: Added *~
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.
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
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
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.
Martti Rannanjärvi [Thu, 14 Apr 2016 11:28:30 +0000 (14:28 +0300)]
lib-storage: mailbox_list_index yes by default
Michael Slusarz [Tue, 26 Apr 2016 20:27:39 +0000 (14:27 -0600)]
man: Add stub for doveadm-fs command
Aki Tuomi [Tue, 26 Apr 2016 16:26:34 +0000 (19:26 +0300)]
doveadm-server: Handle istream send error.
Stephan Bosch [Sat, 16 Apr 2016 01:54:00 +0000 (03:54 +0200)]
lib-http: server: Implemented means to gracefully shut down the server.
While shutting down, it will not accept new requests and connections are closed once they become idle.
Aki Tuomi [Mon, 25 Apr 2016 08:37:05 +0000 (11:37 +0300)]
lib-dict: Further remove APPEND
Martti Rannanjärvi [Tue, 26 Apr 2016 07:49:46 +0000 (10:49 +0300)]
mail-log: log headers as utf8
Martti Rannanjärvi [Wed, 27 Apr 2016 10:06:52 +0000 (13:06 +0300)]
lib-lda: remove forced logging of session_id
Martti Rannanjärvi [Wed, 27 Apr 2016 10:31:56 +0000 (13:31 +0300)]
lib-master, doveadm: remove mountpoint-list.* and doveadm mount commands
Martti Rannanjärvi [Wed, 27 Apr 2016 07:17:27 +0000 (10:17 +0300)]
lib-storage: write subscription file in version 2 format
Write subscriptions file in a format that only v2.2.17 or newer can read, so
after dovecot converts the files to the new format, downgrading to a version
older than v2.2.17 is not supported.
Teemu Huovila [Fri, 29 Apr 2016 18:36:31 +0000 (21:36 +0300)]
lib-dict-extra: Avoid out of scope data stack usage.
Stephan Bosch [Wed, 27 Apr 2016 10:46:02 +0000 (12:46 +0200)]
lib: Finished string trimming functions to trim characters from beginning and/or end of a string.
This also restructures the code to avoid code duplication as much as possible.
Stephan Bosch [Wed, 27 Apr 2016 10:00:25 +0000 (12:00 +0200)]
lib-http: client: Added ability to configure a specific proxy for individual requests.
This way, a request can be routed to a specific proxy (or origin server). The destination can also be a unix socket.
Martti Rannanjärvi [Thu, 28 Apr 2016 07:06:21 +0000 (10:06 +0300)]
lib-fs: don't append '/' to prefix in posix-fs
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.
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.