]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
10 years agofts: Parse HTML MIME parts using lib-mail's mail-html2text.
Timo Sirainen [Fri, 16 Jan 2015 22:24:36 +0000 (00:24 +0200)] 
fts: Parse HTML MIME parts using lib-mail's mail-html2text.

10 years agolib-mail: Added message_snippet_generate() to produce a short text snippet of a mail.
Timo Sirainen [Fri, 16 Jan 2015 22:23:36 +0000 (00:23 +0200)] 
lib-mail: Added message_snippet_generate() to produce a short text snippet of a mail.

10 years agolib-mail: Added mail-html2text API
Timo Sirainen [Fri, 16 Jan 2015 22:15:44 +0000 (00:15 +0200)] 
lib-mail: Added mail-html2text API
What makes it mail-specific is that it allows skipping over data inside
<blockquote>. This code probably doesn't parse HTML perfectly, but hopefully
good enough for HTML emails.

10 years agolib-mail: Forgot to commit .h file for message_decoder_current_content_type() change.
Timo Sirainen [Wed, 14 Jan 2015 23:26:02 +0000 (01:26 +0200)] 
lib-mail: Forgot to commit .h file for message_decoder_current_content_type() change.

10 years agolib-mail: Added message_decoder_current_content_type()
Timo Sirainen [Wed, 14 Jan 2015 23:22:04 +0000 (01:22 +0200)] 
lib-mail: Added message_decoder_current_content_type()

10 years agolib-mail: message-decoder now always sets output->size=0 when headers are returned.
Timo Sirainen [Wed, 14 Jan 2015 23:11:34 +0000 (01:11 +0200)] 
lib-mail: message-decoder now always sets output->size=0 when headers are returned.

10 years agolib-mail: Fixed crash in message-decoder with unknown charsets.
Timo Sirainen [Wed, 14 Jan 2015 23:10:11 +0000 (01:10 +0200)] 
lib-mail: Fixed crash in message-decoder with unknown charsets.
Caused by earlier changes.

10 years agolib-mail: Replaced MAX_TRANSLATION_BUF_SIZE with the new CHARSET_MAX_PENDING_BUF_SIZE
Timo Sirainen [Wed, 14 Jan 2015 23:08:00 +0000 (01:08 +0200)] 
lib-mail: Replaced MAX_TRANSLATION_BUF_SIZE with the new CHARSET_MAX_PENDING_BUF_SIZE

10 years agolib-charset: Added CHARSET_MAX_PENDING_BUF_SIZE macro and asserts for it.
Timo Sirainen [Wed, 14 Jan 2015 23:05:36 +0000 (01:05 +0200)] 
lib-charset: Added CHARSET_MAX_PENDING_BUF_SIZE macro and asserts for it.

10 years agolib-charset: Added charset_utf8_to_utf8_begin() wrapper function.
Timo Sirainen [Wed, 14 Jan 2015 23:05:13 +0000 (01:05 +0200)] 
lib-charset: Added charset_utf8_to_utf8_begin() wrapper function.
It's never supposed to fail, so it makes it nicer for the callers who need
to use it.

10 years agolib: Fixed NUL-handling in uni_utf8_*strlen*()
Timo Sirainen [Wed, 14 Jan 2015 23:03:58 +0000 (01:03 +0200)] 
lib: Fixed NUL-handling in uni_utf8_*strlen*()
uni_utf8_strlen() could have skipped over the ending NUL byte and caused
read buffer overflows with invalid input.

uni_utf8_strlen_n() and uni_utf8_partial_strlen_n() now allow NUL bytes in
the input and they're treated as regular control characters. Previously the
size was actually treated as max_size with early NUL byte termination.
Technically this is an API change, but I'm not aware of anything using these
functions in an incompatible way.

10 years agolib-storage: Added "oldestonly" search arg to stop searching after the first non...
Timo Sirainen [Wed, 14 Jan 2015 22:10:56 +0000 (00:10 +0200)] 
lib-storage: Added "oldestonly" search arg to stop searching after the first non-match.
This parameter works only for doveadm search queries. It's not fully exact
currently, because if mailbox.search_next_update_seq() skips over
non-matching messages we don't stop if the next message matches. So this
parameter is mainly useful for optimization of commands like:

doveadm expunge -u user@domain mailbox inbox savedsince 30d oldestonly

Where the timestamps should be ascending all the time anyway and there's no
point in continuing to search for more mails after the first timestamp is
too high.

10 years agolib-mail: message-decoder no longer skips lib-charset for UTF8 -> UTF8 translations.
Timo Sirainen [Sat, 10 Jan 2015 02:32:42 +0000 (04:32 +0200)] 
lib-mail: message-decoder no longer skips lib-charset for UTF8 -> UTF8 translations.
With the previous lib-charset fix this makes message-decoder handle partial
UTF-8 text in input blocks correctly.

10 years agolib: Added uni_utf8_partial_strlen_n()
Timo Sirainen [Sat, 10 Jan 2015 02:30:40 +0000 (04:30 +0200)] 
lib: Added uni_utf8_partial_strlen_n()

10 years agolib-charset: UTF-8 -> UTF-8 translation was never returning CHARSET_RET_INCOMPLETE_INPUT
Timo Sirainen [Sat, 10 Jan 2015 02:25:21 +0000 (04:25 +0200)] 
lib-charset: UTF-8 -> UTF-8 translation was never returning CHARSET_RET_INCOMPLETE_INPUT
Instead the incomplete input was just being modified into broken output.

10 years agolib-imap-client: Compiler warning fixes
Timo Sirainen [Thu, 8 Jan 2015 21:07:54 +0000 (23:07 +0200)] 
lib-imap-client: Compiler warning fixes

10 years agoimapc: Added imapc_sasl_mechanisms setting
Timo Sirainen [Thu, 8 Jan 2015 20:52:11 +0000 (22:52 +0200)] 
imapc: Added imapc_sasl_mechanisms setting
The first supported SASL mechanism is used, otherwise the login fails
entirely.

10 years agolib-imap-client: Use lib-sasl to perform the AUTHENTICATE command handling.
Timo Sirainen [Thu, 8 Jan 2015 20:32:20 +0000 (22:32 +0200)] 
lib-imap-client: Use lib-sasl to perform the AUTHENTICATE command handling.

10 years agolib: Defined array type for guid_128_t
Timo Sirainen [Tue, 6 Jan 2015 22:37:50 +0000 (00:37 +0200)] 
lib: Defined array type for guid_128_t

10 years agolib: Remove OpenBSD workaround in i_getpw*()
Timo Sirainen [Tue, 6 Jan 2015 01:15:11 +0000 (03:15 +0200)] 
lib: Remove OpenBSD workaround in i_getpw*()
Originally added in 801714cba91b. It was requested to be removed now that 1)
it's fixed in OpenBSD v5.6+ and 2) The workaround caused nonexistent users
to not work correctly (process running out of memory I guess?)

10 years agofts: Correct returned value to match type signature.
Teemu Huovila [Mon, 5 Jan 2015 13:48:55 +0000 (15:48 +0200)] 
fts: Correct returned value to match type signature.

10 years agoglobal: freshen copyright
Phil Carmody [Mon, 5 Jan 2015 20:20:10 +0000 (22:20 +0200)] 
global: freshen copyright
Robomatically:
  git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-4]/$1-2015/g;s/ (201[0-4]) Dovecot/ $1-2015 Dovecot/'

Happy 2015 everyone!

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: guid - centralise a 'reset to the empty value' helper function
Phil Carmody [Mon, 5 Jan 2015 20:16:59 +0000 (22:16 +0200)] 
lib: guid - centralise a 'reset to the empty value' helper function
This helper just ensures that the caller never has to get the sizeof()
right. (Were a guid passed as a function parameter, mistakes could happen.)

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: guid - declare some functions as pure
Phil Carmody [Mon, 5 Jan 2015 20:15:31 +0000 (22:15 +0200)] 
lib: guid - declare some functions as pure
As the functions aren't inline, the compiler can't know if they
can be optimised away, so give it a helping hand.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array - explain implications of ARRAY_TYPE() in comment
Phil Carmody [Mon, 5 Jan 2015 20:15:07 +0000 (22:15 +0200)] 
lib: array - explain implications of ARRAY_TYPE() in comment
If you use ARRAY_TYPE() to pass an array around, then you must also
use ARRAY_TYPE() to define the array itself, ARRAY() will no longer do.

Reported-by: Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>
Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-array - test new lsearch helper
Phil Carmody [Mon, 5 Jan 2015 20:13:59 +0000 (22:13 +0200)] 
lib: test-array - test new lsearch helper
Just piggy-back on to the current reverse test, as that's got an array
nicely set up for us already.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array - new linear search helper
Phil Carmody [Mon, 5 Jan 2015 20:12:48 +0000 (22:12 +0200)] 
lib: array - new linear search helper
There are large numbers of array_foreach loops which do nothing but search
for the first element which matches some key. This can be abstracted out
into a helper.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoconfigure: Don't break when using --without-shared-libs and CC with '/' chars.
Timo Sirainen [Fri, 26 Dec 2014 15:28:30 +0000 (17:28 +0200)] 
configure: Don't break when using --without-shared-libs and CC with '/' chars.

10 years agoauth: Don't crash if master user login is attempted without master=yes passdbs
Timo Sirainen [Wed, 17 Dec 2014 13:43:30 +0000 (14:43 +0100)] 
auth: Don't crash if master user login is attempted without master=yes passdbs

10 years agolib: Small optimization / unnecessary code removal from array_*() functions.
Timo Sirainen [Wed, 17 Dec 2014 12:39:57 +0000 (13:39 +0100)] 
lib: Small optimization / unnecessary code removal from array_*() functions.

10 years agolib-storage: Mail prefetching was still not working right.
Timo Sirainen [Fri, 5 Dec 2014 03:50:19 +0000 (05:50 +0200)] 
lib-storage: Mail prefetching was still not working right.
I wonder if it ever actually worked (except for SEARCH TEXT).

10 years agodoveadm: Avoid calling init() in doveadm binary if the command is sent to doveadm...
Timo Sirainen [Fri, 5 Dec 2014 02:39:11 +0000 (04:39 +0200)] 
doveadm: Avoid calling init() in doveadm binary if the command is sent to doveadm-server.
The init() is still always called when -A or -u *wildcards* are used though.
I'm not sure if that can be delayed. At least all commands should be
verified that they don't rely on the current init() location.

10 years agodoveadm: Support changing proxy destination username with "user" and "destuser" passd...
Timo Sirainen [Fri, 5 Dec 2014 01:53:02 +0000 (03:53 +0200)] 
doveadm: Support changing proxy destination username with "user" and "destuser" passdb field.

10 years agoauth: Don't allow changing username to an empty string.
Timo Sirainen [Fri, 5 Dec 2014 01:38:08 +0000 (03:38 +0200)] 
auth: Don't allow changing username to an empty string.
This is most likely always accidental and Dovecot in general hasn't been
designed to support empty usernames.

10 years agofts: Install some of the header files that other external plugins might want to use.
Timo Sirainen [Fri, 5 Dec 2014 01:11:14 +0000 (03:11 +0200)] 
fts: Install some of the header files that other external plugins might want to use.

10 years agofts: Compiler warning fix when using fts-indexer.h directly
Timo Sirainen [Fri, 5 Dec 2014 01:10:32 +0000 (03:10 +0200)] 
fts: Compiler warning fix when using fts-indexer.h directly

10 years agodict-redis: Use timeout_msecs parameter also for transaction commit waits.
Timo Sirainen [Tue, 2 Dec 2014 08:29:13 +0000 (00:29 -0800)] 
dict-redis: Use timeout_msecs parameter also for transaction commit waits.

10 years agodict-redis: Use EXPIRE also after INCRBY commands.
Timo Sirainen [Tue, 2 Dec 2014 08:26:24 +0000 (00:26 -0800)] 
dict-redis: Use EXPIRE also after INCRBY commands.

10 years agolib: test-array - really really really stop gcc optimising away fatal tests
Phil Carmody [Mon, 1 Dec 2014 20:43:33 +0000 (22:43 +0200)] 
lib: test-array - really really really stop gcc optimising away fatal tests
Gcc 4.6 also was determined to optimise away the calls that should crash.
We therefore have to do *something*, no matter how stupid, with the return
values. This should do it. (please, oh please, oh please, ...)

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoquota: Added "hidden" option to hide the quota root from IMAP GETQUOTAROOT command.
Timo Sirainen [Mon, 1 Dec 2014 20:11:54 +0000 (12:11 -0800)] 
quota: Added "hidden" option to hide the quota root from IMAP GETQUOTAROOT command.

10 years agolib: array - array_foreach_idx is just a generic ptr_to_idx helper
Phil Carmody [Fri, 28 Nov 2014 08:57:43 +0000 (10:57 +0200)] 
lib: array - array_foreach_idx is just a generic ptr_to_idx helper
Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-array - remove possibility to optimise out tests
Phil Carmody [Fri, 28 Nov 2014 08:57:43 +0000 (10:57 +0200)] 
lib: test-array - remove possibility to optimise out tests
(void) on a call to a "pure" function was causing some compilers (gcc 4.8)
to not reach the assert within the pure function. Technically it's not a
pure function, as (in the assert fail case) it has effects other than its
return value. However, simply removing the void cast (and then actually
using the return value) also prevents this optimisation.

An additional fatal test was added - there's a difference between an access
outside the allocated range and outside the initialised range.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib-test: more delicate *assert() behaviour when doing fatal tests
Phil Carmody [Fri, 28 Nov 2014 08:57:43 +0000 (10:57 +0200)] 
lib-test: more delicate *assert() behaviour when doing fatal tests
We shouldn't be i_asserting ourselves when we're in the state of wanting a
test to fail. Therefore instead test_assert to get the assert message, and
ensure that the success flag is cleared to get the FAILED at the end.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array - additional compile-time checks to array_append
Phil Carmody [Tue, 25 Nov 2014 01:48:42 +0000 (03:48 +0200)] 
lib: array - additional compile-time checks to array_append
The new two-array helper macro works in this context too.

Note: array_copy doesn't have any protection currently, it isn't
obvious how to wrap that with some safety without breaking interfaces.
It only seems to have one internal user, lib/aqueue.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-array - fix off-by-one in test_reverse
Phil Carmody [Tue, 25 Nov 2014 01:45:35 +0000 (03:45 +0200)] 
lib: test-array - fix off-by-one in test_reverse
i is not used as an index, but as a count. Therefore, it can attain the
array size in the loop without causing any buffer overflows.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-array - fatal tests
Phil Carmody [Tue, 25 Nov 2014 01:44:55 +0000 (03:44 +0200)] 
lib: test-array - fatal tests
Tests both of the i_asserts which aren't already protected by TYPEOF compile-time
checks.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-array - new equality testers
Phil Carmody [Tue, 25 Nov 2014 01:44:31 +0000 (03:44 +0200)] 
lib: test-array - new equality testers
One using strings that get dereferenced, the other using the context pointer
to pass in external data.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array - element-wise comparison via callback
Phil Carmody [Tue, 25 Nov 2014 01:43:02 +0000 (03:43 +0200)] 
lib: array - element-wise comparison via callback
2 are provided - with and without a context pointer.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-array - test array_cmp()
Phil Carmody [Tue, 25 Nov 2014 01:43:02 +0000 (03:43 +0200)] 
lib: test-array - test array_cmp()
Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: guid - turn uint8_t * parameters into guid_128_t
Phil Carmody [Tue, 25 Nov 2014 01:31:34 +0000 (03:31 +0200)] 
lib: guid - turn uint8_t * parameters into guid_128_t
As we expose the type's internals, there's no concrete difference between
the two, but it might help static code checkers to detect misuse of the
library, or sloppy typing.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agodict-redis: Small error handling fix to previous change.
Timo Sirainen [Tue, 25 Nov 2014 01:12:25 +0000 (03:12 +0200)] 
dict-redis: Small error handling fix to previous change.

10 years agodict-redis: Added support for expire_secs=n parameter.
Timo Sirainen [Tue, 25 Nov 2014 01:10:41 +0000 (03:10 +0200)] 
dict-redis: Added support for expire_secs=n parameter.
It performs EXPIRE command for the added keys immediately after the SET.

10 years agolib-storage: Don't fetch wanted_fields for messages that don't match the search query.
Timo Sirainen [Tue, 25 Nov 2014 00:56:37 +0000 (02:56 +0200)] 
lib-storage: Don't fetch wanted_fields for messages that don't match the search query.
For example "doveadm fetch text subject foo" was opening all the mails, even
though only a few matched the subject (that was hopefully already in cache
file).

The behavior still isn't perfect though. The wanted_fields should probably
be split into search_wanted_fields and fetch_wanted_fields, but the current
behavior is likely good enough for now.

10 years agolmtp: Added TLS security information to Received: header when STARTTLS was used.
Timo Sirainen [Fri, 21 Nov 2014 09:17:00 +0000 (18:17 +0900)] 
lmtp: Added TLS security information to Received: header when STARTTLS was used.

10 years agostats: Removed extra TAB from global stats exporting.
Timo Sirainen [Thu, 20 Nov 2014 13:03:25 +0000 (22:03 +0900)] 
stats: Removed extra TAB from global stats exporting.

10 years agolib-index: If transaction log is unexpectedly recreated while it was locked, log...
Timo Sirainen [Thu, 20 Nov 2014 06:15:20 +0000 (15:15 +0900)] 
lib-index: If transaction log is unexpectedly recreated while it was locked, log a nice error.
Instead of just assert-crashing.

10 years agoauth: Increase timeout for multi-line auth-worker replies to 30 minutes.
Timo Sirainen [Wed, 19 Nov 2014 20:40:55 +0000 (05:40 +0900)] 
auth: Increase timeout for multi-line auth-worker replies to 30 minutes.
This should help with running long-running doveadm -A commands.

10 years agombox: Added more (and earlier) detection for errors in mbox istreams.
Timo Sirainen [Wed, 19 Nov 2014 08:37:57 +0000 (17:37 +0900)] 
mbox: Added more (and earlier) detection for errors in mbox istreams.

10 years agombox: istream_raw_mbox_seek() needs to reset all corruption errors.
Timo Sirainen [Wed, 19 Nov 2014 08:37:18 +0000 (17:37 +0900)] 
mbox: istream_raw_mbox_seek() needs to reset all corruption errors.
We now reset all errors, but it doesn't really matter.

10 years agolib-fs: Added FS_PROPERTY_ASYNC.
Timo Sirainen [Sat, 15 Nov 2014 01:26:16 +0000 (03:26 +0200)] 
lib-fs: Added FS_PROPERTY_ASYNC.

10 years agoAdded support for base32 encode/decode.
Stephan Bosch [Sat, 15 Nov 2014 00:39:04 +0000 (02:39 +0200)] 
Added support for base32 encode/decode.

10 years agoImplemented dot output stream. This outputs data in the dot-escaped format needed...
Stephan Bosch [Sat, 15 Nov 2014 00:37:45 +0000 (02:37 +0200)] 
Implemented dot output stream. This outputs data in the dot-escaped format needed for the SMTP data command.
The sequence CRLF.CRLF is sent upon closing the stream.

10 years agolib-http: client: Removed connection code that is already in src/lib/connection.c.
Stephan Bosch [Sat, 15 Nov 2014 00:37:03 +0000 (02:37 +0200)] 
lib-http: client: Removed connection code that is already in src/lib/connection.c.

10 years agolib: connection: Now uses io_add_istream() instead of io_add().
Stephan Bosch [Sat, 15 Nov 2014 00:36:22 +0000 (02:36 +0200)] 
lib: connection: Now uses io_add_istream() instead of io_add().

10 years agolib-imap-storage: Created new METADATA API.
Stephan Bosch [Sat, 15 Nov 2014 00:27:27 +0000 (02:27 +0200)] 
lib-imap-storage: Created new METADATA API.

10 years agolib-fs: Added fs_lookup_metadata() wrapper to fs_get_metadata()
Timo Sirainen [Sat, 15 Nov 2014 00:22:56 +0000 (02:22 +0200)] 
lib-fs: Added fs_lookup_metadata() wrapper to fs_get_metadata()

10 years agolib-master: Don't even attempt to initialize SSL context if ssl=no
Timo Sirainen [Fri, 14 Nov 2014 22:30:06 +0000 (00:30 +0200)] 
lib-master: Don't even attempt to initialize SSL context if ssl=no

10 years agolib-ssl-iostream: Close the plain iostreams when ssl-iostream is destroyed.
Timo Sirainen [Fri, 14 Nov 2014 22:27:27 +0000 (00:27 +0200)] 
lib-ssl-iostream: Close the plain iostreams when ssl-iostream is destroyed.

10 years agolib: array/hash - enable typof checks for more compilers
Phil Carmody [Fri, 14 Nov 2014 22:14:20 +0000 (00:14 +0200)] 
lib: array/hash - enable typof checks for more compilers
We have a HAVE_TYPEOF macro from autoconf, we may as well make use of it.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array/hash - protect macro parameters
Phil Carmody [Fri, 14 Nov 2014 22:06:09 +0000 (00:06 +0200)] 
lib: array/hash - protect macro parameters
If a pointer parameter p is ``ptr + offset'', then sizeof(*p) becomes
sizeof(*ptr + offset), which isn't what was wanted. sizeof(*(p)) is the
safe expression to use instead. Ditto for just ``*data'' in array.h.

The macros in hash.h which have been changed have been reindented for
better readability and consistency.

The bracketting of elem in (elem)++ in both of the array_foreach* macros
isn't actually useful, as elem participates in token-pasting elsewhere.
However, the two macros have been made more similar to each other for
better parallelism.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoimap: namespace { order } parameter now specifies the order returned in NAMESPACE...
Timo Sirainen [Fri, 14 Nov 2014 08:59:57 +0000 (00:59 -0800)] 
imap: namespace { order } parameter now specifies the order returned in NAMESPACE reply.
This is relevant only if there are multiple visible namespaces with the same
type. The default order depends primarily on the length of the prefix because
of internal sorting (the order of equal length prefixes can't really be
relied on).

10 years agoimap: Added client_disconnect_if_inconsistent() to remove code duplication.
Timo Sirainen [Fri, 14 Nov 2014 00:29:27 +0000 (02:29 +0200)] 
imap: Added client_disconnect_if_inconsistent() to remove code duplication.
Based on patch by Stephan Bosch

10 years agodoveadm: If passdb lookup returns port, use it to override the doveadm_port setting.
Timo Sirainen [Fri, 14 Nov 2014 06:55:59 +0000 (22:55 -0800)] 
doveadm: If passdb lookup returns port, use it to override the doveadm_port setting.

10 years agolib-fs: fs-metawrap now supports adding more metadata fields while file is being...
Timo Sirainen [Fri, 14 Nov 2014 00:00:12 +0000 (02:00 +0200)] 
lib-fs: fs-metawrap now supports adding more metadata fields while file is being saved.
This potentially adds yet another temporary file write though.

10 years agolib: Added iostream_temp_create_named()
Timo Sirainen [Thu, 13 Nov 2014 23:19:37 +0000 (01:19 +0200)] 
lib: Added iostream_temp_create_named()

10 years agolib-index: Make sure dovecot.index.cache parsing doesn't go to infinite loop.
Timo Sirainen [Thu, 13 Nov 2014 09:29:41 +0000 (11:29 +0200)] 
lib-index: Make sure dovecot.index.cache parsing doesn't go to infinite loop.
Although we guarantee this only for files generated with Dovecot v2.2+
because it's too much trouble to check for older versions.

10 years agolib-storage: If storage creation fails, destroy all the already created namespaces...
Timo Sirainen [Thu, 13 Nov 2014 09:14:08 +0000 (11:14 +0200)] 
lib-storage: If storage creation fails, destroy all the already created namespaces/storages.

10 years agolib-storage: Fixed crash if mail_namespaces_init_add() failed due to invalid settings.
Timo Sirainen [Thu, 13 Nov 2014 08:57:07 +0000 (10:57 +0200)] 
lib-storage: Fixed crash if mail_namespaces_init_add() failed due to invalid settings.
Normally the invalid settings were caught by config process already.

10 years agolib: ostream.stream_errno is now exactly the same as last_failed_errno.
Timo Sirainen [Thu, 13 Nov 2014 08:09:28 +0000 (10:09 +0200)] 
lib: ostream.stream_errno is now exactly the same as last_failed_errno.
There's a lot of code that checks only for stream_errno instead of
last_failed_errno at the flush time where the stream_errno might have
already been cleared.

I'm not sure why these were separated in the first place. I don't think
there are any stream errors which just correctly go away by retrying the
operation. Perhaps some code could have attempted seeking and try to handle
the ESPIPE error, but that kind of code paths are rare and they could clear
the errors themselves if needed.

10 years agolib: ostream-file checks "sendfile() not supported" a bit better.
Timo Sirainen [Thu, 13 Nov 2014 08:01:37 +0000 (10:01 +0200)] 
lib: ostream-file checks "sendfile() not supported" a bit better.
There are other reasons why stream_errno=EINVAL could have been set, at
least in theory.

10 years agolib-storage: Added "creator" for mail_user.
Timo Sirainen [Thu, 13 Nov 2014 07:53:35 +0000 (09:53 +0200)] 
lib-storage: Added "creator" for mail_user.
This allows fixing stats plugin to update stats also for shared mailboxes.
That's a bit complicated change though, so I'm not sure how soon it'll
happen. But at least this change makes it possible more easily later on.
Might have other uses too.

10 years agolib: Never implicitly clear istream's stream_errno.
Timo Sirainen [Thu, 13 Nov 2014 07:39:24 +0000 (09:39 +0200)] 
lib: Never implicitly clear istream's stream_errno.
I'm not really sure why these were added in the first place. At some point
the stream_errno was cleared in more places, such as just before reading,
but those were also removed already. I don't see any benefit for these, just
potential problems.

10 years agolib-mail: message_search_msg() shouldn't clear istream's stream_errno.
Timo Sirainen [Thu, 13 Nov 2014 07:35:59 +0000 (09:35 +0200)] 
lib-mail: message_search_msg() shouldn't clear istream's stream_errno.
If the input stream failed, retrying the operation without cached
message_parts is unlikely to help. This also loses the original error
message.

10 years agodsync: Set MAILBOX_TRANSACTION_FLAG_SYNC also for exporter.
Timo Sirainen [Thu, 13 Nov 2014 07:12:38 +0000 (09:12 +0200)] 
dsync: Set MAILBOX_TRANSACTION_FLAG_SYNC also for exporter.
This doesn't really do much because exporter shouldn't be writing anything,
but it allows plugins to find out if transactions is coming from dsync.

10 years agolmtp: Added support for DSN ORCPT parameter.
Timo Sirainen [Thu, 13 Nov 2014 01:58:51 +0000 (03:58 +0200)] 
lmtp: Added support for DSN ORCPT parameter.
If the parameter is specified, it's used as the original recipient address
in Sieve. The ORCPT parameter is also proxied to destination LMTP server if
used (without checking if it supports it). We don't currently advertise DSN
extension, so this feature won't be enabled automatically.

10 years agoimap-stats: Fixed truncation of command args.
Timo Sirainen [Thu, 13 Nov 2014 00:48:22 +0000 (02:48 +0200)] 
imap-stats: Fixed truncation of command args.

10 years agostats: Use the same session ID string for stats tracking as everywhere else.
Timo Sirainen [Thu, 13 Nov 2014 00:39:51 +0000 (02:39 +0200)] 
stats: Use the same session ID string for stats tracking as everywhere else.
Generate a new ID only if there is no session ID assigned.

10 years agossl-params: Removed duplicate lib-ssl-iostream.la linking
Timo Sirainen [Thu, 13 Nov 2014 00:37:39 +0000 (02:37 +0200)] 
ssl-params: Removed duplicate lib-ssl-iostream.la linking

10 years agostats: Use the new str-table API to reduce memory usage for service strings.
Timo Sirainen [Thu, 13 Nov 2014 00:28:46 +0000 (02:28 +0200)] 
stats: Use the new str-table API to reduce memory usage for service strings.
There are only a couple of services, while there can be a lot of sessions.

10 years agolib: Added str-table API for keeping reference counted strings in a hash table.
Timo Sirainen [Thu, 13 Nov 2014 00:24:46 +0000 (02:24 +0200)] 
lib: Added str-table API for keeping reference counted strings in a hash table.

10 years agostats: Added support for "global" stats type.
Timo Sirainen [Wed, 12 Nov 2014 23:41:07 +0000 (01:41 +0200)] 
stats: Added support for "global" stats type.

10 years agodirector: Added support for backend cluster "tags".
Timo Sirainen [Wed, 12 Nov 2014 04:58:37 +0000 (06:58 +0200)] 
director: Added support for backend cluster "tags".
This allows using a single director ring for multiple backend clusters. By
default everything has an empty tag. A passdb lookup can return
"director_tag" field containing the wanted tag name. If there aren't any
backend servers with the wanted tag, it's treated the same as if there
aren't any backend servers available (= wait for 30 secs for a backend and
then return temporary failure).

Tags can be added to configuration by adding @tag suffix to IPs/hosts. For
example:

director_mail_servers = 10.0.0.100-10.0.0.110@name1 10.0.0.120@name2

"doveadm director add" can also add tags either with @tag suffix or with -t
parameter. "doveadm director status user@domain" requires giving the user's
correct tag with -t parameter or the results won't be correct (empty tag's
results are shown). Tags can't currently be changed for an existing host
without removing it first.

10 years agodirector: Don't restart request timeout when director state changes.
Timo Sirainen [Wed, 12 Nov 2014 04:46:45 +0000 (06:46 +0200)] 
director: Don't restart request timeout when director state changes.
If the state keeps changing all the time we'll never return timeouts for the
requests.

10 years agodirector: Added director_consistent_hashing setting.
Timo Sirainen [Wed, 12 Nov 2014 01:29:04 +0000 (03:29 +0200)] 
director: Added director_consistent_hashing setting.
This should have been the default since the beginning. I didn't thik it was
worth the trouble originally because in theory it shouldn't matter much if
users jump between multiple backends. But this makes caching behavior worse,
especially for systems which are using local cache files.

10 years agodirector: When logging a warning about ring being synced again, log how many seconds...
Timo Sirainen [Wed, 12 Nov 2014 00:04:14 +0000 (02:04 +0200)] 
director: When logging a warning about ring being synced again, log how many seconds it took

10 years agodirector: Always log a message when director handshake finishes.
Timo Sirainen [Tue, 11 Nov 2014 23:59:48 +0000 (01:59 +0200)] 
director: Always log a message when director handshake finishes.

10 years agodoveadm director ring status shows now more information
Timo Sirainen [Tue, 11 Nov 2014 23:51:29 +0000 (01:51 +0200)] 
doveadm director ring status shows now more information

10 years agolmtp: Show more information in process title.
Timo Sirainen [Tue, 11 Nov 2014 23:26:04 +0000 (01:26 +0200)] 
lmtp: Show more information in process title.
Most importantly show the username while messages are being delivered.

10 years agodoveadm: Support running non-mail commands via doveadm server.
Timo Sirainen [Tue, 11 Nov 2014 23:06:02 +0000 (01:06 +0200)] 
doveadm: Support running non-mail commands via doveadm server.
There are still some commands that print their output via printf though, so
they need to be fixed separately.

10 years agodoveadm: Moved commands related code to doveadm-cmd.[ch]
Timo Sirainen [Tue, 11 Nov 2014 23:04:27 +0000 (01:04 +0200)] 
doveadm: Moved commands related code to doveadm-cmd.[ch]
Commands are already split for command line-only commands and commands that
can be run via doveadm-server also.