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.
Timo Sirainen [Mon, 12 Oct 2015 12:47:46 +0000 (15:47 +0300)]
director: Detect if directors' hosts have become desynced by sending hosts_hash in SYNC parameter.
Also fix up such a situation by resending all HOSTs.
Timo Sirainen [Sat, 10 Oct 2015 15:32:06 +0000 (18:32 +0300)]
director: Don't become desynced if two directors change the same backend in incompatible ways.
This would have caused "User hash .. is being redirected to two hosts"
errors, which wouldn't easily go away as the directors have a different view
of what hosts currently exist.
Timo Sirainen [Tue, 6 Oct 2015 15:17:45 +0000 (18:17 +0300)]
lib-http: Minor improvement to "disconnected during payload read" error message.
The same error is also used for http-server for parsing client input, so the
message shouldn't say anything about reading the input from server.
Timo Sirainen [Sun, 4 Oct 2015 18:51:55 +0000 (21:51 +0300)]
lib-index: Fixed checking when we want to update dovecot.index
This has been broken since 76f576fc28dc. After that dovecot.index was
usually updated only when dovecot.index.log was being rotated.
Timo Sirainen [Sun, 4 Oct 2015 18:49:08 +0000 (21:49 +0300)]
lib-index: When writing new index, rotate the log file first before writing it.
This way the index contains the new log's seq+offset instead of having to
recreate the index almost immediately afterwards.
Timo Sirainen [Fri, 2 Oct 2015 15:30:22 +0000 (18:30 +0300)]
pop3: Fixed buffer overflow with handling pop3_deleted_flag setting.
This has been broken since v2.2.10, although the setting wasn't working
completely correctly before that version either. Afterwards it should have
become obvious quickly enough that the setting is broken, because it started
crashing POP3 sessions in normal use quite soon. So I doubt there are any
installations that are accidentally exploitable.
Timo Sirainen [Fri, 2 Oct 2015 08:13:14 +0000 (11:13 +0300)]
push-notification: Removed optimization to init drivers only once.
Different users may have different drivers. And the previous
metadata-caching change especially isn't working without this change.
Timo Sirainen [Thu, 1 Oct 2015 10:45:17 +0000 (13:45 +0300)]
push-notification: Allow OX driver to use "user" from METADATA only if user_from_metadata is set.
Otherwise users could send push-notifications to each others' if
imap_metadata=yes.
Timo Sirainen [Mon, 28 Sep 2015 20:39:31 +0000 (23:39 +0300)]
lib: s/EDEADLOCK/EDEADLK/
It felt wrong since the beginning, but my first attempt at EDEADLCK didn't
work and EDEADLOCK did. Of course, not everywhere.