]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agovar-expand-crypt: Add error handling for initialization
Aki Tuomi [Mon, 27 Mar 2017 06:39:03 +0000 (09:39 +0300)] 
var-expand-crypt: Add error handling for initialization

8 years agovar-expand-crypt: Do not free dcrypt context twice
Aki Tuomi [Mon, 27 Mar 2017 06:34:50 +0000 (09:34 +0300)] 
var-expand-crypt: Do not free dcrypt context twice

Found by coverity

8 years agotest-var-expand: Expect error
Aki Tuomi [Fri, 31 Mar 2017 12:30:58 +0000 (15:30 +0300)] 
test-var-expand: Expect error

8 years agovar-expand-crypt: Remove pointless assigment
Aki Tuomi [Thu, 23 Mar 2017 13:17:44 +0000 (15:17 +0200)] 
var-expand-crypt: Remove pointless assigment

It's never used

8 years agovar-expand-crypt: Fix base64 encoding
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.

8 years agovar-expand-crypt: Encryption/decryption support for var-expand
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.

8 years agolib: Add tests for extensions
Aki Tuomi [Sun, 25 Dec 2016 08:36:59 +0000 (10:36 +0200)] 
lib: Add tests for extensions

8 years agolib: Add extension support 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.

8 years agolib: Use error_r in var_expand_long and friends
Aki Tuomi [Mon, 27 Mar 2017 10:55:28 +0000 (13:55 +0300)] 
lib: Use error_r in var_expand_long and friends

This is aligment commit for extensions, and differs
from v2.3 so that error is reported in var_expand_with_funcs
since the public API is not changed.

8 years agolib-http: http_client_request_delay_from_response() should use per-request timeout...
Timo Sirainen [Thu, 30 Mar 2017 20:46:02 +0000 (23:46 +0300)] 
lib-http: http_client_request_delay_from_response() should use per-request timeout as max

It was using the global request_timeout_msecs for the maximum timeout,
which could be different from the per-request timeout set by
http_client_request_set_attempt_timeout_msecs().

8 years agolib-http: client: Fixed request-specific attempt timeout.
Stephan Bosch [Thu, 30 Mar 2017 20:29:13 +0000 (22:29 +0200)] 
lib-http: client: Fixed request-specific attempt timeout.

This is the timeout applied to a single request attempt. Using http_client_request_set_attempt_timeout_msecs() this can be set for a specific request.
However, this was mostly ignored for requests that weren't in the process of handling response payload.
Instead, the global request_timeout_msecs client setting was used.

Also amended the (currently manual) test suite with tests that demonstated the problem and now verify the fix.

8 years agolib-index: Use time_to_local_day_start() instead of reimplementing
Timo Sirainen [Tue, 28 Mar 2017 16:40:27 +0000 (19:40 +0300)] 
lib-index: Use time_to_local_day_start() instead of reimplementing

8 years agolib: Add time_to_local_day_start()
Timo Sirainen [Tue, 28 Mar 2017 16:14:00 +0000 (19:14 +0300)] 
lib: Add time_to_local_day_start()

8 years agolib-index: Code cleanup - expand LOG_WANT_ROTATE() macro
Timo Sirainen [Mon, 27 Mar 2017 14:44:45 +0000 (17:44 +0300)] 
lib-index: Code cleanup - expand LOG_WANT_ROTATE() macro

There was no reason it had to be a macro. Also this fixes off-by-one
error when checking for log_rotate_min_size.

8 years agotest: lib-http: Check write_full return value in test
Aki Tuomi [Fri, 17 Mar 2017 08:28:36 +0000 (10:28 +0200)] 
test: lib-http: Check write_full return value in test

Makes static analyzers happier

8 years agotest: fts-squat: Ignore gettimeofday return value in test
Aki Tuomi [Fri, 17 Mar 2017 08:26:50 +0000 (10:26 +0200)] 
test: fts-squat: Ignore gettimeofday return value in test

Makes static analyzers happier

8 years agotest: lib-index: Ensure conficts_seqs is created in test
Aki Tuomi [Fri, 17 Mar 2017 08:26:06 +0000 (10:26 +0200)] 
test: lib-index: Ensure conficts_seqs is created in test

Makes static analyzers happier

8 years agotest: lib: Ensure item is not null
Aki Tuomi [Fri, 17 Mar 2017 08:25:01 +0000 (10:25 +0200)] 
test: lib: Ensure item is not null

Makes static analyzers happier

8 years agotest: lib-fts: Ignore uni_utf8_get_valid_data return value
Aki Tuomi [Fri, 17 Mar 2017 08:19:17 +0000 (10:19 +0200)] 
test: lib-fts: Ignore uni_utf8_get_valid_data return value

Makes static analyzers happier

8 years agotest: mail-crypt: Check dcrypt_id_key_private_old return value
Aki Tuomi [Fri, 17 Mar 2017 08:17:59 +0000 (10:17 +0200)] 
test: mail-crypt: Check dcrypt_id_key_private_old return value

Makes static analyzers happier

8 years agotest: lib-http: Check o_stream_send return value
Aki Tuomi [Fri, 17 Mar 2017 08:16:11 +0000 (10:16 +0200)] 
test: lib-http: Check o_stream_send return value

Makes static analyzers happier

8 years agotest: lib: Check o_stream_send return value
Aki Tuomi [Fri, 17 Mar 2017 08:13:59 +0000 (10:13 +0200)] 
test: lib: Check o_stream_send return value

Make static analyzers happier

8 years agodriver-cassandra: Add metric for slow queries
Aki Tuomi [Mon, 27 Mar 2017 16:50:53 +0000 (19:50 +0300)] 
driver-cassandra: Add metric for slow queries

8 years agopush-notification-driver-ox: Wait for http requests to finish in deinit
Martti Rannanjärvi [Wed, 29 Mar 2017 17:04:47 +0000 (20:04 +0300)] 
push-notification-driver-ox: Wait for http requests to finish in deinit

This is to make sure mail_user is still usable in http response
callback.

8 years agodirector: Log vhost count changes and HOST-UP/DOWN
Martti Rannanjärvi [Thu, 30 Mar 2017 12:53:59 +0000 (15:53 +0300)] 
director: Log vhost count changes and HOST-UP/DOWN

8 years agomaster: When logging fork() EAGAIN failure, include current ulimit -u value
Timo Sirainen [Wed, 29 Mar 2017 22:42:53 +0000 (01:42 +0300)] 
master: When logging fork() EAGAIN failure, include current ulimit -u value

8 years agodoveadm dump log: Use shared lib-index code for updating modseq
Timo Sirainen [Mon, 27 Mar 2017 13:33:30 +0000 (16:33 +0300)] 
doveadm dump log: Use shared lib-index code for updating modseq

When MAIL_TRANSACTION_MODSEQ_UPDATE records were seen, the printed modseqs
afterwards weren't correct.

Now that mail_transaction_update_modseq() is used, we don't need to keep
this code synchronized with it.

8 years agodoveadm dump log: Cleanup - don't change hdr.size
Timo Sirainen [Mon, 27 Mar 2017 13:30:16 +0000 (16:30 +0300)] 
doveadm dump log: Cleanup - don't change hdr.size

Needed by the next commit.

8 years agodoveadm dump log: Use istream for reading the file.
Timo Sirainen [Mon, 27 Mar 2017 13:26:09 +0000 (16:26 +0300)] 
doveadm dump log: Use istream for reading the file.

Cleans up the code a bit and removes the 1MB record limit.

8 years agolib-storage: Fix potential dict transaction leak on transaction rollback.
Timo Sirainen [Wed, 29 Mar 2017 10:28:36 +0000 (13:28 +0300)] 
lib-storage: Fix potential dict transaction leak on transaction rollback.

8 years agolib-dict: Keep a linked list of all transactions in dict.
Timo Sirainen [Wed, 29 Mar 2017 10:27:32 +0000 (13:27 +0300)] 
lib-dict: Keep a linked list of all transactions in dict.

This helps debugging if a transaction is leaked.

8 years agoauth: Do not cache username unless it was changed by lookup
Aki Tuomi [Wed, 29 Mar 2017 13:15:36 +0000 (16:15 +0300)] 
auth: Do not cache username unless it was changed by lookup

This could've caused usernames to be unexpectedly changed
because they were cached by a lookup that did not include
username in the cache key.

8 years agoauth: Mark username changed if it's changes in auth_request_try_update_username
Aki Tuomi [Wed, 29 Mar 2017 12:37:36 +0000 (15:37 +0300)] 
auth: Mark username changed if it's changes in auth_request_try_update_username

It was forgotten in by 865a82c1

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