Timo Sirainen [Wed, 16 Dec 2015 13:06:52 +0000 (15:06 +0200)]
lib-compress: lz4 istream wasn't detected reliably in some situations.
We requested too few bytes from istream, so there wasn't any guarantee that
the istream actually had all the bytes. This caused a problem for example
with mdbox when the previous mail was already fetched and the stream happened
to end in the middle of the lz4 header.
Timo Sirainen [Tue, 15 Dec 2015 15:29:11 +0000 (17:29 +0200)]
lib-mail: message_header_parser_next() updates istream position immediately now.
Earlier it updated the position only on the next call or at deinit. This was
because some earlier code kept pointers to the stream data and stored them
to the returned struct message_header_line, but we don't do this anymore.
This allows more easily accessing the same istream for other purposes during
the header parsing.
Timo Sirainen [Sun, 13 Dec 2015 10:33:20 +0000 (12:33 +0200)]
stats: Avoid assert-crash with dsync.
dsync creates two mail_users and they're deinited at the same time.
stats_global_user isn't set after the first one is deinited, so the next
deinit crashed because it wasn't set.
Timo Sirainen [Tue, 8 Dec 2015 10:24:42 +0000 (12:24 +0200)]
lib-settings: Allow using comma as deflist separator.
This means that when adding new block {}s via e.g. userdb or post-login
script, the block names can now be set with block=a,b,c instead of
"block=a b c". This is beneficial with e.g. passwd-file or userdb
default_fields where spaces are used to separate parameters entirely.
Timo Sirainen [Mon, 7 Dec 2015 09:29:29 +0000 (11:29 +0200)]
doveadm: Fixed reseting getopt() with glibc when processing multiple commands in a single process.
This means commands run with doveadm batch or multiple commands in a single
doveadm-server connection.
glibc's getopt() man page says that optind=1 should reset it for scanning a
new argument vector, but this doesn't actually seem to work. Setting
optind=0 does work though, so use it everywhere.
Timo Sirainen [Mon, 7 Dec 2015 09:21:59 +0000 (11:21 +0200)]
doveadm-server: Reset getopt() before calling non-mail commands.
This fixes parsing their parameters when using multiple such commands within
a single doveadm connection.
Timo Sirainen [Sun, 6 Dec 2015 18:46:52 +0000 (20:46 +0200)]
lib-storage: mail_search_args_simplify() refactoring
Removed parent_arg from mail_search_args_simplify_extract_common_and() in
preperation for the next changeset.
Timo Sirainen [Sun, 6 Dec 2015 14:46:30 +0000 (16:46 +0200)]
lib-storage: SEARCH BODY "" wasn't properly being translated to SEARCH_ALL.
Instead if the next parameter was "" this happened (which could have been an
accidental space in doveadm search-query).
Timo Sirainen [Sun, 6 Dec 2015 13:10:10 +0000 (15:10 +0200)]
lib-charset: Added UTF-7 state checking unit test.
This was an idea of a way to test for a bug in FreeBSD iconv(), but nobody
reported if it did anything. So lets add it here and see.
Timo Sirainen [Fri, 4 Dec 2015 11:46:00 +0000 (13:46 +0200)]
lib-http: Give a better error message if request times out.
Instead of just giving the configured timeout, log how long the timeout
actually took for the oldest request in wait list. Also if the request was
retried, log how many times the request was sent and how long the request
took in total.
Timo Sirainen [Fri, 4 Dec 2015 10:15:49 +0000 (12:15 +0200)]
imap: Fixed assert-crash if client disconnected at a specific command state.
If there was a command with state=CLIENT_COMMAND_STATE_WAIT_SYNC and output
stream was already detected to be closed, we crashed with:
Timo Sirainen [Fri, 4 Dec 2015 09:38:00 +0000 (11:38 +0200)]
lib-index: mail_transaction_log_file_map() didn't properly check start_offset
If it was too high, it still returned successful mapping. This could have
caused an assert-crash later on when the start_offset was actually attempted
to be used.
Timo Sirainen [Thu, 3 Dec 2015 12:24:06 +0000 (14:24 +0200)]
fts: Added support for per-language tokenizer settings.
fts_tokenizer_<lang> now overrides fts_tokenizers setting.
fts_tokenizer_<name>_<lang> now overrides fts_tokenizer_<name> setting.
Timo Sirainen [Thu, 3 Dec 2015 10:22:24 +0000 (12:22 +0200)]
lib-ssl-iostream: Moved openssl_iostream_*error() to -common.c
login-common code only links with this file, so that's required for the
previous changes to actually work.
Timo Sirainen [Thu, 3 Dec 2015 10:19:12 +0000 (12:19 +0200)]
login, lib-ssl-iostream: Clear errors caused by manual EC key selection when there was no EC key.
EVP_PKEY_get1_EC_KEY() would return an error, which should be ignored
instead of being logged later on.
Timo Sirainen [Thu, 3 Dec 2015 09:55:33 +0000 (11:55 +0200)]
lib-ssl-iostream: Fixes to error handling.
Copy behavior from login-common/ssl-proxy-openssl.c:
- Handle stacked errors.
- Improve errors with ERR_TXT_STRING flag.
Timo Sirainen [Tue, 1 Dec 2015 15:31:08 +0000 (17:31 +0200)]
mail-log: If uid field is used, make sure newly saved mails actually get an UID.
With Maildir the UID is otherwise assigned on mail deliveries only if
dovecot-uidlist happens to get locked.
Timo Sirainen [Mon, 30 Nov 2015 19:36:51 +0000 (21:36 +0200)]
director: Don't treat empty hostname the same as having it.
This could have caused "host not given" errors if an empty "host=" was sent
to login process, even though hostip was also sent.
Fixed this in two places, although either one should have been enough.