Timo Sirainen [Fri, 27 Nov 2015 11:59:22 +0000 (13:59 +0200)]
Added mailbox { autoexpunge } setting.
This can be used to automatically expunge mails from specified mailboxes
after they're old enough. The expunges are done when the user is being
deinitialized. mailbox_list_index=yes should be enabled to have the best
performance with this setting.
Timo Sirainen [Thu, 26 Nov 2015 13:42:35 +0000 (15:42 +0200)]
quota-clone: Avoid assert-crash when quota recalculation is triggered.
Quota recalculation opened all mailboxes and got us back to
quota_clone_flush(), which caused another dict transaction to be opened,
which caused a crash with some dict backends.
Teemu Huovila [Wed, 25 Nov 2015 13:09:52 +0000 (15:09 +0200)]
lib-fts: Move ICU transliterator creation to fts-icu.h
This allows others to use transliterators without so much code duplication.
The transliterator still has to be destroyed by the user, with utrans_close().
Timo Sirainen [Tue, 24 Nov 2015 09:50:15 +0000 (11:50 +0200)]
imap: Fixed hanging if a pipelined IMAP command was waiting for previous command to sync.
..And the previous command was waiting for the next command to finish before
it would start syncing. For example FETCH+LOGOUT pipelined.
Timo Sirainen [Tue, 24 Nov 2015 09:15:47 +0000 (11:15 +0200)]
director: Fixed backend selection when multiple tags were used.
The previous algorithm was causing an uneven load for backends.
This change breaks compatibility with older director servers that were using
tags because of the different selection algorithm. The new director code
refuses to run within a cluster with old directors if tags are used.
Timo Sirainen [Mon, 23 Nov 2015 17:35:03 +0000 (19:35 +0200)]
director: With director_consistent_hashing=yes hosts_hash wasn't always calculated right.
If different servers had added hosts in different order, the hosts_hash
would have become different, which caused errors and resyncs.
Teemu Huovila [Wed, 18 Nov 2015 14:33:26 +0000 (16:33 +0200)]
fts: Remove default filters and tokenizers.
There aren't any specially good defaults that work for all the languages,
so it's better to just enforce explicit settings.
Timo Sirainen [Wed, 18 Nov 2015 19:06:17 +0000 (21:06 +0200)]
indexer-worker: Use provided session-id only as a prefix for a unique session ID.
Fixes stats process's "Duplicate session ID" errors when LMTP delivers to
multiple recipients.
Timo Sirainen [Wed, 18 Nov 2015 19:03:41 +0000 (21:03 +0200)]
lib-storage: Added mail_storage_service_input.session_id_prefix
This should make it easier to pass through the original session_id to worker
process sessions. Especially if these sessions are somewhat short-lived it
can be useful to assign them a unique session ID while still being able to
match it to the parent's session ID.
Timo Sirainen [Wed, 18 Nov 2015 17:15:36 +0000 (19:15 +0200)]
stats: Forced sending of UPDATE-SESSION every 5 minutes wasn't working.
This caused stats process to forget about idling (imap) sessions if they
didn't do anything for over 15 minutes.
Timo Sirainen [Wed, 18 Nov 2015 16:10:46 +0000 (18:10 +0200)]
lib-storage: Create ioloop context for users even if log prefix changing is disabled.
This fixes stats plugin to work with lmtp, imap-urlauth and doveadm-server.
Timo Sirainen [Wed, 18 Nov 2015 15:45:35 +0000 (17:45 +0200)]
lib-master: master_service_is_master_stopped() now returns FALSE if running standalone.
The only caller of this function was stats plugin to see if it should send
stats updates. So this fixes dovecot-lda, doveadm and other standalone tools
to send stats updates.
Timo Sirainen [Wed, 18 Nov 2015 11:12:23 +0000 (13:12 +0200)]
pop3: When creating session lock file, prefer to write it to the index root dir.
This is especially important for mail storage backends that don't have a mail
root directory.
Timo Sirainen [Wed, 18 Nov 2015 11:08:57 +0000 (13:08 +0200)]
pop3: Send "OK Logged in" before reading mailbox.
This way if the reading takes a long time, the client still sees that the
login itself was successful. This is especially useful to avoid unnecessary
errors logged by proxies.
Timo Sirainen [Tue, 17 Nov 2015 15:26:56 +0000 (17:26 +0200)]
*-login: Added postlogin_socket=path passdb extra field.
By default e.g. "imap" or "pop3" is the post-login socket, but this can
override it. This could be used for example for per-user debugging (e.g.
setting executable to be run via strace or valgrind).
Timo Sirainen [Tue, 17 Nov 2015 14:30:16 +0000 (16:30 +0200)]
lib-fs: Added asserts to fs_set_metadata() to make sure key and value are non-NULL
Otherwise the bug would be noticed only much later when trying to
dereference NULL pointer.
Teemu Huovila [Tue, 17 Nov 2015 09:44:19 +0000 (11:44 +0200)]
lib-fts: Add Norwegian.
Norwegian has two main dialects, Bokmal(nb) and Nynorsk(nn). They
are detected separately by libexttextcat, but the stemmer only
knows Norwegian. Thus they are treated as a single language,
Norwegian (no). This might also make more sense in everyday
use of mixed writing style Norwegian.
Caveat: The default normalizer filter does not modify U+00F8
(Latin Small Letter O with Stroke). In some configurations it
might be desirable to rewrite it to e.g. o. Same goes for the
upper case version. This can be done by passing a modified "id"
setting to the normalizer filter.
Teemu Huovila [Tue, 17 Nov 2015 09:43:58 +0000 (11:43 +0200)]
lib-fts: Add comment to language names.
Languages are defined by their ISO 639-1 code, which is a two letters.
It is possible, that some languages with only a three letter code, ie.
a ISO 639-2 code, could be added in the future.
Timo Sirainen [Mon, 16 Nov 2015 12:16:00 +0000 (14:16 +0200)]
dovecot.m4: Run valgrind with --trace-children=yes
Some of the unit tests are run via shell and we want to check the unit tests
instead of just the shell.
Phil Carmody [Mon, 16 Nov 2015 10:29:51 +0000 (12:29 +0200)]
various - remove 8-bit characters from literal strings in test cases
C has a portable way of expressing characters not in the basic character
set, namely \xNN escaping. Otherwise, the interpretation of the raw utf-8
is implentation dependent. This has the benefit of making some tests'
expected output more obvious, such as "=c3=a4" matching "\xC3\xA4", even
if it hinders the readability of some natural-language-based tests.
Phil Carmody [Mon, 16 Nov 2015 10:26:06 +0000 (12:26 +0200)]
lib-http: ref/unref input stream in http message parser
To prevent assidental disappearance of the stream while it's in use.
Also, the caller can create and forget - we'll do the cleanup later.
Timo Sirainen [Mon, 16 Nov 2015 10:24:53 +0000 (12:24 +0200)]
imapc: Treat literal8 input the same as regular literal.
This is mainly for migrating away from broken servers (a patched Cyrus) that
send literal8 if a (corrupted) message contains NULs.
Timo Sirainen [Thu, 12 Nov 2015 10:17:04 +0000 (12:17 +0200)]
imap: When client disconnects during a running command, log the IO input/output wait status.
This is mainly useful for debugging to make sure that the hang isn't
happening because of a bug (missing io) in Dovecot.
Timo Sirainen [Thu, 12 Nov 2015 09:29:29 +0000 (11:29 +0200)]
quota: When recalculating quota, don't try to access nonexistent autocreate-mailboxes.
There's no need to physically create them, since they're empty anyway.
Timo Sirainen [Wed, 11 Nov 2015 11:15:30 +0000 (13:15 +0200)]
auth: Added hardcoded 5 second timeout to LDAP connect()
Although it doesn't look like the timeout is exactly 5 seconds always due to
OpenSSL's internal workings, but this should be good enough.
Timo Sirainen [Mon, 9 Nov 2015 11:02:56 +0000 (13:02 +0200)]
lib: Removed unnecessary includes from bits.h
All of them are already in lib.h, and bits.h gets included from lib.h.
This also solves a compiling problem for systems where stdint.h doesn't
exist.
Timo Sirainen [Mon, 9 Nov 2015 07:31:48 +0000 (09:31 +0200)]
replicator: Send initial status notification to master before listing all users
To avoid master process from killing us after 30 seconds if the user listing
takes longer than that.
Timo Sirainen [Thu, 29 Oct 2015 10:55:20 +0000 (12:55 +0200)]
acl: acl_object_list_*() now duplicates rights at init to avoid them changing during listing.
Depending on the calling code the acl_object could have been refreshed
during the listing and caused bugs/crashes.
This fixes a crash at least in mailbox deletion during attribute deletion
where iter->idx was higher (2) than the number of rights at the time (0).
Timo Sirainen [Wed, 21 Oct 2015 16:12:45 +0000 (19:12 +0300)]
LAYOUT=index: Fixed error handling in mailbox creation race condition.
If two processes create the same mailbox, the other one ends up being
deleted on failure. However, if the deletion itself also failed the state
becomes a big ambiguous. We don't want to return MAIL_ERROR_EXISTS in that
case, because the caller may try to open the mailbox with the inconsistent
state and fail. So we'll instead return the original mailbox_delete() error
to the caller.