On Wed, 2012-02-15 at 08:26 +0100, Adam Szpakowski wrote: > On 15.02.2012 02:55, Timo Sirainen wrote: > > On 15.2.2012, at 3.54, Timo Sirainen wrote: > > > >> Domain-quota support in Dovecot is only partial. Recalculating domain > >> quota would require more code. Last time when someone asked about this I > >> wasn't even sure how it could be implemented, but nowadays it actually > >> would be possible to do with: > > Oh, and you could actually already do this with a doveadm script: > [cut] > I'm using something like this, but directly on the dbase level. > Unfortunately such operation is quite db intensive, so I'm looking for a > simpler solution.
Isn't it basically one table scan? To do UPDATE .. WHERE username = '% @domain' > Is there a way to add domainname as another collumn in dbase? This will > simplify the SQL query and the GROUP BY could be used. Not currently. Perhaps for v2.2 dict-sql redesign. > > Of course it would be nice if Dovecot internally supported this. > I was under impression, that dovecot does support this. In examples one > can see: > > /usr/share/doc/dovecot-core/example-config/conf.d/90-quota.conf .. > Also on dovecot2 wiki we can see (http://wiki2.dovecot.org/Quota/Dict): Well, yeah, it kind of works, but not 100% :) Anyway, why is the rescan a problem anyway? Does your domain quota value keep breaking? In normal operation it should work fine.