]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agolib: Add uuid support to guid
Aki Tuomi [Tue, 7 Mar 2017 11:32:15 +0000 (13:32 +0200)] 
lib: Add uuid support to guid

8 years agomail-log: Differentiate autoexpunges from expunges
Aki Tuomi [Thu, 23 Mar 2017 12:09:01 +0000 (14:09 +0200)] 
mail-log: Differentiate autoexpunges from expunges

8 years agolib-storage: Indicate mail is being autoexpunged
Aki Tuomi [Thu, 23 Mar 2017 12:08:30 +0000 (14:08 +0200)] 
lib-storage: Indicate mail is being autoexpunged

This way plugins, such as mail_log, can detect this.

8 years agoconfig: Don't stop the process due to idling.
Timo Sirainen [Mon, 27 Mar 2017 12:28:01 +0000 (15:28 +0300)] 
config: Don't stop the process due to idling.

If the config process restarts, it also reloads configuration. We'd rather
want the configuration reloads to always be explicit.

8 years agocassandra: Fallback consistency fix - it wasn't used permanently
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.

8 years agocassandra: Fallback consistency fix - max retry interval was set wrong
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

8 years agolib-http: client: Fix aborting a request that has a delayed error.
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.

8 years agoimapc: Add imapc_features=delay-login
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.

8 years agoimap: Remove imapc-specific "is connection valid?" code
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

8 years agoimapc: Fail user creation if login to imapc_host fails.
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.

8 years agoquota: Add backend register/unregister
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.

8 years agolib-mail: Fix read overflow / crash in message_header_decode()
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.

8 years agodoc: mention no_ticket in ssl config example
Martti Rannanjärvi [Fri, 16 Dec 2016 20:18:02 +0000 (22:18 +0200)] 
doc: mention no_ticket in ssl config example

8 years agoimap-login: Move forward_fields updating code to login-common
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.

8 years agolib-storage: Fix mail_user_autoexpunge() return value to be initialized properly
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

8 years agolib-storage: Change mail_user_autoexpunge() to return number of autoexpunged mails
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

8 years agolmtp: Trigger autoexpunging only for the last RCPT TO.
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.

8 years agolib-storage: Replace MAIL_STORAGE_SERVICE_FLAG_AUTOEXPUNGE with explicit mail_user_au...
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.

8 years agopop3: Start autoexpunging only after client is disconnected
Timo Sirainen [Thu, 23 Mar 2017 12:08:53 +0000 (14:08 +0200)] 
pop3: Start autoexpunging only after client is disconnected

8 years agoglobal: Log internal storage error on failure
Martti Rannanjärvi [Thu, 16 Mar 2017 09:15:18 +0000 (11:15 +0200)] 
global: Log internal storage error on failure

8 years agolmtp: Log internal error on STATUS_CHECK_OVER_QUOTA 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

8 years agolib-storage: Add mail_storage_get_last_internal_error()
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().

8 years agoquota: Add quota_max_mail_size setting
Martti Rannanjärvi [Wed, 22 Mar 2017 15:17:41 +0000 (17:17 +0200)] 
quota: Add quota_max_mail_size setting

8 years agoquota: Use quota_alloc_result in quota_settings.test_alloc
Martti Rannanjärvi [Thu, 23 Mar 2017 08:16:30 +0000 (10:16 +0200)] 
quota: Use quota_alloc_result in quota_settings.test_alloc

8 years agoquota: Introduce quota_alloc_result return type
Martti Rannanjärvi [Thu, 23 Mar 2017 11:48:04 +0000 (13:48 +0200)] 
quota: Introduce quota_alloc_result return type

8 years agodbox: Allow ":" separator between mail_attachment_fs driver and args.
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.

8 years agolib: Fix whitespace in var-expand.c
Aki Tuomi [Tue, 22 Nov 2016 08:54:43 +0000 (10:54 +0200)] 
lib: Fix whitespace in var-expand.c

8 years agolib-storage: Add and use default mailbox iterator
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.

8 years agolib-storage: Expose mailbox_list_init_autocreate
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

8 years agoacl: Use MODULE_CONTEXT for mailbox list iterator
Aki Tuomi [Sat, 25 Feb 2017 21:33:20 +0000 (23:33 +0200)] 
acl: Use MODULE_CONTEXT for mailbox list iterator

8 years agoacl: Use mailbox_list_context instead of ctx->ctx
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

8 years agolib-dict: Ensure all iterations and transactions are done in deinit
Aki Tuomi [Wed, 22 Mar 2017 10:01:18 +0000 (12:01 +0200)] 
lib-dict: Ensure all iterations and transactions are done in deinit

8 years agolib-dict: Track transaction counts
Aki Tuomi [Wed, 22 Mar 2017 10:01:07 +0000 (12:01 +0200)] 
lib-dict: Track transaction counts

8 years agolib-dict: Fix test-dict linkage
Aki Tuomi [Wed, 22 Mar 2017 08:33:20 +0000 (10:33 +0200)] 
lib-dict: Fix test-dict linkage

8 years agolib-dict: Use dict-fail iterator and transaction when missing from dict driver
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

8 years agodict: Update correct counter in dict_iterate_init
Aki Tuomi [Wed, 22 Mar 2017 10:05:32 +0000 (12:05 +0200)] 
dict: Update correct counter in dict_iterate_init

8 years agolib-dict: Add dict-fail driver
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

8 years agoglobal: Log mailbox_list internal errors
Martti Rannanjärvi [Fri, 17 Mar 2017 10:58:08 +0000 (12:58 +0200)] 
global: Log mailbox_list internal errors

8 years agolib-storage: Add mailbox_list_get_last_internal_error()
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().

8 years agolib: Download unicode.org files from dovecot.org
Martti Rannanjärvi [Wed, 22 Mar 2017 21:19:51 +0000 (23:19 +0200)] 
lib: Download unicode.org files from dovecot.org

8 years agolib-http: client: Implemented http_client_request_url_str() function that accepts...
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.

8 years agolib-http: client: Make sure a request's log label never gets a duplicate request...
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.

8 years agolib-http: client: Restructured the handling of delayed errors.
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).

8 years agolib-http: client: Clear request pointer immediately in http_client_request_error().
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().

8 years agolib-http: test-http-client-errors: Added test for using https:// while SSL is not...
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.

8 years agoglobal: Use http_response_get_message() to log HTTP responses.
Stephan Bosch [Sun, 19 Mar 2017 14:47:41 +0000 (15:47 +0100)] 
global: Use http_response_get_message() to log HTTP responses.

8 years agolib-http: Added a function to obtain a message suitable for logging from a response...
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).

8 years agolib-http: Explicitly define the start of the range of internal response status codes.
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.

8 years agolib-http: test-http-client-errors: Always use the proper error status code definition...
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.

8 years agodoveadm: Send and receive exit codes correctly
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.

8 years agodoveadm: Add exit code/string conversion functions
Aki Tuomi [Wed, 22 Mar 2017 17:21:55 +0000 (19:21 +0200)] 
doveadm: Add exit code/string conversion functions

8 years agolib-lda: smtp-client: Fixed memory leak of the error message string.
Stephan Bosch [Thu, 2 Mar 2017 22:12:45 +0000 (23:12 +0100)] 
lib-lda: smtp-client: Fixed memory leak of the error message string.

8 years agolib-lda: smtp-client: Fixed cleanup of LMTP client at end of transaction.
Stephan Bosch [Thu, 2 Mar 2017 22:51:45 +0000 (23:51 +0100)] 
lib-lda: smtp-client: Fixed cleanup of LMTP client at end of transaction.

It was not deinitialized, causing a memory leak.

8 years agolib-smtp: lmtp-client: Fixed bug in timeout handling.
Stephan Bosch [Wed, 1 Mar 2017 23:42:13 +0000 (00:42 +0100)] 
lib-smtp: lmtp-client: Fixed bug in timeout handling.

The timeout was erroneously stopped when lmtp_client_send() was invoked before a connection was established.
Once the connection finally got established, the timeout was removed.
This would cause the client to wait indefinitely.

8 years agolib-lda: smtp-client: Make sure only the first error determines the tempfail status.
Stephan Bosch [Wed, 1 Mar 2017 23:03:50 +0000 (00:03 +0100)] 
lib-lda: smtp-client: Make sure only the first error determines the tempfail status.

The client is supposed to stop running the moment the first error occurs. However, there is a (very unlikely) possiblity that the encapsulated LMTP client issues both an RCPT and DATA error callback in sequence.
In that case, the second callback should not override the tempfail status of the first (the second likely is a tempfail).
If the server disconnects right after failing the last of at least two recipients, the lmtp-client would issue a DATA callback with a disconnection error.
The disconnect error would set the client->tempfail flag, which caused smtp_client_deinit*() to always return -1 in this scenario.

8 years agolib-lda: smtp-client: Renamed "smtp_client" parameters to "client" for consistency.
Stephan Bosch [Sat, 5 Nov 2016 21:00:09 +0000 (22:00 +0100)] 
lib-lda: smtp-client: Renamed "smtp_client" parameters to "client" for consistency.

8 years agolib: Add missing error handling to o_stream_cork()
Timo Sirainen [Tue, 21 Mar 2017 23:05:37 +0000 (01:05 +0200)] 
lib: Add missing error handling to o_stream_cork()

With ostream-file the corking could have called buffer_flush(), which could
have failed and set stream_errno, but nothing would set last_failed_errno.

Fixes:
Panic: file ostream.c: line 59 (o_stream_close_full): assertion failed: (stream->last_failed_errno != 0)

8 years agolib-dict: Ensure init returns dict
Aki Tuomi [Mon, 20 Mar 2017 18:21:56 +0000 (20:21 +0200)] 
lib-dict: Ensure init returns dict

8 years agopop3-login: Add FORWARD for XCLIENT
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.

8 years agopop3-login: Pass forward_ passdb args using XCLIENT command
Aki Tuomi [Fri, 10 Mar 2017 08:04:33 +0000 (10:04 +0200)] 
pop3-login: Pass forward_ passdb args using XCLIENT command

8 years agoimap-login: Allow x-forward- to specify forward fields from trusted networks
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

8 years agoauth: Accept forward_fields from auth client
Aki Tuomi [Mon, 20 Feb 2017 18:36:58 +0000 (20:36 +0200)] 
auth: Accept forward_fields from auth client

8 years agoauth: Add auth_fields_import_prefixed
Aki Tuomi [Thu, 16 Mar 2017 11:36:23 +0000 (13:36 +0200)] 
auth: Add auth_fields_import_prefixed

8 years agoauth: Support client_id variable
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.

8 years agoimap-login: Forward original client ID to next hop
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.

8 years agoimap-login: Retain ID request without dovecot specials
Aki Tuomi [Mon, 20 Feb 2017 17:11:01 +0000 (19:11 +0200)] 
imap-login: Retain ID request without dovecot specials

8 years agoimap-login: Add option to retain client id
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

8 years agoauth: Accept client_id from auth client
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.

8 years agologin-common: Add preproxy pool
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.

8 years agoimapc: Use LOGOUT to cleanly disconnect from server.
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.

8 years agolib-storage: Don't reset \Recent flags when rebuilding index
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.

8 years agotrash: Move config file to trash user
Aki Tuomi [Thu, 16 Mar 2017 07:38:59 +0000 (09:38 +0200)] 
trash: Move config file to trash user

Makes static analyser happy

8 years agolib-http: test-http-server-errors: Fixed logically dead code.
Stephan Bosch [Sun, 5 Mar 2017 18:45:04 +0000 (19:45 +0100)] 
lib-http: test-http-server-errors: Fixed logically dead code.

Problem reported by Coverity.

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.