]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agoexample-config: Update deliver_log_format comment
Timo Sirainen [Thu, 2 Mar 2017 16:32:15 +0000 (18:32 +0200)] 
example-config: Update deliver_log_format comment

8 years agolib-ssl-iostream: Ensure verify_remote_cert is true
Aki Tuomi [Thu, 2 Mar 2017 07:15:13 +0000 (09:15 +0200)] 
lib-ssl-iostream: Ensure verify_remote_cert is true

Forgotten in 38424b8081a75be3ef93729fed4d30dbafca5885

8 years agolib-ssl-iostream: Fix ambiguity with SSL settings
Aki Tuomi [Mon, 20 Feb 2017 07:32:15 +0000 (09:32 +0200)] 
lib-ssl-iostream: Fix ambiguity with SSL settings

 - lib-ssl-iostream as client: Use only allow_invalid_cert. If it's not set, verify the server cert.
 - lib-ssl-iostream as server: If verify_client_cert=FALSE, don't ask for the client cert. Otherwise, ask for client cert but still allow it if allow_invalid_cert=TRUE.

8 years agoimap-hibernate: Avoid using casts
Timo Sirainen [Wed, 1 Mar 2017 11:12:41 +0000 (13:12 +0200)] 
imap-hibernate: Avoid using casts

8 years agotrash: Read settings after namespaces are loaded
Aki Tuomi [Wed, 1 Mar 2017 07:15:29 +0000 (09:15 +0200)] 
trash: Read settings after namespaces are loaded

Fixes Panic: file mail-namespace.c: line 709 (mail_namespace_find): assertion failed: (ns != NULL)

8 years agomaster: Try to listen on master socket even if all services couldn't be listened to.
Timo Sirainen [Mon, 27 Feb 2017 14:23:09 +0000 (16:23 +0200)] 
master: Try to listen on master socket even if all services couldn't be listened to.

This could happen during a settings reload.

8 years agomaster: Add missing error logging for master socket listening failure.
Timo Sirainen [Mon, 27 Feb 2017 14:22:52 +0000 (16:22 +0200)] 
master: Add missing error logging for master socket listening failure.

8 years agomaster: Don't crash if master socket couldn't be re-opened after settings reload.
Timo Sirainen [Mon, 27 Feb 2017 14:22:08 +0000 (16:22 +0200)] 
master: Don't crash if master socket couldn't be re-opened after settings reload.

8 years agoimap-hibernate: Support userdb in var_expand
Aki Tuomi [Thu, 23 Feb 2017 09:47:20 +0000 (11:47 +0200)] 
imap-hibernate: Support userdb in var_expand

8 years agolib-index: Fix test-mail-index-transaction-update
Timo Sirainen [Sun, 26 Feb 2017 14:10:58 +0000 (16:10 +0200)] 
lib-index: Fix test-mail-index-transaction-update

It was broken with TZ=Australia/ACT. Fixing it seems too troublesome, so
just use TZ=UTC during the test.

8 years agolib-index: Minor fix to day_first_uid updating
Timo Sirainen [Sun, 26 Feb 2017 14:09:13 +0000 (16:09 +0200)] 
lib-index: Minor fix to day_first_uid updating

mktime() was getting a bit confused around day changes. Giving it only
year/month/day makes it less confused.

8 years agodoveadm: Do not crash doveadm-server if input file missing
Aki Tuomi [Sat, 11 Mar 2017 17:20:30 +0000 (19:20 +0200)] 
doveadm: Do not crash doveadm-server if input file missing

save commands expects valid input file for it to work,
if we are not running for cli, and input file is not
provided, provide EINVAL error to caller via i_stream_error.

8 years agolib-dcrypt: Add asserts
Aki Tuomi [Thu, 16 Mar 2017 07:36:23 +0000 (09:36 +0200)] 
lib-dcrypt: Add asserts

Fixes several static analysis reports

8 years agolib-storage & imap: add MAIL_ERROR_UNAVAILABLE as [UNAVAILABLE]
Josef 'Jeff' Sipek [Mon, 27 Feb 2017 23:13:54 +0000 (18:13 -0500)] 
lib-storage & imap: add MAIL_ERROR_UNAVAILABLE as [UNAVAILABLE]

[UNAVAILABLE] is defined in RFC 5530 and we were just missing a MAIL_ERROR_*
constant to make use of it.

8 years agoimap, pop3, indexer-worker: Add (deinit) to process title before autoexpunging runs.
Timo Sirainen [Wed, 8 Mar 2017 20:39:34 +0000 (15:39 -0500)] 
imap, pop3, indexer-worker: Add (deinit) to process title before autoexpunging runs.

lmtp should also do this, but it needs a bit larger changes.

8 years agopop3: Add client.destroyed boolean
Timo Sirainen [Wed, 8 Mar 2017 22:09:12 +0000 (17:09 -0500)] 
pop3: Add client.destroyed boolean

8 years agoauth: Auth workers shouldn't return username if it wasn't changed
Timo Sirainen [Mon, 13 Mar 2017 12:23:11 +0000 (14:23 +0200)] 
auth: Auth workers shouldn't return username if it wasn't changed

This continues the previous fix where username was always added to
passdb/userdb cache, even if the username wasn't changed. That could have
resulted in wrongly changing usernames if the cache key didn't uniquely
identify the user.

8 years agoauth: passdb/userdb lookups via auth-worker cached too much of the replies
Timo Sirainen [Mon, 13 Mar 2017 11:49:04 +0000 (13:49 +0200)] 
auth: passdb/userdb lookups via auth-worker cached too much of the replies

Only the fields returned by the lookup itself were supposed to be cached.
This was especially problematic if the lookup via auth-worker didn't
uniquely identify the user. For example doing a passdb lookup for an
attribute shared by multiple users could have caused the reply to contain
the previous cached user's all extra fields.

8 years agoauth: Properly hide all fields with passwords
Aki Tuomi [Wed, 15 Mar 2017 11:29:11 +0000 (13:29 +0200)] 
auth: Properly hide all fields with passwords

client reply line wasn't hiding all items
which contain 'pass' substring. This was
inconsistent behaviour since elsewhere this was done.

8 years ago*-login: Change API for how login_plugins hook into client allocation.
Timo Sirainen [Wed, 15 Mar 2017 16:20:31 +0000 (18:20 +0200)] 
*-login: Change API for how login_plugins hook into client allocation.

The previous API worked badly when there were more than one plugin.
The current behavior works similarly to how mail_plugins work.

8 years agocassandra: Treat CASS_ERROR_SERVER_UNAVAILABLE as "write success is uncertain"
Timo Sirainen [Mon, 13 Mar 2017 20:52:41 +0000 (22:52 +0200)] 
cassandra: Treat CASS_ERROR_SERVER_UNAVAILABLE as "write success is uncertain"

Looks like the write could still have actually gone through.

8 years agolib-oauth2: Don't free oauth2_request too early.
Timo Sirainen [Wed, 15 Mar 2017 23:22:09 +0000 (01:22 +0200)] 
lib-oauth2: Don't free oauth2_request too early.

Move the freeing explicitly to only after calling the callback. The
previous method of freeing it on when http_request was destroyed could
have happened too early when oauth2_parse_json() called i_stream_unref(),
which released the last reference to the http_request.

8 years agolib-oauth2: Fix memory leak if HTTP URL parsing fails.
Timo Sirainen [Wed, 15 Mar 2017 23:12:57 +0000 (01:12 +0200)] 
lib-oauth2: Fix memory leak if HTTP URL parsing fails.

Also delay calling the callback. The callers don't necessarily expect an
immediate callback (auth/db-oauth2.c doesn't).

8 years agoauth: oauth2 - cleanup db_oauth2_lookup_callback_t
Timo Sirainen [Wed, 15 Mar 2017 22:54:44 +0000 (00:54 +0200)] 
auth: oauth2 - cleanup db_oauth2_lookup_callback_t

db parameter isn't needed, because request->db already contains it.
Also moved request parameter to be the first.

8 years agoauth: oauth2 - make it easier to see where db_oauth2_callback() is called
Timo Sirainen [Wed, 15 Mar 2017 22:51:15 +0000 (00:51 +0200)] 
auth: oauth2 - make it easier to see where db_oauth2_callback() is called

Doesn't fix anything, but places the db_oauth2_callback() calls into the end
of _continue() calls so it's clearer that they're always being called
exactly once.

8 years agoauth: oauth2 - Clarify token validation success/valid error handling
Timo Sirainen [Wed, 15 Mar 2017 23:35:38 +0000 (01:35 +0200)] 
auth: oauth2 - Clarify token validation success/valid error handling

result->error is NULL only if result->success && !result->valid.
Also !result->success is the more important error handling case.
Write out these cases explicitly so it's easier to understand.

8 years agoauth: oauth2 - remove db_oauth2_request.failed
Timo Sirainen [Wed, 15 Mar 2017 22:42:28 +0000 (00:42 +0200)] 
auth: oauth2 - remove db_oauth2_request.failed

It is an unnecessary duplication of passdb_result.

8 years agoauth: oauth2 - remove db_oauth2_request.result
Timo Sirainen [Wed, 15 Mar 2017 22:38:39 +0000 (00:38 +0200)] 
auth: oauth2 - remove db_oauth2_request.result

It's not a persistent state. When it's set, the callback needs to be called.
This way it's more difficult to forget to set it.

8 years agoauth: oauth2 - Template expand failure should be an internal error
Timo Sirainen [Wed, 15 Mar 2017 22:33:24 +0000 (00:33 +0200)] 
auth: oauth2 - Template expand failure should be an internal error

Not the default "password mismatch". Also changed the API to be closer to
the other nearby functions.

8 years agoauth: oauth2 - make db_oauth2_template_export() static
Timo Sirainen [Wed, 15 Mar 2017 22:32:01 +0000 (00:32 +0200)] 
auth: oauth2 - make db_oauth2_template_export() static

It's not used outside db-oauth2.c

8 years agoauth: oauth2 - introspection lookup error should be internal failure
Timo Sirainen [Wed, 15 Mar 2017 22:25:19 +0000 (00:25 +0200)] 
auth: oauth2 - introspection lookup error should be internal failure

Not the default, which is "password mismatch".

8 years agoauth: oauth2 - Make sure db_oauth2_request.req is set to NULL when it gets freed.
Timo Sirainen [Wed, 15 Mar 2017 22:15:10 +0000 (00:15 +0200)] 
auth: oauth2 - Make sure db_oauth2_request.req is set to NULL when it gets freed.

Doesn't fix anything, but makes it clearer that req->req must not be
aborted anymore after this stage, because it gets freed anyway.

8 years agoauth: oauth2 - Fix aborting auth requests on deinit.
Timo Sirainen [Wed, 15 Mar 2017 22:13:08 +0000 (00:13 +0200)] 
auth: oauth2 - Fix aborting auth requests on deinit.

The auth_request needs to be finished by calling the callback.

8 years agoauth: Do not double-expand key in passdb dict when authenticating
Aki Tuomi [Mon, 6 Mar 2017 12:59:46 +0000 (14:59 +0200)] 
auth: Do not double-expand key in passdb dict when authenticating

Broken by 79042f8c

8 years ago*-login: Remove unused client.proxy_state
Timo Sirainen [Thu, 9 Mar 2017 16:32:21 +0000 (11:32 -0500)] 
*-login: Remove unused client.proxy_state

8 years agopop3-login: Remove usage of client.common.proxy_state
Timo Sirainen [Thu, 9 Mar 2017 15:48:33 +0000 (10:48 -0500)] 
pop3-login: Remove usage of client.common.proxy_state

8 years agopop3-login: Log proxy state as human-readable string.
Timo Sirainen [Thu, 9 Mar 2017 15:46:36 +0000 (10:46 -0500)] 
pop3-login: Log proxy state as human-readable string.

8 years agoimap-login: Log proxy state as human-readable string.
Timo Sirainen [Thu, 9 Mar 2017 15:41:52 +0000 (10:41 -0500)] 
imap-login: Log proxy state as human-readable string.

Separate sent/received state and log them as strings.

8 years ago*-login: Add client.proxy_get_state() for providing human-readable proxy state
Timo Sirainen [Thu, 9 Mar 2017 15:31:39 +0000 (10:31 -0500)] 
*-login: Add client.proxy_get_state() for providing human-readable proxy state

If not implemented, it defaults to the old method of returning proxy_state
number.

8 years agopop3: Set process title before syncing mailbox.
Timo Sirainen [Tue, 7 Mar 2017 19:36:45 +0000 (14:36 -0500)] 
pop3: Set process title before syncing mailbox.

The syncing could be taking a long time, so it's useful to have the username
in the process title during that.

8 years agoimap: If unhibernation fails due to a mailbox error, log the mailbox name.
Timo Sirainen [Wed, 8 Mar 2017 15:07:37 +0000 (10:07 -0500)] 
imap: If unhibernation fails due to a mailbox error, log the mailbox name.

8 years agoimap: When disconnecting due to FETCH failure, include "FETCH" in the log message.
Timo Sirainen [Wed, 8 Mar 2017 14:28:14 +0000 (09:28 -0500)] 
imap: When disconnecting due to FETCH failure, include "FETCH" in the log message.

8 years agolib-sasl: Fix xoauth2 data format
Aki Tuomi [Tue, 7 Mar 2017 16:10:57 +0000 (18:10 +0200)] 
lib-sasl: Fix xoauth2 data format

Authentication data was missing user=

8 years agodb-oauth2: Make sure request is removed only once
Aki Tuomi [Tue, 7 Mar 2017 08:09:20 +0000 (10:09 +0200)] 
db-oauth2: Make sure request is removed only once

Callback might be called twice.

8 years agolib-oauth2: Use http client destroy callback
Aki Tuomi [Tue, 7 Mar 2017 08:08:08 +0000 (10:08 +0200)] 
lib-oauth2: Use http client destroy callback

Avoids freeing memory early.

Fixes signal 11 crash in auth

8 years agoauth: Apply skips to first passdb
Aki Tuomi [Mon, 6 Mar 2017 11:16:12 +0000 (13:16 +0200)] 
auth: Apply skips to first passdb

This is required to apply filters to first
passdb, so that mechanism filters can be
applied.

8 years agolib-oauth2: Add missing content-type header
Aki Tuomi [Fri, 3 Mar 2017 06:31:50 +0000 (08:31 +0200)] 
lib-oauth2: Add missing content-type header

8 years agolib: Added i_strchr_to_next()
Timo Sirainen [Thu, 20 Oct 2016 09:08:09 +0000 (12:08 +0300)] 
lib: Added i_strchr_to_next()

8 years agofts: Don't add NULL content disposition or type to HTTP header
Martti Rannanjärvi [Wed, 1 Mar 2017 10:29:17 +0000 (12:29 +0200)] 
fts: Don't add NULL content disposition or type to HTTP header

8 years agodoveadm: Add missing newline to proxy kick output
Aki Tuomi [Mon, 27 Feb 2017 18:40:43 +0000 (20:40 +0200)] 
doveadm: Add missing newline to proxy kick output

8 years agodoveadm: Ensure -- is added to command line before positional arguments for non-mails...
Aki Tuomi [Mon, 27 Feb 2017 18:38:43 +0000 (20:38 +0200)] 
doveadm: Ensure -- is added to command line before positional arguments for non-mails commands as well

Was forgotten from 967efe37d1f10a28c0a086cc5919d4ce8917bed8

8 years agodoveadm: Ensure -- is added to command line before positional arguments
Aki Tuomi [Mon, 27 Feb 2017 17:12:32 +0000 (19:12 +0200)] 
doveadm: Ensure -- is added to command line before positional arguments

This prevents parser from choking on dash.

8 years agodoveadm: Fix allow-empty-mailbox-name handling
Aki Tuomi [Mon, 27 Feb 2017 17:04:55 +0000 (19:04 +0200)] 
doveadm: Fix allow-empty-mailbox-name handling

It was supposed to be handled for metadata commands only.

Broken in 26c41874cf6019c3e39f0ed630b2a07a92b2635f

8 years agodoveadm move: Use mailbox_move() instead of copy+expunge
Timo Sirainen [Mon, 27 Feb 2017 12:21:48 +0000 (14:21 +0200)] 
doveadm move: Use mailbox_move() instead of copy+expunge

This allows for some optimizations to be done.

8 years agomaster: add cassandra to printed build options
Martti Rannanjärvi [Mon, 27 Feb 2017 07:39:06 +0000 (09:39 +0200)] 
master: add cassandra to printed build options

8 years agolib-dcrypt: Replace #if OPENSSL_VERSION_NUMBER with more explicit checks
Timo Sirainen [Sat, 25 Feb 2017 19:47:01 +0000 (21:47 +0200)] 
lib-dcrypt: Replace #if OPENSSL_VERSION_NUMBER with more explicit checks

8 years agolib-dcrypt: Move most of the OpenSSL #if handling to macros
Timo Sirainen [Sat, 25 Feb 2017 19:41:03 +0000 (21:41 +0200)] 
lib-dcrypt: Move most of the OpenSSL #if handling to macros

This avoids #if calls being littered all over the file.

This change can cause HMAC_CTX_free(NULL) to be called, but that seems to
work fine without crashing.

8 years agolib: Fix t_strf*time() unit tests
Timo Sirainen [Sun, 26 Feb 2017 13:37:36 +0000 (15:37 +0200)] 
lib: Fix t_strf*time() unit tests

Timezone isn't part of the standard struct tm, so %z doesn't necessarily
expand as expected outside Linux.

8 years agodsync: Fix syncing attributes with large values.
Timo Sirainen [Sun, 26 Feb 2017 13:21:13 +0000 (15:21 +0200)] 
dsync: Fix syncing attributes with large values.

This mainly meant that large Sieve scripts weren't synced properly, because
their last_change field was never deserialized, so it was set to 0.

8 years agolazy-expunge: Use mailbox_move() instead of mailbox_copy()
Timo Sirainen [Sun, 26 Feb 2017 12:32:44 +0000 (14:32 +0200)] 
lazy-expunge: Use mailbox_move() instead of mailbox_copy()

This allows some optimizations to be performed that are only possible when
moving messages.

It's slightly strange now that mail_expunge() is triggered twice for the
same source mail, but lazy_expunge plugin is called very early so most
plugins won't see it called twice. Currently only acl plugin sees it, and
it doesn't care.

8 years agomail-filter: Add missing error handling in ostream-ext-filter
Timo Sirainen [Fri, 24 Feb 2017 10:27:02 +0000 (12:27 +0200)] 
mail-filter: Add missing error handling in ostream-ext-filter

8 years agoauth: Removed dead code from oauth2 mechanism
Timo Sirainen [Fri, 24 Feb 2017 10:17:21 +0000 (12:17 +0200)] 
auth: Removed dead code from oauth2 mechanism

8 years agoacl plugin: Fix Coverity warning
Timo Sirainen [Fri, 24 Feb 2017 10:13:36 +0000 (12:13 +0200)] 
acl plugin: Fix Coverity warning

Just switch the MALLOC_ADD() parameters, so that arithmetic doesn't get
inside a sizeof().

8 years agolib-http: client: Fixed i_unreached() failure occurring when a host's list of IPs...
Stephan Bosch [Thu, 23 Feb 2017 18:38:31 +0000 (19:38 +0100)] 
lib-http: client: Fixed i_unreached() failure occurring when a host's list of IPs changes while a connection is still pending.

In that case, the IP of the pending connection may no longer be associated with that host.
If the IP was not found anymore, the i_unreached() error occurred.

8 years agoauth: Export oauth2 pass_attrs to passdb reply
Aki Tuomi [Thu, 23 Feb 2017 09:29:17 +0000 (11:29 +0200)] 
auth: Export oauth2 pass_attrs to passdb reply

8 years agovirtual: Include virtual mailbox name in "Mailbox ID unexpectedly lost" error
Timo Sirainen [Wed, 22 Feb 2017 23:24:43 +0000 (01:24 +0200)] 
virtual: Include virtual mailbox name in "Mailbox ID unexpectedly lost" error

8 years agolib-storage: Allow mail_storage_set_error() to use existing error_string
Timo Sirainen [Wed, 22 Feb 2017 13:29:34 +0000 (15:29 +0200)] 
lib-storage: Allow mail_storage_set_error() to use existing error_string

Fixes some code that may be attempting to copy an error from one storage to
another, but actually ends up trying to copy within the same storage.

8 years agolib-mail: istream-attachment-connector now allows msg_size=-1 for "unknown".
Timo Sirainen [Tue, 1 Nov 2016 16:43:57 +0000 (18:43 +0200)] 
lib-mail: istream-attachment-connector now allows msg_size=-1 for "unknown".

8 years agolib-mail: Make sure istream-attachment-connector detects wrong mail size.
Timo Sirainen [Tue, 1 Nov 2016 16:42:31 +0000 (18:42 +0200)] 
lib-mail: Make sure istream-attachment-connector detects wrong mail size.

8 years agolib-mail: Fix memory leak in test-istream-attachment
Timo Sirainen [Fri, 23 Dec 2016 19:15:49 +0000 (14:15 -0500)] 
lib-mail: Fix memory leak in test-istream-attachment

8 years agolib-mail: Improve istream-attachment-extractor unit test for EIO errors
Timo Sirainen [Fri, 23 Dec 2016 18:08:59 +0000 (13:08 -0500)] 
lib-mail: Improve istream-attachment-extractor unit test for EIO errors

8 years agolib-mail: istream-attachment-extractor - use EIO for internal errors
Timo Sirainen [Fri, 23 Dec 2016 17:59:13 +0000 (12:59 -0500)] 
lib-mail: istream-attachment-extractor - use EIO for internal errors

These happen only if the attachment writing failed for some reason.
The input stream itself can't have any errors, so EINVAL isn't proper.

8 years agolib-mail: istream-attachment-extractor - remove unnecessary code
Timo Sirainen [Fri, 23 Dec 2016 17:56:24 +0000 (12:56 -0500)] 
lib-mail: istream-attachment-extractor - remove unnecessary code

It's enough to set the stream_errno.

8 years agolib: Added i_stream_create_min_sized*()
Timo Sirainen [Tue, 1 Nov 2016 16:35:48 +0000 (18:35 +0200)] 
lib: Added i_stream_create_min_sized*()

8 years agolib: istream-sized - consistently set stream_errno=EINVAL if stream is too large
Timo Sirainen [Fri, 23 Dec 2016 17:52:45 +0000 (12:52 -0500)] 
lib: istream-sized - consistently set stream_errno=EINVAL if stream is too large

Earlier it was sometimes done and sometimes not, depending on whether the
parent istream happened to stop at the expected boundary.

8 years agolib: istream-sized - set stream_errno=EPIPE if stream is too small
Timo Sirainen [Fri, 23 Dec 2016 17:51:41 +0000 (12:51 -0500)] 
lib: istream-sized - set stream_errno=EPIPE if stream is too small

8 years agolib: istream-sized - remove explicit i_error() logging
Timo Sirainen [Fri, 23 Dec 2016 17:26:17 +0000 (12:26 -0500)] 
lib: istream-sized - remove explicit i_error() logging

The stream_errno is set, so it's the caller's responsibility to log the
error. There's no need to log it twice.

8 years agolib: istream-sized should log errors with its own name, not parent's name
Timo Sirainen [Mon, 16 May 2016 17:17:41 +0000 (20:17 +0300)] 
lib: istream-sized should log errors with its own name, not parent's name

8 years agolib: remove failed bool from sized_istream struct
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

8 years agolib: Added i_stream_create_sized_range()
Timo Sirainen [Tue, 1 Nov 2016 12:47:05 +0000 (14:47 +0200)] 
lib: Added i_stream_create_sized_range()

This is just a small wrapper to i_stream_create_sized() to specify stream's
start offset.

8 years agomaildir: Fix checking vsize caching decision in "is this pop3 user?"
Timo Sirainen [Wed, 22 Feb 2017 18:05:16 +0000 (20:05 +0200)] 
maildir: Fix checking vsize caching decision in "is this pop3 user?"

If vsize extension is used, it's practically the same as if vsize's caching
decision was YES.

8 years agopop3c: Remove unnecessarily duplicated code setting vsize to cache
Timo Sirainen [Wed, 22 Feb 2017 18:04:28 +0000 (20:04 +0200)] 
pop3c: Remove unnecessarily duplicated code setting vsize to cache

This is important now that the vsize can be added also to index's vsize
extension.

8 years agopop3c: Prefetched streams didn't call istream_opened() or set virtual_size
Timo Sirainen [Wed, 22 Feb 2017 18:03:43 +0000 (20:03 +0200)] 
pop3c: Prefetched streams didn't call istream_opened() or set virtual_size

8 years agotrash plugin: Use correct hook for overriding mail_user vfuncs
Timo Sirainen [Wed, 22 Feb 2017 15:45:34 +0000 (17:45 +0200)] 
trash plugin: Use correct hook for overriding mail_user vfuncs

This was always wrong to do, and it crashes after
f32382d2da479a4371e08c443679528db37ea988

8 years agoexpire plugin: Use correct hook for overriding mail_user vfuncs
Timo Sirainen [Wed, 22 Feb 2017 15:21:56 +0000 (17:21 +0200)] 
expire plugin: Use correct hook for overriding mail_user vfuncs

This was always wrong to do, and it crashes after
f32382d2da479a4371e08c443679528db37ea988

8 years agolazy-expunge: Fix error handling for GUID lookups
Timo Sirainen [Wed, 22 Feb 2017 13:32:19 +0000 (15:32 +0200)] 
lazy-expunge: Fix error handling for GUID lookups

If the mail is already expunged, the error should be ignored.
In other situations the original error string should be preserved as
part of the logged error message.

8 years agolib-storage: Add missing service_user ref when creating shared mailbox's user.
Timo Sirainen [Wed, 22 Feb 2017 14:09:07 +0000 (16:09 +0200)] 
lib-storage: Add missing service_user ref when creating shared mailbox's user.

Was forgotten from d1bf4ae66b8bf3b9e28df1823d6d4adda2b923b6

Fixes:
Panic: file mail-storage-service.c: line 1513 (mail_storage_service_user_unref): assertion failed: (user->refcount > 0)

8 years agolib-mail: Fix message_part_data_is_plain_7bit()
Timo Sirainen [Mon, 30 Jan 2017 19:53:01 +0000 (21:53 +0200)] 
lib-mail: Fix message_part_data_is_plain_7bit()

Content-Type parameters weren't handled exactly right.
Broken by recent changes.

8 years agoquota: Don't log "Internal quota calculation error"
Timo Sirainen [Wed, 22 Feb 2017 11:02:27 +0000 (13:02 +0200)] 
quota: Don't log "Internal quota calculation error"

It's not very informative and we can't give a better error message without
changing the APIs. The real error should have been logged already anyway,
so this is just duplication of an error. I think originally this was added
because some backend forgot to log an error.

8 years agoglobal: Replace mail_storage_service_user_free() with _unref()
Timo Sirainen [Wed, 22 Feb 2017 11:30:00 +0000 (13:30 +0200)] 
global: Replace mail_storage_service_user_free() with _unref()

8 years agolib-storage: Use refcounting for mail_storage_service_user
Timo Sirainen [Wed, 22 Feb 2017 11:28:43 +0000 (13:28 +0200)] 
lib-storage: Use refcounting for mail_storage_service_user

doveadm import was freeing the user too early, which resulted
mail_user._service_user pointing to freed memory. More importantly,
after 34512eaad8b1b2f929e6d6e3a2f7252c29fba97b user->set was pointing
to already freed memory.

8 years agolib-lda: Fix pigeonhole testsuite to not crash
Timo Sirainen [Wed, 22 Feb 2017 08:44:00 +0000 (10:44 +0200)] 
lib-lda: Fix pigeonhole testsuite to not crash

8 years agolib: Fix again test-utc-mktime with 32bit time_t
Timo Sirainen [Tue, 21 Feb 2017 20:34:14 +0000 (22:34 +0200)] 
lib: Fix again test-utc-mktime with 32bit time_t

8 years agolib-lda: Fix delivery logging when Sieve performs multiple actions
Timo Sirainen [Tue, 21 Feb 2017 10:38:10 +0000 (12:38 +0200)] 
lib-lda: Fix delivery logging when Sieve performs multiple actions

Previous code assumed that it would work like:
 - save/copy
 - transaction commit
 - mail_deliver_ctx_get_log_var_expand_table()
 - repeat for transaction 2

While it really works:
 - transaction 1: save/copy
 - transaction 2: save/copy
 - transaction 1: commit
 - mail_deliver_ctx_get_log_var_expand_table()
 - transaction 2: commit
 - mail_deliver_ctx_get_log_var_expand_table()

So the cache needs to be stored per transaction. This code still wouldn't
work correctly if Sieve saved mails multiple times within the same
transaction, but that doesn't happen (at least currently).

8 years agolib-lda: Refactor - mail_deliver_log_update_cache() doesn't need entire deliver_ctx
Timo Sirainen [Tue, 21 Feb 2017 10:36:52 +0000 (12:36 +0200)] 
lib-lda: Refactor - mail_deliver_log_update_cache() doesn't need entire deliver_ctx

8 years agolib-lda: Refactor - Add struct mail_deliver_mailbox
Timo Sirainen [Tue, 21 Feb 2017 10:34:59 +0000 (12:34 +0200)] 
lib-lda: Refactor - Add struct mail_deliver_mailbox

8 years agolib: Fix test-utc-mktime with 32bit time_t
Timo Sirainen [Tue, 21 Feb 2017 17:55:48 +0000 (19:55 +0200)] 
lib: Fix test-utc-mktime with 32bit time_t

8 years agolib-mail: Place input/output of message-date tests in one struct
Martti Rannanjärvi [Tue, 21 Feb 2017 14:25:48 +0000 (16:25 +0200)] 
lib-mail: Place input/output of message-date tests in one struct

Define both input and output of a message date test case in a single
struct so it is easier to follow and less error prone. Also add some
leap second tests.

8 years agolib: Place input/output of utc_mktime tests in one struct
Martti Rannanjärvi [Tue, 21 Feb 2017 15:00:14 +0000 (17:00 +0200)] 
lib: Place input/output of utc_mktime tests in one struct

Define both input and output of a utc_mktime test case in a single
struct so it is easier to follow and less error prone.

8 years agolib: Accept leap second in utc_mktime
Martti Rannanjärvi [Tue, 21 Feb 2017 14:25:25 +0000 (16:25 +0200)] 
lib: Accept leap second in utc_mktime

Accept leap second at any time in utc_mktime since utc_mktime is being
used before applying the timezone offset everywhere.