Stephan Bosch [Tue, 29 Jan 2019 21:16:26 +0000 (22:16 +0100)]
lib-http: client: Fix segfault occurring when an idle host times out.
This is most visible when the host is associated with an invalid host name: in
that case the idle timeout is only 100ms. For valid hosts, this problem can only
appear after 30 minutes idle time (default).
Problem is caused by the session host object starting a new idle timeout in the
shared host, while the shared and session host objects are both being destroyed.
Stephan Bosch [Thu, 25 Apr 2019 07:51:32 +0000 (09:51 +0200)]
lib-smtp: smtp-server-cmd-auth - Fix AUTH response error handling so that it stops reading more input.
Otherwise, it may try to read more data from the stream as the next AUTH
response, which causes an assert crash in the command parser later on. Even when
the parser finds no input from the stream, it will advance its state
towards AUTH response parsing, which is a problem when the next command is
subsequently being parsed.
Aki Tuomi [Tue, 16 Apr 2019 08:42:56 +0000 (11:42 +0300)]
mail-lua: Implement mailbox metadata API
Adds methods for accessing and manipulating mailbox metadata
* user:metadata_get("key", "key", ..) - returns value for keys
* user:metadata_set("key", "value") - sets value for key
* user:metadata_unset("key", "value") - unsets key
* user:metadata_list("prefix", "prefix", ...) - lists keys in dict for prefixes
* mailbox:metadata_get("key", "key", ..) - returns value for keys
* mailbox:metadata_set("key", "value") - sets value for key
* mailbox:metadata_unset("key", "value") - unsets key
* mailbox:metadata_list("prefix", "prefix", ...) - lists keys in dict for prefixes
User metadata is stored under /(private|shared)/vendor/vendor.dovecot/pvt/server to
mailbox INBOX, and is accessible with mailbox metadata methods with INBOX.
Stephan Bosch [Wed, 27 Mar 2019 00:25:57 +0000 (01:25 +0100)]
lib-lda: Initialize/deinitialize mail_deliver_context in separate functions.
This changes the allocation of parsed SMTP addresses to initially use a
datastack pool rather than the mail_deliver context pool. This is necessary
because the context is created a bit later. Upon mail_deliver_init(), the
addresses are moved to the context pool.
The older SNIPPET command will remain for now - it is mostly the same
as the new PREVIEW code, so it's essentially an alias (the only
difference between the two versions is the SNIPPET/PREVIEW identifier
text).
Timo Sirainen [Sun, 20 May 2018 09:27:22 +0000 (12:27 +0300)]
fts: Add fts_enforced=body
Similar to "no", this doesn't enforce FTS indexing for header searches.
Similar to "yes", on FTS lookup failure it won't fallback to reading all
mails.
Timo Sirainen [Mon, 18 Mar 2019 13:34:10 +0000 (15:34 +0200)]
lib-mail: istream-header-filter: Fix HEADER_FILTER_ADD_MISSING_EOH with callback
If mail already had EOH and callback returned matched=TRUE in the EOH
callback (e.g. adding more headers), the callback was called a second
time for the EOH.
Currently there doesn't seem to be any existing code that was affected by
this bug.
coccinelle: Add all semantic patches used in the past to a new dir
This commit merely imports the semantic patches without providing any
additional tooling to apply them. It also includes macros.h header used by
coccinelle to properly handle some of the more complex macros we have.
Timo Sirainen [Tue, 4 Oct 2016 13:00:18 +0000 (16:00 +0300)]
lib-ssl-iostream: Minor assert cleanup.
If stream->closed is TRUE then stream->stream_errno != 0 as well. And here
we really want to be sure that stream_errno isn't 0, so make the assert
reflect that.
Olaf Hering [Thu, 3 Jan 2019 19:32:26 +0000 (20:32 +0100)]
config: reproducible output from settings-get.pl
If the same source gets built twice ('build same source on different
hosts at different times') the resulting files may differ.
Fix this by sorting the hash keys before usage.
Stephan Bosch [Wed, 29 Aug 2018 17:01:37 +0000 (19:01 +0200)]
lib-http: client: Fix segfault crash sometimes happening while running sub-ioloop in request callback.
The connection was not completely disconnected before calling the callback.
Running a sub-ioloop means that timeouts and ios that haven't been destroyed yet
for the connection can be triggered, causing all kinds of issues. Therefore, it
is important to disconnect before calling the request callbacks. The fix therefore
consists of calling http_client_connection_disconnect() before calling
http_client_connection_retry_requests() in
http_client_connection_abort_temp_error().
This also amends the test suite to account for these changes, as it is now
unclear which requests will actually succeed.
Stephan Bosch [Sun, 16 Sep 2018 13:19:23 +0000 (15:19 +0200)]
lib-http: client: Implement the no_auto_retry setting in http_client_request_retry().
Before, it was implemented in http_client_connection_retry_requests(), but that
would not work after http_client_connection_disconnect().The peer is detached
from the connection there, which makes conn->peer->client->set unavailable.
Instead, we use req->client->set for each request individually to determine
whether it should be retried or not.
Stephan Bosch [Fri, 15 Mar 2019 23:53:07 +0000 (00:53 +0100)]
lib-smtp: smtp-server-recipient - Enforce <path> prefix in forwarded reply.
This is mainly for concistency, but it also prevents exposing addresses that
are supposed to be only visible to the backend. Also, this implicitly adds the
<path> prefix to the reply when it is missing, provided it is not an RCPT
success reply.
This is a convenience wrapper around smtp_server_reply_index(). This implicitly
adds the <path> prefix to the reply (when it is not an RCPT success reply).