Timo Sirainen [Fri, 10 May 2019 15:06:46 +0000 (18:06 +0300)]
lib: Make sure uncorking ostream-file flushes network output immediately
TCP_CORK and TCP_NODELAY are separate things, but we'll treat them similarly
for our ostream corking API. It was always intended that all data written
inside corking would be delayed until uncork, and immediately sent
afterwards.
This change removes unnecessary extra 40ms delays, which may happen when
proxying.
Aki Tuomi [Fri, 10 May 2019 12:55:22 +0000 (15:55 +0300)]
doveadm-dsync: Always cleanup after connection
Go through the same error handling path every time. Fixes
Panic: file ioloop.c: line 826 (io_loop_destroy): assertion failed: (ioloop == current_ioloop)
This happened because the ioloop wasn't destroyed
on error.
Timo Sirainen [Fri, 10 May 2019 16:16:07 +0000 (19:16 +0300)]
lib-storage: Attachment flag detection shouldn't cause mail body to be opened
Fetching cached mail headers with
mail_attachment_detection_options=add-flags-on-save caued IMAP BODYSTRUCTURE
to be fetched as well. If it wasn't already cached, this caused opening the
mail body to generate it. Also the result wasn't added to cache, so the
inefficient behavior continued.
Timo Sirainen [Thu, 9 May 2019 16:48:43 +0000 (19:48 +0300)]
doveadm dict: Make it clear that *iter_flags can't dereference NULL pointer
It's not possible to dereference it anyway, because only "doveadm dict iter"
has these iter parameters. This change fixes warnings from static analyzers.
Timo Sirainen [Thu, 9 May 2019 12:29:34 +0000 (15:29 +0300)]
global: Change CALLBACK_TYPECHECK() to used with subtraction
This is because clang's -Wstring-plus-int gave warnings when using
"string" + CALLBACK_TYPECHECK(), but there are no warnings when using
"string" - CALLBACK_TYPECHECK(). It would have been enough to change
only the string parameters to use "-", but for consistency this commit
changes all of them.
John Fawcett [Wed, 24 Apr 2019 07:37:55 +0000 (10:37 +0300)]
fts-solr: Add soft_commit setting
soft_commit=yes|no: send softCommit to the solr server, default yes is backwards compatible behaviour
If setting to no autoSoftCommit on solr should be set to something reasonable (e.g. 60 seconds)
in file solrconfig.xml
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.