Re: [Postfixadmin-devel] Patch posted for dovecot v1.2 quota viewing
Brought to you by:
christian_boltz,
gingerdog
|
From: Warren V. <wa...@wa...> - 2009-10-04 09:28:52
|
Sorry for the delayed response. On Sep 27, 2009, at 4:25 PM, Christian Boltz wrote: > Hello, > > Am Samstag, 26. September 2009 schrieb Warren Volz: >> I just posted a patch against 2.3rc7 that adds support for viewing >> dovecot v1.2 quotas and fixes a bug that prevents this from working >> unless 'vacation_control_admin' is set. > > Oh yes, another case where we have too many if statements with > different > bugs :-/ and will even have more after applying your patch. > > I just wonder if we really need separate queries for > vacation_control_admin on/off or if we could just skip displaying the > vacation status (which the template already does anyway). > I think we should merge the queries and just skip displaying to have > easier readable code. (I did not do this now to avoid breaking your > patch.) Yeah the if statements can get out of control really quick. I think your suggestion for not displaying the vacation status would be fine by me, but I wonder if there are users that want this. I don't see anything about it in the feature request list, but I might be missing something. > Dovecot quota in general seems to be a can of worms ;-) and the table > format change in dovecot 1.2 doesn't make things easier. Yeah, it makes things a little more complicated for sure. I think the format change for v1.2 does make more sense though. > An idea how to fix the issue you described in your patch: > > // WARNING: This query will fail if a user does not have a > // 'quota/storage' row in the quota table. Not sure how to handle > // this now. > [...] WHERE [...] AND $table_quota.path='quota/storage' > > If there's a list of fixed values dovecot uses, what about using > [...] WHERE [...] AND $table_quota.path !='quota/OTHERVALUE' > (If dovecot has a big list of values it can store in the quota.path > field, this solution won't work.) > -> What other values are possible in the quota.path field? The only other value (that I've seen) is 'quota/messages'. However, I don't think revising the query helps because if an admin using PFA decides not to send a "welcome" email to a new account, the user will have no entries in the quota table at all until a delivery occurs (see http://sourceforge.net/tracker/index.php?func=detail&aid=2794247&group_id=191583&atid=937964 ). The v1.2 quota table doesn't have this problem with the query because there is no need to have the quota table in the WHERE part of the query. > Another issue is how to handle the different table formats in dovecot > 1.1 and 1.2. IMHO we need two(!) quota tables: > - one in dovecot 1.1 format, named "quota" to stay compatible with the > current instructions/documentation (note: the quota table is not > auto-created yet) > - another one (maybe "quota2" or "quota12") in dovecot 1.2 format Hmm, if you ask me this is isn't the best solution because it breaks from what the dovecot wiki suggests thus making things more confusing for users. Also, it seems like setup could check the version of dovecot (dovecot --version) during install/upgrade and set the correct configuration variable for the user. Of course I guess maybe the issue then is how to migrate the quota table for the user? Really deleting and re-creating the quota table isn't a huge deal except that dovecot will be forced to re-compute the quota for each user as they get new mail. This would happen anyways when migrating to the new version of Dovecot though. > setup.php should create both tables. (I'll add the code to setup.php > when the above issues are decided.) > > Regarding PostgreSQL: If I get http://wiki.dovecot.org/Quota/Dict > right, > dovecot needs a trigger for updating the quota. > David, can we let setup.php create this trigger without (permission) > problems? Yeah, Postgres doesn't support ON DUPLICATE KEY UPDATE (which has never really been an issue) thus the need for the trigger. I'm the one that added the v1.1 trigger to the dovecot wiki. Of course, if you add support for v1.2 there will need to be two triggers in the setup file which goes back to the need to check the version of dovecot... -Warren |