Timo Sirainen [Mon, 29 Oct 2012 20:03:25 +0000 (22:03 +0200)]
If prefix="" namespace isn't defined, autocreate it as an unusable namespace.
This avoids having to handle mail_namespace_find() errors all over the
place. Instead now the mailbox accesses will simply fail.
Timo Sirainen [Mon, 29 Oct 2012 12:50:11 +0000 (14:50 +0200)]
lib-storage: Moved mail attribute dict to struct mail_storage.
This also means that index_storage_destroy() must always be called, so
removed now unnecessary mail_storage.destroy=NULL checks.
Timo Sirainen [Mon, 29 Oct 2012 12:19:24 +0000 (14:19 +0200)]
lib-storage: Allow calling mailbox_get_private_flags_mask() without mailbox being open.
Most importantly used by mailbox list indexes to determine if it can
optimize a STATUS (UNSEEN) call.
Timo Sirainen [Mon, 29 Oct 2012 10:44:43 +0000 (12:44 +0200)]
lib-index: MAIL_INDEX_TRANSACTION_FLAG_AVOID_FLAG_UPDATES didn't work well enough for keywords.
Removed the code that attempted to optimize some CPU usage at the cost of
writing too many changes.
Timo Sirainen [Wed, 24 Oct 2012 09:47:34 +0000 (12:47 +0300)]
lib-storage: When mkdir()ing home, copy permissions from parent if it has setgid-bit and we're using %h/~.
When using %d/%n instead of %h in the location directories, use the earlier
methods.
Timo Sirainen [Wed, 24 Oct 2012 09:23:36 +0000 (12:23 +0300)]
lib-storage: When creating user directory under domain, set its setgid-bit on.
The previous mkdir_parents_chown() change changed this behavior. I'm not
entirely sure if the setgid-bit is a good idea or not in here, but we'll
just continue the existing behavior.
Timo Sirainen [Wed, 24 Oct 2012 08:30:09 +0000 (11:30 +0300)]
lib-imap: Replaced last traces of imap_quote*() with imap_append_string_for_humans()
Also the imap_append_*string() functions now decide whether to use
quoted-string or literal based on the output string length (if both would
work).
Timo Sirainen [Wed, 24 Oct 2012 08:22:28 +0000 (11:22 +0300)]
lib-imap: bodystructure parsing now uses imap_append_string() instead of imap_quote*()
Some of the fields are parsed through rfc822_*() which guarantees that they
contain proper clean input. Other fields are also machine-readable and don't
benefit from having whitespace compressed or of any other things that
imap_quote*(fix_text=TRUE) did.
Timo Sirainen [Wed, 24 Oct 2012 07:05:37 +0000 (10:05 +0300)]
lib-imap: Changed public IS_ATOM*() macros to match RFC 3501 exactly.
Move the imap-parser specific "atom plus some more" parsing macro inside
imap-parser.c so it's not used by anyone else.
Timo Sirainen [Tue, 23 Oct 2012 17:09:35 +0000 (20:09 +0300)]
istream-seekable: When read() reaches EOF, unreference underlying streams.
This was already done when the stream was kept in memory, but not when when
the stream was written to temporary file.
Timo Sirainen [Mon, 22 Oct 2012 12:32:04 +0000 (15:32 +0300)]
director: Don't remove user's weak flag from notify connection.
If notify connection worked properly, the weak flag should never have been
set in the first place. And if it's just suddenly removed, it won't finish
the pending requests properly.
Timo Sirainen [Mon, 22 Oct 2012 12:20:57 +0000 (15:20 +0300)]
director: Don't handle pending requests from all around the code.
I'm not sure if this actually fixes any bugs, but it definitely makes the
state cleaner.
Timo Sirainen [Sun, 21 Oct 2012 09:20:30 +0000 (12:20 +0300)]
doveadm sync/backup: Added -s <state> parameter to do a fast stateful sync.
Initially use an empty string for the input state. The output state is
written to stdout.
Timo Sirainen [Thu, 18 Oct 2012 03:58:01 +0000 (06:58 +0300)]
lib-imap-urlauth: Minor fix to avoiding timing attacks against mailbox existence.
random_fill() is slightly slower than random_fill_weak(). Probably even
better way to handle timing attacks would be to always add a short random
pause before returning verification failure.
Timo Sirainen [Thu, 18 Oct 2012 03:55:04 +0000 (06:55 +0300)]
Moved random_init() from lib-imap-urlauth to imap/imap-urlauth main().
This way if the processes are chrooted they are still able to open
/dev/urandom.
Timo Sirainen [Thu, 18 Oct 2012 03:00:18 +0000 (06:00 +0300)]
lib-index: Fixed handling of finding a duplicate dovecot.index.log file_seq
Previously we assumed that the already opened file was always the wrong one,
but more common was that the newly opened file was .log.2 which should have
been deleted.