]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Mon, 27 Mar 2017 10:44:13 +0000 (13:44 +0300)]
cassandra: Fallback consistency fix - it wasn't used permanently
Because the "do I want to retry using primary consistency?" check was done
using the first failure timestamp, after 60 seconds that check always
returned TRUE. We should instead be checking the last timestamp for a
query that was sent with the primary consistency.
Timo Sirainen [Mon, 27 Mar 2017 10:33:18 +0000 (13:33 +0300)]
cassandra: Fallback consistency fix - max retry interval was set wrong
The maximum msecs is _MAX_RETRY_MSECS, not _FIRST_RETRY_MSECS
Stephan Bosch [Sun, 26 Mar 2017 17:08:18 +0000 (19:08 +0200)]
lib-http: client: Fix aborting a request that has a delayed error.
Caused by recent changes in delayed error handling.
Timo Sirainen [Sun, 19 Mar 2017 13:35:14 +0000 (15:35 +0200)]
imapc: Add imapc_features=delay-login
The connection to imapc_host is delayed until it's actually needed to be
performed.
Timo Sirainen [Sun, 19 Mar 2017 13:34:20 +0000 (15:34 +0200)]
imap: Remove imapc-specific "is connection valid?" code
This is now done by imapc itself in the previous patch
Timo Sirainen [Sun, 19 Mar 2017 13:32:53 +0000 (15:32 +0200)]
imapc: Fail user creation if login to imapc_host fails.
This causes imapc to actually wait for the login to succeed or fail.
Such a wait was already done by the imap code, which will be removed by
the next patch.
Aki Tuomi [Sat, 25 Mar 2017 13:46:58 +0000 (15:46 +0200)]
quota: Add backend register/unregister
This way, other mail plugins can register their own
quota backends.
Timo Sirainen [Fri, 24 Mar 2017 12:46:05 +0000 (14:46 +0200)]
lib-mail: Fix read overflow / crash in message_header_decode()
If the input string was "=?charset?Q|B?text?", the code attempted to look up
the character after it. And if it was "=", the callback was called with
size=-1, which ends up in a crash.
Martti Rannanjärvi [Tue, 29 Nov 2016 07:38:21 +0000 (09:38 +0200)]
ssl: deprecate no_compression in ssl_options
Compression is now disabled by default.
Martti Rannanjärvi [Fri, 16 Dec 2016 20:18:02 +0000 (22:18 +0200)]
doc: mention no_ticket in ssl config example
Martti Rannanjärvi [Fri, 16 Dec 2016 20:25:38 +0000 (22:25 +0200)]
doc: remove obsolete ssl_dh_parameters_length from example config
Martti Rannanjärvi [Mon, 19 Dec 2016 09:59:18 +0000 (11:59 +0200)]
ssl: change to more secure default ssl_cipher_list
Timo Sirainen [Thu, 23 Mar 2017 18:16:44 +0000 (20:16 +0200)]
imap-login: Move forward_fields updating code to login-common
This allows using the new client_add_forward_field() in e.g. plugins.
Timo Sirainen [Fri, 24 Mar 2017 02:21:49 +0000 (04:21 +0200)]
lib-storage: Fix mail_user_autoexpunge() return value to be initialized properly
Timo Sirainen [Thu, 23 Mar 2017 12:27:28 +0000 (14:27 +0200)]
lib-storage: Change mail_user_autoexpunge() to return number of autoexpunged mails
Timo Sirainen [Thu, 23 Mar 2017 12:19:42 +0000 (14:19 +0200)]
lmtp: Trigger autoexpunging only for the last RCPT TO.
Otherwise if the autoexpunging takes a long time, the LMTP client could
disconnect due to a timeout. The mails would still eventually get delivered
though, so it would result in duplicate mails being delivered.
An alternative to this would be to keep all the mail_users referenced until
the delivery is finished and then autoexpunge all of them at the end. It
increases memory usage though and complicates the code, so at least for now
it's not implemented.
Timo Sirainen [Thu, 23 Mar 2017 12:15:49 +0000 (14:15 +0200)]
lib-storage: Replace MAIL_STORAGE_SERVICE_FLAG_AUTOEXPUNGE with explicit mail_user_autoexpunge()
This allows better control of which users are being autoexpunged. This
patch changes behavior at least in two ways now:
1) After shared folder access, the owner user isn't autoexpunged at deinit.
Although this is a bit questionable of whether it should be or not.
2) LMTP's quota check at RCPT TO stage doesn't trigger autoexpunging.
Timo Sirainen [Thu, 23 Mar 2017 12:08:53 +0000 (14:08 +0200)]
pop3: Start autoexpunging only after client is disconnected
Aki Tuomi [Thu, 23 Mar 2017 13:17:44 +0000 (15:17 +0200)]
var-expand-crypt: Remove pointless assigment
It's never used
Aki Tuomi [Thu, 23 Mar 2017 13:12:45 +0000 (15:12 +0200)]
var-expand-crypt: Fix base64 encoding
the break was missing, also removed confusing block.
Martti Rannanjärvi [Thu, 16 Mar 2017 09:15:18 +0000 (11:15 +0200)]
global: Log internal storage error on failure
Martti Rannanjärvi [Fri, 17 Mar 2017 07:23:00 +0000 (09:23 +0200)]
lmtp: Log internal error on STATUS_CHECK_OVER_QUOTA failure
Martti Rannanjärvi [Thu, 16 Mar 2017 09:12:29 +0000 (11:12 +0200)]
lib-storage: Add mail_storage_get_last_internal_error()
This returns the error given to mail_storage_set_critical().
Martti Rannanjärvi [Wed, 22 Mar 2017 16:02:37 +0000 (18:02 +0200)]
quota: Use mail_user_plugin_getenv_bool to get quota_vsizes
Martti Rannanjärvi [Wed, 22 Mar 2017 15:17:41 +0000 (17:17 +0200)]
quota: Add quota_max_mail_size setting
Martti Rannanjärvi [Thu, 23 Mar 2017 08:16:30 +0000 (10:16 +0200)]
quota: Use quota_alloc_result in quota_settings.test_alloc
Martti Rannanjärvi [Thu, 23 Mar 2017 11:48:04 +0000 (13:48 +0200)]
quota: Introduce quota_alloc_result return type
Timo Sirainen [Thu, 23 Mar 2017 13:05:12 +0000 (15:05 +0200)]
dbox: Allow ":" separator between mail_attachment_fs driver and args.
The ":" separator is nowadays commonly used elsewhere for the separator,
so it should work here as well.
Aki Tuomi [Sun, 25 Dec 2016 08:36:59 +0000 (10:36 +0200)]
lib: Add tests for extensions
Aki Tuomi [Fri, 18 Nov 2016 12:47:05 +0000 (14:47 +0200)]
var-expand-crypt: Encryption/decryption support for var-expand
Registers new encrypt and decrypt processors for
var-expand.
Aki Tuomi [Fri, 18 Nov 2016 07:39:46 +0000 (09:39 +0200)]
lib: Add extension support for var-expand
This enables loading new var-expand features
using plugins.
Aki Tuomi [Wed, 22 Mar 2017 17:33:52 +0000 (19:33 +0200)]
lib: Check var_expand_long return value correctly
Aki Tuomi [Tue, 22 Nov 2016 08:54:43 +0000 (10:54 +0200)]
lib: Fix whitespace in var-expand.c
Aki Tuomi [Sat, 25 Feb 2017 21:34:03 +0000 (23:34 +0200)]
lib-storage: Add and use default mailbox iterator
The idea is to allow mail plugins to see also the non-existent
autoboxes by feeding them thru the iterator.
Fixes problem where autocreated boxes are not seen by ACL
plugin.
Aki Tuomi [Tue, 21 Mar 2017 11:14:41 +0000 (13:14 +0200)]
lib-storage: Expose mailbox_list_init_autocreate
It is needed when backend_ctx is created on the fly
Aki Tuomi [Sat, 25 Feb 2017 21:33:20 +0000 (23:33 +0200)]
acl: Use MODULE_CONTEXT for mailbox list iterator
Aki Tuomi [Sat, 25 Feb 2017 21:59:21 +0000 (23:59 +0200)]
acl: Use mailbox_list_context instead of ctx->ctx
This prepares for the next commit
Aki Tuomi [Wed, 22 Mar 2017 10:01:18 +0000 (12:01 +0200)]
lib-dict: Ensure all iterations and transactions are done in deinit
Aki Tuomi [Wed, 22 Mar 2017 10:01:07 +0000 (12:01 +0200)]
lib-dict: Track transaction counts
Aki Tuomi [Wed, 22 Mar 2017 08:33:20 +0000 (10:33 +0200)]
lib-dict: Fix test-dict linkage
Aki Tuomi [Wed, 22 Mar 2017 08:32:58 +0000 (10:32 +0200)]
lib-dict: Use dict-fail iterator and transaction when missing from dict driver
Aki Tuomi [Wed, 22 Mar 2017 10:05:32 +0000 (12:05 +0200)]
dict: Update correct counter in dict_iterate_init
Aki Tuomi [Wed, 22 Mar 2017 08:32:04 +0000 (10:32 +0200)]
lib-dict: Add dict-fail driver
It can be used for providing various failures
Martti Rannanjärvi [Fri, 17 Mar 2017 10:58:08 +0000 (12:58 +0200)]
global: Log mailbox_list internal errors
Martti Rannanjärvi [Fri, 17 Mar 2017 10:38:21 +0000 (12:38 +0200)]
lib-storage: Add mailbox_list_get_last_internal_error()
This returns the error given to mailbox_list_set_critical().
Martti Rannanjärvi [Wed, 22 Mar 2017 21:19:51 +0000 (23:19 +0200)]
lib: Download unicode.org files from dovecot.org
Stephan Bosch [Fri, 17 Mar 2017 22:39:33 +0000 (23:39 +0100)]
lib-http: client: Implemented http_client_request_url_str() function that accepts an URL string rather than a pre-parsed URL object.
If the provided HTTP URL is invalid, the callback with the error is called some time later from the ioloop.
This change also amends the test-http-client-errors test suite with a new test for this new feature.
Stephan Bosch [Fri, 17 Mar 2017 22:51:19 +0000 (23:51 +0100)]
lib-http: client: Make sure a request's log label never gets a duplicate request target part.
Make sure the URL part of the label always only consists of a http://host:port part and nothing more.
Stephan Bosch [Fri, 17 Mar 2017 22:35:55 +0000 (23:35 +0100)]
lib-http: client: Restructured the handling of delayed errors.
The req->delayed_error* fields are cleared before the callback is called and before the request is dereferenced.
This way, freeing the request never removes it from the delayed request list when the list is being processed.
It also makes it possible to resubmit the request from the callback (mainly for future use).
Stephan Bosch [Fri, 17 Mar 2017 22:18:52 +0000 (23:18 +0100)]
lib-http: client: Clear request pointer immediately in http_client_request_error().
Stephan Bosch [Fri, 17 Mar 2017 22:00:42 +0000 (23:00 +0100)]
lib-http: test-http-client-errors: Added test for using https:// while SSL is not configured.
Stephan Bosch [Sun, 19 Mar 2017 14:47:41 +0000 (15:47 +0100)]
global: Use http_response_get_message() to log HTTP responses.
Stephan Bosch [Sun, 19 Mar 2017 14:09:03 +0000 (15:09 +0100)]
lib-http: Added a function to obtain a message suitable for logging from a response object.
This prevents logging internal error codes (>= 9000).
Stephan Bosch [Sun, 19 Mar 2017 14:06:13 +0000 (15:06 +0100)]
lib-http: Explicitly define the start of the range of internal response status codes.
Stephan Bosch [Fri, 17 Mar 2017 22:03:03 +0000 (23:03 +0100)]
lib-http: test-http-client-errors: Always use the proper error status code definitions rather than an integer literal.
Aki Tuomi [Wed, 22 Mar 2017 07:03:20 +0000 (09:03 +0200)]
doveadm: Send and receive exit codes correctly
The old code would assume TEMPFAIL for almost everything.
Aki Tuomi [Wed, 22 Mar 2017 17:21:55 +0000 (19:21 +0200)]
doveadm: Add exit code/string conversion functions
Aki Tuomi [Mon, 20 Mar 2017 18:22:36 +0000 (20:22 +0200)]
Aki Tuomi [Mon, 20 Mar 2017 18:21:56 +0000 (20:21 +0200)]
lib-dict: Ensure init returns dict
Aki Tuomi [Fri, 10 Mar 2017 08:05:14 +0000 (10:05 +0200)]
pop3-login: Add FORWARD for XCLIENT
This allows passing passdb variables. They are prefixed
with forward_ when imported to extra fields.
Aki Tuomi [Fri, 10 Mar 2017 08:04:33 +0000 (10:04 +0200)]
pop3-login: Pass forward_ passdb args using XCLIENT command
Aki Tuomi [Mon, 20 Feb 2017 18:37:09 +0000 (20:37 +0200)]
imap-login: Allow x-forward- to specify forward fields from trusted networks
Aki Tuomi [Mon, 20 Feb 2017 18:36:58 +0000 (20:36 +0200)]
auth: Accept forward_fields from auth client
Aki Tuomi [Thu, 16 Mar 2017 11:36:23 +0000 (13:36 +0200)]
auth: Add auth_fields_import_prefixed
Aki Tuomi [Tue, 14 Mar 2017 08:01:51 +0000 (10:01 +0200)]
auth: Support client_id variable
When imap_id_retain is turned on, contains
the client ID request content with dovecot
special vars removed.
Aki Tuomi [Thu, 16 Mar 2017 08:01:23 +0000 (10:01 +0200)]
imap-login: Forward original client ID to next hop
This will be done if ID is present.
Aki Tuomi [Mon, 20 Feb 2017 17:11:01 +0000 (19:11 +0200)]
imap-login: Retain ID request without dovecot specials
Aki Tuomi [Tue, 21 Feb 2017 12:46:31 +0000 (14:46 +0200)]
imap-login: Add option to retain client id
This should be enabled if client_id is wanted for auth policy
Aki Tuomi [Mon, 20 Feb 2017 16:58:21 +0000 (18:58 +0200)]
auth: Accept client_id from auth client
Client ID contains the ID client request string
for IMAP.
Aki Tuomi [Thu, 9 Mar 2017 12:08:40 +0000 (14:08 +0200)]
login-common: Add preproxy pool
preproxy pool can be used to do allocations that are released
once proxying starts.
Timo Sirainen [Sat, 28 Jan 2017 23:03:00 +0000 (01:03 +0200)]
imapc: Use LOGOUT to cleanly disconnect from server.
This makes it clearer in the remote server's logs whether the disconnection
was intentional or not.
Use a hardcoded 5 second timeout for LOGOUT. It should be enough time for
the server to finish sending the tagged reply.
Timo Sirainen [Thu, 16 Mar 2017 16:46:28 +0000 (18:46 +0200)]
lib-storage: Don't reset \Recent flags when rebuilding index
The recent flags are tracked with first_recent_uid in the header. If the
first_recent_uid is valid in the old index, preserve it. This way all
mails don't show as having \Recent flag.
This was used by sdbox and mdbox code.
Aki Tuomi [Thu, 16 Mar 2017 07:38:59 +0000 (09:38 +0200)]
trash: Move config file to trash user
Makes static analyser happy
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.
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.
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.
Aki Tuomi [Thu, 16 Mar 2017 07:36:23 +0000 (09:36 +0200)]
lib-dcrypt: Add asserts
Fixes several static analysis reports
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.
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.
Timo Sirainen [Wed, 8 Mar 2017 22:09:12 +0000 (17:09 -0500)]
pop3: Add client.destroyed boolean
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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
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".
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.
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.
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
Timo Sirainen [Thu, 9 Mar 2017 16:32:21 +0000 (11:32 -0500)]
*-login: Remove unused client.proxy_state
Timo Sirainen [Thu, 9 Mar 2017 15:48:33 +0000 (10:48 -0500)]
pop3-login: Remove usage of client.common.proxy_state