Timo Sirainen [Mon, 31 Jan 2011 00:13:06 +0000 (02:13 +0200)]
lib-storage: Moved setting "wanted fields/headers" fields for sort program from imap-specific code.
Also separate between fields that are actually wanted to be fetched from the
fields that sorting wants to temporarily use.
Timo Sirainen [Sun, 30 Jan 2011 18:47:43 +0000 (20:47 +0200)]
imapc: Send UID FETCH commands with larger uidset parameter if possible.
This code assumes that server doesn't reorganize FETCH replies when it's
given an increasing UID range, which in theory IMAP server would be allowed
to do, but I doubt there are any.
Timo Sirainen [Sun, 30 Jan 2011 18:16:04 +0000 (20:16 +0200)]
lib-storage: Index search context is now more accessible by backends.
Moved struct index_search_context to index-search-private.h and added
recheck_index_args flag that backends can set.
Timo Sirainen [Wed, 26 Jan 2011 19:47:52 +0000 (21:47 +0200)]
ioloop: Use -1 for infinite poll/epoll timeout rather than INT_MAX.
Should improve performance a tiny bit and also works around a CPU eater bug
in Linux 2.6.37.
Timo Sirainen [Thu, 20 Jan 2011 18:59:07 +0000 (20:59 +0200)]
lib-storage: mailbox_alloc() now takes a virtual mailbox name and other related API changes.
All storage_name <-> vname conversions now go through the same two
mailbox_list methods. This has many benefits, such as:
* listescape plugin is now much simpler and bugfree
* allows changing lib-storage API to use UTF-8 mailbox names in future
* allows creation of "mailbox aliases" plugin
Timo Sirainen [Sun, 16 Jan 2011 16:08:23 +0000 (18:08 +0200)]
Added initial implementation of "imapc" storage.
It can be used to create a "smart IMAP proxy" where Dovecot uses remote IMAP
server as a mail storage.
This is a very rough early implementation. Performance isn't good, many
required features are missing, error handling is lacking and code needs
de-uglification. Still, it should be enough for selecting INBOX and
accessing mails in it.
Timo Sirainen [Sat, 1 Jan 2011 13:52:39 +0000 (15:52 +0200)]
lib-storage: Moved some items from mailbox_get_status() to a new mailbox_get_metadata().
The idea is now that all status items are tracked all the time after mailbox
is opened and they can always be looked up without failure. The metadata
items are looked up lazily and the lookups may fail at any time.
mailbox_get_status() can be used after mailbox_alloc() to indicate that the
mailbox doesn't necessarily have to be opened, just that the status fields
get returned.
If mailbox is already known to be open, mailbox_get_open_status() can be
used. It never fails.
Timo Sirainen [Fri, 17 Dec 2010 13:23:07 +0000 (13:23 +0000)]
lda: Removed optimization of not creating temp files for large mails when not using Sieve.
The backwards seeking was still needed if bouncing the mail because of
out of quota.
Timo Sirainen [Wed, 15 Dec 2010 17:07:01 +0000 (17:07 +0000)]
master-child API change: Use a separate fd for tracking when master dies.
This works around a Linux performance problem where when one process writes
to status fd all the other processes of the same service type wake up.
Timo Sirainen [Mon, 13 Dec 2010 13:27:18 +0000 (13:27 +0000)]
quota: Quota warnings could have been executed at incorrect times with some configs.
If target mailbox had quota ignored, the warning was sent if the mail would
have otherwise exceeded the warning threshold. Same when using multiple
quota roots where all of the roots weren't used for the target mailbox.
Timo Sirainen [Mon, 6 Dec 2010 03:08:31 +0000 (03:08 +0000)]
lib-storage: Added mailbox_list_get_root_[dir_]permissions()
They should be used instead of mailbox_list_get_[dir_]permissions() with
name=NULL parameter.
Timo Sirainen [Mon, 6 Dec 2010 02:16:22 +0000 (02:16 +0000)]
lib-storage: Simplified mailbox_keyword*() APIs.
They are no longer struct mailbox methods, because they're always implemented
as being wrappers to lib-index APIs anyway.
Also mailbox_keywords_ref/unref() no longer take mailbox parameter.
Timo Sirainen [Mon, 6 Dec 2010 00:52:42 +0000 (00:52 +0000)]
lib-storage: Removed subscription name validity check from lib-storage after all.
It could have broken when subscriptions were being set for subscriptions=no
namespace.
Timo Sirainen [Mon, 6 Dec 2010 00:43:28 +0000 (00:43 +0000)]
lib-storage: Mailbox directory creation didn't properly enforce that the name was valid.
The name was checked against "valid existing name" rather than "valid create
name", which mainly meant that the name could have contained control characters
and other things that weren't really intended. This couldn't be used to
cause any security holes though.
Timo Sirainen [Mon, 6 Dec 2010 00:42:42 +0000 (00:42 +0000)]
acl: Make the mailbox visible only when it has l/r/i right.
This change only affects the ability to SUBSCRIBE to a mailbox. Previously
it was allowed when user had any rights at all to mailbox.
Timo Sirainen [Mon, 6 Dec 2010 00:30:36 +0000 (00:30 +0000)]
imap: Avoid using mailbox_list_get_mailbox_name_status()
The validity checks should already be done by the actual commands in most
cases (if they didn't, there would be race condition bugs). The only
exception is SUBSCRIBE. It doesn't require that the mailbox exists, but
we want to enforce that anyway via IMAP.
Timo Sirainen [Mon, 6 Dec 2010 00:13:28 +0000 (00:13 +0000)]
lib-storage: Mailbox directory creation didn't properly enforce that the name was valid.
The name was checked against "valid existing name" rather than "valid create
name", which mainly meant that the name could have contained control characters
and other things that weren't really intended. This couldn't be used to
cause any security holes though.