[Dovecot] quota-dirsize and mailbox rules
I noticed that the dirsize backend for quota didn't support any rules and figured it should be easy enough to add ``ignore'' at least. Using mbox storage and only tested with that, but it seems to work as expected for the time being. I'm attaching a relatively small patch for quota-dirsize.c against dovecot-1.1.18 just in case anyone's interested.
Best Regards, Thanos Chatziathanassiou
On Fri, 2009-08-21 at 16:05 +0300, Thanos Chatziathanassiou wrote:
I noticed that the dirsize backend for quota didn't support any rules and figured it should be easy enough to add ``ignore'' at least. Using mbox storage and only tested with that, but it seems to work as expected for the time being. I'm attaching a relatively small patch for quota-dirsize.c against dovecot-1.1.18 just in case anyone's interested.
The only problem with that is that it should be checking the full mailbox name instead of just the file name. So there are two issues here:
If you're ignoring "foo/bar", your patch currently looks up only to see if "bar" is ignored.
Namespace prefixes need to be used. So for example if you're using namespace { prefix = INBOX/ } and you see a file "foo", you should look for rule "INBOX/foo".
O/H Timo Sirainen έγραψε:
On Fri, 2009-08-21 at 16:05 +0300, Thanos Chatziathanassiou wrote:
I noticed that the dirsize backend for quota didn't support any rules and figured it should be easy enough to add ``ignore'' at least. Using mbox storage and only tested with that, but it seems to work as expected for the time being. I'm attaching a relatively small patch for quota-dirsize.c against dovecot-1.1.18 just in case anyone's interested.
The only problem with that is that it should be checking the full mailbox name instead of just the file name. So there are two issues here:
- If you're ignoring "foo/bar", your patch currently looks up only to see if "bar" is ignored.
I've done that but now I stumbled upon a (logical) problem. Supposing
user has very/deep/path/to/mbox_file''. If the rules specify
path/to/mbox_file'', should it be ignored or not ?
I currently only match very/deep/path/to/mbox_file'' exactly only. I originally meant to ignore only standard mboxes, like
INBOX''
(because my MTA already checks this), Trash'',
Ham'' and Spam'' (because a cronjob expires the former and auto-learns as ham/spam from the latters) But what if the user moves these to e.g.
Uninteresting/Trash'',
SpamFilter/Ham'' and
SpamFilter/Spam''.
- Namespace prefixes need to be used. So for example if you're using namespace { prefix = INBOX/ } and you see a file "foo", you should look for rule "INBOX/foo".
I'm afraid I lack some understanding of namespaces to do this. I read http://wiki.dovecot.org/Namespaces but still can't get it...
participants (2)
-
Thanos Chatziathanassiou
-
Timo Sirainen