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.
Timo Sirainen [Tue, 20 Oct 2015 15:43:32 +0000 (18:43 +0300)]
lib-index: tail_offset wasn't updated as often as it should have been.
ctx->last_tail_offset was being increased for every non-external transaction
and at the end we checked if head was larger than it. This logic didn't
really make any sense, since non-external transactions specifically were
supposed to update the tail_offset.
Timo Sirainen [Tue, 20 Oct 2015 15:22:53 +0000 (18:22 +0300)]
lib-imap-storage: Mark METADATA transactions as external.
We never write the metadata values to any storage backend, so they also
don't need to be explicitly synced.
Timo Sirainen [Tue, 20 Oct 2015 12:29:07 +0000 (15:29 +0300)]
dsync: Added DSYNC_BRAIN_FLAG_NO_NOTIFY to enable MAILBOX_TRANSACTION_FLAG_NO_NOTIFY
It's arguable that this should be enabled by default, but people might like
to keep mail_log notifications for dsync.
Timo Sirainen [Tue, 20 Oct 2015 12:27:42 +0000 (15:27 +0300)]
lib-storage/notify: Added MAILBOX_TRANSACTION_FLAG_NO_NOTIFY
This flag could potentially apply for other things as well, not just notify
plugin. In general anything that could do external notifications shouldn't
do anything for transactions with this flag.
Timo Sirainen [Mon, 19 Oct 2015 11:29:10 +0000 (14:29 +0300)]
imapc: Set storage's error to "internal error" if we detect mailbox state corruption.
This fixes "unknown internal error" in at least syncing code when an
expunged message reappears.
Timo Sirainen [Mon, 19 Oct 2015 10:49:54 +0000 (13:49 +0300)]
director: Remember backends' hostnames and send them in login reply.
This allows login processes to verify the remote server's hostname in SSL
certificate.
Timo Sirainen [Wed, 14 Oct 2015 14:34:23 +0000 (17:34 +0300)]
dsync: If rename algorithm seems go to an infinite loop, log an error and stop.
Ideally we would of course fix the algorithm (especially to not require this
kind of looping).
Timo Sirainen [Wed, 14 Oct 2015 14:28:11 +0000 (17:28 +0300)]
imap/pop3-login: If LOGIN/USER is used with plaintext auth disabled, remember the username for logging.
It's still useful to see the username that was sent in the logout message.
This won't work for AUTHENTICATE PLAIN, but hopefully the clients that use
it understand the LOGINDISABLED capability better.
Timo Sirainen [Wed, 14 Oct 2015 11:06:35 +0000 (14:06 +0300)]
cassandra: Added read/write/delete_fallback_consistency settings.
The fallback is attempted if the primary consistency can't be satisfied.
One useful use case for this is to have:
Which means that during regular operation all writes go to all data centers
before they are finished, but if one of the data centers go down we'll
switch to just waiting for local data center writes to finish.
Timo Sirainen [Tue, 13 Oct 2015 18:21:48 +0000 (21:21 +0300)]
auth ldap: If tls_* settings are used, pass them to LDAP library even if tls=no
Most importantly this allows using the settings for ldaps URLs. And they
hopefully won't hurt anything if neither STARTTLS nor ldaps are used.