I have read through http://wiki.dovecot.org/Quota/Dict, which suggests a database schema for using quota. For 1.2, this includes a username, bytes and messages. Is there any way to modify the queries used to split out username into localpart and domain? This would enable me to put the current quota information in my main mailbox table and display it to users in my admin interface. Or possibly it should be in a separate table for a reason, and I should be look there for the values? Thanks, David
On Mar 6, 2010, at 2:12 PM, David wrote:> I have read through http://wiki.dovecot.org/Quota/Dict, which > suggests a database schema for using quota. For 1.2, this includes > a username, bytes and messages. > > Is there any way to modify the queries used to split out username > into localpart and domain? This would enable me to put the current > quota information in my main mailbox table and display it to users > in my admin interface. > > Or possibly it should be in a separate table for a reason, and I > should be look there for the values?Know nothing about the quota plugin as I work in media and don't use quotes but why not just concat the localpart and domain into an additional column or query against a view? // Brad
On 3/6/2010 5:12 PM, David wrote:> I have read through http://wiki.dovecot.org/Quota/Dict, which suggests a > database schema for using quota. For 1.2, this includes a username, > bytes and messages. > > Is there any way to modify the queries used to split out username into > localpart and domain? This would enable me to put the current quota > information in my main mailbox table and display it to users in my admin > interface. > > Or possibly it should be in a separate table for a reason, and I should > be look there for the values? > > Thanks, > > Davidhttp://wiki.dovecot.org/Variables Excerpt: %u user full username (e.g. user at domain) %n username user part in user at domain, same as %u if there's no domain %d domain domain part in user at domain, empty if user there's no domain Leeman
On Sat, 2010-03-06 at 22:12 +0000, David wrote:> I have read through http://wiki.dovecot.org/Quota/Dict, which suggests a > database schema for using quota. For 1.2, this includes a username, > bytes and messages. > > Is there any way to modify the queries used to split out username into > localpart and domain? This would enable me to put the current quota > information in my main mailbox table and display it to users in my admin > interface.Not currently. If you're using PostgreSQL, you could create a view and update-rule though. I don't know if that's possible with MySQL. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20100307/86cda74d/attachment-0002.bin>
On 07/03/2010 09:58, Timo Sirainen wrote:> On Sat, 2010-03-06 at 22:12 +0000, David wrote: > >> I have read through http://wiki.dovecot.org/Quota/Dict, which suggests a >> database schema for using quota. For 1.2, this includes a username, >> bytes and messages. >> >> Is there any way to modify the queries used to split out username into >> localpart and domain? This would enable me to put the current quota >> information in my main mailbox table and display it to users in my admin >> interface. >> > Not currently. If you're using PostgreSQL, you could create a view and > update-rule though. I don't know if that's possible with MySQL. >Thanks Timo. Is that something which could change in a future version? David
Em 06/03/2010 19:12, David escreveu:> > Is there any way to modify the queries used to split out username into > localpart and domain? This would enable me to put the current quota > information in my main mailbox table and display it to users in my > admin interface. >i'm successfully using a PHP script for displaying a graph with current quota information in my admin interface. Is this what you're looking for ? Quota usage is taken directly from IMAP server, through IMAP commands. http://img707.imageshack.us/img707/9551/quota.jpg i'm actually using a script based on the one found here: http://lists.horde.org/archives/imp/Week-of-Mon-20040816/038902.html the original script grabs the current usage from database, and i dont have the information there. So i changed it to use imap_open and grab quota directly from IMAP server. Something like: Changes would be something like: function draw_bar($mailbox, $width, $height) { global $imaphost, $usuario, $senha; $mbox = @imap_open($imaphost, $usuario, $senha, OP_HALFOPEN); $q = @imap_get_quotaroot($mbox, 'INBOX'); imap_close($mbox); if ($q) { $taken = $q['usage']; $total = $q['limit']; quota_bar($taken, $total, $width, $height); } } that's pretty straightforward when your passwords are stored in clear-text. In my cases password is SSHA256-hashed before storing, so i had to configure a masteruse on dovecot to acchieve that. http://wiki.dovecot.org/Authentication/MasterUsers so i have something: $user = $realuser . "*mymasteruser at local" $password = "mypasteruserpassword" -- Atenciosamente / Sincerily, Leonardo Rodrigues Solutti Tecnologia http://www.solutti.com.br Minha armadilha de SPAM, N?O mandem email gertrudes at solutti.com.br My SPAMTRAP, do not email it