On Mon, 2007-05-21 at 13:58 -0600, Kenny Dail wrote:
As I said in my original mail, this is simply a configuration issue:
Looks like you're trying to tell the quota in bytes to Dovecot. Dovecot wants it to be in kilobytes in its configuration file / userdb (it still writes it in bytes to maildirsize, as you can see above it writes 1GB * 1024 value in there).
Where do you get the quota value for Dovecot? Divide it by 1024 and it'll work right. I also use maildrop + dovecot. My quotas are stored in a mysql DB in couriers expected format: 50000000S (note the S on the end for storage). It makes for a very ugly userdb query trying to get that formatted to dovecot style of "maildir:storage=48828:ignore=Trash"
How much would it take to allow dovecot's quota plugin to alternately accept "maildir:50000000S:ignore=Trash"?
If you don't need deliver you could use http://wiki.dovecot.org/PostLoginScripting
v1.1 makes this a bit easier. There you'll need to use:
#quota = maildir # quota_rule = *:storage=1048576 # quota_rule2 = Trash:storage=102400 # User has now 1GB quota, but when saving to Trash mailbox the user gets # additional 100MB.
So only the quota_rule needs to be retrieved from userdb.
I've been thinking about changing the storage-format also so that it could support bytes as well. Suggestions welcome how this could be best achieved. Maybe so that after the numbers there could be (case-insensitive) "k" / "kb" for kilobytes, "m" / "mb" for megabytes, "g" / "gb" for gigabytes, "b" / "s" for bytes. The default would still stay as kilobytes though.
Also the LDAP queries need to be made more flexible so it would be possible to do something like:
user_attrs { homeDirectory = home uidNumber = uid gidNumber = gid quotaBytes = quota_rule=*:storage=%$b maildir = mail=Maildir:%$:INDEX=/var/index/%u }
So %$ would expand to the field that was retrieved from LDAP and other % vars could be used too. %$ is a bit ugly though, but I'm not sure what would be better that isn't already in use (and won't be in future). %1 would be nice, but numbers are already used for other purposes.