[Dovecot] dbox and quota question
Hi all, i am asking myself how quota is done with dbox in a virtual setup with having quotas in sql
dove 1.1.1 says quota maildir: No maildir storages, ignoring quota lda means quota maildir: No maildir storages, ignoring quota which is right
i dont wanna use dict , i only wanna use the qutoas out of sql crated by postfixadmin
has someone used this ever ?
Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Sat, 2008-07-12 at 13:29 +0200, Robert Schetterer wrote:
Hi all, i am asking myself how quota is done with dbox in a virtual setup with having quotas in sql
dove 1.1.1 says quota maildir: No maildir storages, ignoring quota lda means quota maildir: No maildir storages, ignoring quota which is right
i dont wanna use dict ,
Maildir++ quota can be used only with Maildir. It would be possible to keep quota in Maildir++ compatible maildirsize file, but there's no code to do that yet and I wasn't planning on implementing it anytime soon.
i only wanna use the qutoas out of sql crated by postfixadmin
What does this mean? Does it create the maildirsize files? Can't you have Dovecot look up the limits from SQL itself in user_query?
Timo Sirainen schrieb:
On Sat, 2008-07-12 at 13:29 +0200, Robert Schetterer wrote:
Hi all, i am asking myself how quota is done with dbox in a virtual setup with having quotas in sql
dove 1.1.1 says quota maildir: No maildir storages, ignoring quota lda means quota maildir: No maildir storages, ignoring quota which is right
i dont wanna use dict ,
Maildir++ quota can be used only with Maildir. It would be possible to keep quota in Maildir++ compatible maildirsize file, but there's no code to do that yet and I wasn't planning on implementing it anytime soon.
i only wanna use the qutoas out of sql crated by postfixadmin
What does this mean? Does it create the maildirsize files? Can't you have Dovecot look up the limits from SQL itself in user_query?
sorry i was unclear here, quotas are created from http postfixadmin gui in a sql table which i like to use with dbox. It works nice with maildir as documented
I thought somehow workaround dbox quota with a dict quota sql... but as i understood examples with dict ,it should be used to update static quotas to a sql table , not read dynamic quotas out of sql ( am i right here? )
I think existing quotas in sql could be used if dovecot would ignore that no maildir storage is used and simply interpretes existing maildirsize files, which maybe created out of existing sql quota entries ( but thats speculate )
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Sat, 2008-07-12 at 14:10 +0200, Robert Schetterer wrote:
i only wanna use the qutoas out of sql crated by postfixadmin
What does this mean? Does it create the maildirsize files? Can't you have Dovecot look up the limits from SQL itself in user_query?
sorry i was unclear here, quotas are created from http postfixadmin gui in a sql table which i like to use with dbox. It works nice with maildir as documented
I thought somehow workaround dbox quota with a dict quota sql... but as i understood examples with dict ,it should be used to update static quotas to a sql table , not read dynamic quotas out of sql ( am i right here? )
Yes, dict quota is about keeping track of the users' current quota. It receives the actual quota limits from external settings.
I think existing quotas in sql could be used if dovecot would ignore that no maildir storage is used and simply interpretes existing maildirsize files, which maybe created out of existing sql quota entries ( but thats speculate )
You can of course create a script for yourself that does that, but I don't think Dovecot should bother trying to do it.
Timo Sirainen schrieb:
On Sat, 2008-07-12 at 14:10 +0200, Robert Schetterer wrote:
i only wanna use the qutoas out of sql crated by postfixadmin What does this mean? Does it create the maildirsize files? Can't you have Dovecot look up the limits from SQL itself in user_query? sorry i was unclear here, quotas are created from http postfixadmin gui in a sql table which i like to use with dbox. It works nice with maildir as documented
I thought somehow workaround dbox quota with a dict quota sql... but as i understood examples with dict ,it should be used to update static quotas to a sql table , not read dynamic quotas out of sql ( am i right here? )
Yes, dict quota is about keeping track of the users' current quota. It receives the actual quota limits from external settings.
I think existing quotas in sql could be used if dovecot would ignore that no maildir storage is used and simply interpretes existing maildirsize files, which maybe created out of existing sql quota entries ( but thats speculate )
You can of course create a script for yourself that does that, but I don't think Dovecot should bother trying to do it.
Hi Timo, it maybe possible with Post-login scripting
like
QUOTA=/usr/bin/mysql -N -B -D${DBDBSE} -h ${DBHOST} -u${DBUSER} -p${DBPASS} -e "SELECT ${DBQOTA} FROM ${DBTABL} where username='$USER'" 2>/dev/null
but i am lost how to answer this in imap to the client
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Sat, 2008-07-12 at 16:12 +0200, Robert Schetterer wrote:
I think existing quotas in sql could be used if dovecot would ignore that no maildir storage is used and simply interpretes existing maildirsize files, which maybe created out of existing sql quota entries ( but thats speculate )
You can of course create a script for yourself that does that, but I don't think Dovecot should bother trying to do it.
Hi Timo, it maybe possible with Post-login scripting
like
QUOTA=
/usr/bin/mysql -N -B -D${DBDBSE} -h ${DBHOST} -u${DBUSER} -p${DBPASS} -e "SELECT ${DBQOTA} FROM ${DBTABL} where username='$USER'" 2>/dev/null
but i am lost how to answer this in imap to the client
You're using userdb sql, right? Why don't you just have it return the quota using user_query? See the examples in http://wiki.dovecot.org/Quota/1.1
Timo Sirainen schrieb:
On Sat, 2008-07-12 at 16:12 +0200, Robert Schetterer wrote:
I think existing quotas in sql could be used if dovecot would ignore that no maildir storage is used and simply interpretes existing maildirsize files, which maybe created out of existing sql quota entries ( but thats speculate ) You can of course create a script for yourself that does that, but I don't think Dovecot should bother trying to do it. Hi Timo, it maybe possible with Post-login scripting
like
QUOTA=
/usr/bin/mysql -N -B -D${DBDBSE} -h ${DBHOST} -u${DBUSER} -p${DBPASS} -e "SELECT ${DBQOTA} FROM ${DBTABL} where username='$USER'" 2>/dev/null
but i am lost how to answer this in imap to the client
You're using userdb sql, right? Why don't you just have it return the quota using user_query? See the examples in http://wiki.dovecot.org/Quota/1.1
seems not to work with dbox
quota maildir: No maildir storages, ignoring quota
Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Sat, 2008-07-12 at 16:38 +0200, Robert Schetterer wrote:
Timo Sirainen schrieb:
On Sat, 2008-07-12 at 16:12 +0200, Robert Schetterer wrote:
I think existing quotas in sql could be used if dovecot would ignore that no maildir storage is used and simply interpretes existing maildirsize files, which maybe created out of existing sql quota entries ( but thats speculate ) You can of course create a script for yourself that does that, but I don't think Dovecot should bother trying to do it. Hi Timo, it maybe possible with Post-login scripting
like
QUOTA=
/usr/bin/mysql -N -B -D${DBDBSE} -h ${DBHOST} -u${DBUSER} -p${DBPASS} -e "SELECT ${DBQOTA} FROM ${DBTABL} where username='$USER'" 2>/dev/null
but i am lost how to answer this in imap to the client
You're using userdb sql, right? Why don't you just have it return the quota using user_query? See the examples in http://wiki.dovecot.org/Quota/1.1
seems not to work with dbox
quota maildir: No maildir storages, ignoring quota
You'll have to use dict quota. That's independent of how the limits as configured.
Timo Sirainen schrieb:
On Sat, 2008-07-12 at 16:38 +0200, Robert Schetterer wrote:
Timo Sirainen schrieb:
On Sat, 2008-07-12 at 16:12 +0200, Robert Schetterer wrote:
I think existing quotas in sql could be used if dovecot would ignore that no maildir storage is used and simply interpretes existing maildirsize files, which maybe created out of existing sql quota entries ( but thats speculate ) You can of course create a script for yourself that does that, but I don't think Dovecot should bother trying to do it. Hi Timo, it maybe possible with Post-login scripting
like
QUOTA=
/usr/bin/mysql -N -B -D${DBDBSE} -h ${DBHOST} -u${DBUSER} -p${DBPASS} -e "SELECT ${DBQOTA} FROM ${DBTABL} where username='$USER'" 2>/dev/null
but i am lost how to answer this in imap to the client You're using userdb sql, right? Why don't you just have it return the quota using user_query? See the examples in http://wiki.dovecot.org/Quota/1.1
seems not to work with dbox
quota maildir: No maildir storages, ignoring quota
You'll have to use dict quota. That's independent of how the limits as configured.
sorry i read dict stuff and i dont understand it i have no idea to make this work out of the wiki
it says
For example:
plugin { # v1.0: 10MB and 1000 messages quota limit quota = dict:storage=10240:messages=1000 mysql:/etc/dovecot-dict-quota.conf # v1.1: quota = dict:::mysql:/etc/dovecot-dict-quota.conf quota_rule = *:storage=10M:messages=1000 }
However, the above example won't really work. This is because it would require linking all the binaries with MySQL library
i understand this
, which I didn't really want to do. Currently you'll have to do this via the dictionary proxy (see below). Actually the performance is better that way anyway, and I don't really see a reason not to use it.
Example dovecot-dict-quota.conf:
connect = host=localhost dbname=mails user=sqluser password=sqlpass table = quota select_field = current where_field = path username_field = username
ok i allready have my quota tables from postfix admin and i am unclear about the query i need as well how to set this in plugin quota section in dovecot.conf
i have this quota userdb sql working with maildir
user_query = SELECT concat('/usr/local/virtual/', maildir) AS home,
concat('*:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota_rule,
#when saving to Trash mailbox the user gets additional 50MB
"Trash:storage=50240" AS quota_rule2,
#when saving to Sent mailbox the user gets additional 50MB
"Sent:storage=50240" AS quota_rule3,
#when saving to Drafts mailbox the user gets additional 50MB
"Drafts:storage=50240" AS quota_rule4,
#when saving to Templates mailbox the user gets additional 50MB
"Templates:storage=50240" AS quota_rule5,
#when saving to Junk mailbox the user gets additional 50MB
"Junk:storage=50240" AS quota_rule6,
#ignore quota on shared
"shared:ignore" AS quota_rule7,
concat('dbox:/usr/local/virtual/', maildir) AS mail,
1001 AS uid, 1001 AS gid FROM mailbox WHERE username = '%u' AND active
= '1'
sorry about asking like newbie here , but i simply dont understand this dict stuff setup
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Sat, 2008-07-12 at 17:07 +0200, Robert Schetterer wrote:
sorry i read dict stuff and i dont understand it i have no idea to make this work out of the wiki .. ok i allready have my quota tables from postfix admin and i am unclear about the query i need as well how to set this in plugin quota section in dovecot.conf
i have this quota userdb sql working with maildir ..
So looks like you don't have to worry about setting quota limits, since you can use the exact same configuration. The only thing you need to change is where you currently have:
plugin { .. quota = maildir }
You'll have to change it to :
plugin { .. quota = dict:::proxy::quotadict }
And then add:
dict { quotadict = mysql:/etc/dovecot-dict-quota.conf }
And create the quota dovecot-dict-quota.conf file as specified in the wiki page and create the quota SQL table as specified by the wiki. The quota SQL table contains the users' current quota values, not the limits.
Timo Sirainen schrieb:
On Sat, 2008-07-12 at 17:07 +0200, Robert Schetterer wrote:
sorry i read dict stuff and i dont understand it i have no idea to make this work out of the wiki .. ok i allready have my quota tables from postfix admin and i am unclear about the query i need as well how to set this in plugin quota section in dovecot.conf
i have this quota userdb sql working with maildir ..
So looks like you don't have to worry about setting quota limits, since you can use the exact same configuration. The only thing you need to change is where you currently have:
plugin { .. quota = maildir }
You'll have to change it to :
plugin { .. quota = dict:::proxy::quotadict }
And then add:
dict { quotadict = mysql:/etc/dovecot-dict-quota.conf }
And create the quota dovecot-dict-quota.conf file as specified in the wiki page and create the quota SQL table as specified by the wiki. The quota SQL table contains the users' current quota values, not the limits.
worked as you stated ( no problem in the logs, stuff in new quota tables semms right ) but quota isnt announced to clients ( horde, thunderbird )
concat('*:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota, \
in the sql statement at dovecot-sql.conf didnt help
quota reported to clients store and change them in postfixadmin sql is desired
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
Robert Schetterer schrieb:
Timo Sirainen schrieb:
On Sat, 2008-07-12 at 17:07 +0200, Robert Schetterer wrote:
sorry i read dict stuff and i dont understand it i have no idea to make this work out of the wiki .. ok i allready have my quota tables from postfix admin and i am unclear about the query i need as well how to set this in plugin quota section in dovecot.conf
i have this quota userdb sql working with maildir ..
So looks like you don't have to worry about setting quota limits, since you can use the exact same configuration. The only thing you need to change is where you currently have:
plugin { .. quota = maildir }
You'll have to change it to :
plugin { .. quota = dict:::proxy::quotadict }
And then add:
dict { quotadict = mysql:/etc/dovecot-dict-quota.conf } And create the quota dovecot-dict-quota.conf file as specified in the wiki page and create the quota SQL table as specified by the wiki. The quota SQL table contains the users' current quota values, not the limits.
worked as you stated ( no problem in the logs, stuff in new quota tables semms right ) but quota isnt announced to clients ( horde, thunderbird )
concat('*:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota, \
in the sql statement at dovecot-sql.conf didnt help
quota reported to clients store and change them in postfixadmin sql is desired
sorry my fault
concat('*:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota,
cant work with dict, working on it
Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Jul 12, 2008, at 7:08 PM, Robert Schetterer wrote:
concat('*:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota,
cant work with dict, working on it
It doesn't work with v1.1 in general. Use "AS quota_rule". Also an
easier way to use bytes quota is:
concat('*:bytes=', mailbox.quota)
Timo Sirainen schrieb:
On Jul 12, 2008, at 7:08 PM, Robert Schetterer wrote:
concat('*:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota,
cant work with dict, working on itIt doesn't work with v1.1 in general. Use "AS quota_rule". Also an easier way to use bytes quota is:
concat('*:bytes=', mailbox.quota)
jep all works no, thx Timo youre great
but be aware my before posted workaround for non expansion of %d domain with deliver through static userdb breaks dict quota, so i have to include your patch for deliver soon
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Sat, July 12, 2008 13:29, Robert Schetterer wrote:
i dont wanna use dict , i only wanna use the qutoas out of sql crated by postfixadmin
has someone used this ever ?
driver = mysql connect = host=localhost dbname=postfix user=postfix password=password default_pass_scheme = MD5-CRYPT password_query = SELECT password FROM mailbox WHERE username = '%u' user_query = SELECT concat('/home/vmail/', maildir) AS home, concat('/home/vmail/', maildir) AS maildir, 125 AS uid, 125 AS gid, concat('maildir:storage=', floor(quota/1024)) AS quota FROM mailbox WHERE username = '%u'
beware of line wraps, this works with postfixadmin here
i just need to solve the 2GB barrier :/
-- Benny Pedersen Need more webspace ? http://www.servage.net/?coupon=cust37098
participants (3)
-
Benny Pedersen
-
Robert Schetterer
-
Timo Sirainen