Re: [Dovecot] Per user quota on MySQL

2010-12-22 Thread Pascal Volk
On 12/20/2010 06:09 PM M. Rodrigo Monteiro wrote:
> Question: can I have quota per domain?

It's possible - sure. See: http://wiki2.dovecot.org/Quota/Dict


Regards,
Pascal
-- 
The trapper recommends today: cafefeed.1035...@localdomain.org


Re: [Dovecot] Per user quota on MySQL

2010-12-21 Thread Robert Schetterer
Am 20.12.2010 22:05, schrieb Charles Marcus:
> On 2010-12-20 12:09 PM, M. Rodrigo Monteiro wrote:
>> Now, I'm using lmtp. The reply works great.
>>
>> Quota per user looks good.
>> Question: can I have quota per domain?
> 
> I don't use it, but latest version of postfixadmin supports domain and
> user quotas...
> 

but domain quota in the postfixadmin http gui should only prevent
delegated postmaster from using more quota space
for their mailboxes in summery of a maildomain then the superuser has
allowed to use for their maildomain, i cant see what sense this should
have this
with integrate in dovecot lmtp quota mech

( as i understand this feature, for sure, as its in mysql you can use it
for other work from tec sight)

normally if you use postfixadmin a delegated postmaster cant setup
more space for its mailboxes as the superadmin has allowed to

so overquota domain is simply a problem that should not exist with
postfixadmin in real

whatever, i cant think about cases where overquota domain might be
usefull, you shouldnt want to have bounces by domain over quota
as the reciept mailbox might have enough space free, and think about
overquota warnings at fill level , sending them to the domain postmaster
makes things more complicated as they need to be , while a overquota
warning to the orginating mailbox owner is enough ( and you are able to
cc/bc this warning to postmasters too , if you like )


-- 
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria


Re: [Dovecot] Per user quota on MySQL

2010-12-20 Thread Charles Marcus
On 2010-12-20 12:09 PM, M. Rodrigo Monteiro wrote:
> Now, I'm using lmtp. The reply works great.
> 
> Quota per user looks good.
> Question: can I have quota per domain?

I don't use it, but latest version of postfixadmin supports domain and
user quotas...

-- 

Best regards,

Charles


Re: [Dovecot] Per user quota on MySQL

2010-12-20 Thread Robert Schetterer
Am 20.12.2010 18:09, schrieb M. Rodrigo Monteiro:
> Hi!
> 
>> anyway you should use lmtp
>> http://wiki2.dovecot.org/LMTP
>> this may avoid i.e backscatter quota bounces
> 
> Excelent!
> 
> Now, I'm using lmtp. The reply works great.
> 
> Quota per user looks good.
> Question: can I have quota per domain?

dont think so, quota is by mailbox trough design
but you might play around with mysql quota to goal this
perhaps Timo knows if this might work
> 
> 
> Regards,
> Rodrigo.
> 
> 


-- 
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria


Re: [Dovecot] Per user quota on MySQL

2010-12-20 Thread M. Rodrigo Monteiro
Hi!

> anyway you should use lmtp
> http://wiki2.dovecot.org/LMTP
> this may avoid i.e backscatter quota bounces

Excelent!

Now, I'm using lmtp. The reply works great.

Quota per user looks good.
Question: can I have quota per domain?


Regards,
Rodrigo.


-- 
M. Rodrigo Monteiro

"Free as in Freedom, not free as in free beer"
"As we are liberated from our own fear, our presence automatically
liberates others"
Linux User # 403730

Pense antes de imprimir. Think before printing.

AVISO LEGAL
Esta mensagem é destinada exclusivamente para a(s) pessoa(s) a quem é
dirigida, podendo conter informação confidencial e/ou legalmente
privilegiada. Se você não for destinatário desta mensagem, desde já
fica notificado de abster-se a divulgar, copiar, distribuir, examinar
ou, de qualquer forma, utilizar a informação contida nesta mensagem,
por ser ilegal. Caso você tenha recebido esta mensagem por engano,
pedimos que nos retorne este E-Mail, promovendo, desde logo, a
eliminação do seu conteúdo em sua base de dados, registros ou sistema
de controle. Fica desprovida de eficácia e validade a mensagem que
contiver vínculos obrigacionais, expedida por quem não detenha poderes
de representação.

LEGAL ADVICE
This message is exclusively destined for the people to whom it is
directed, and it can bear private and/or legally exceptional
information. If you are not addressee of this message, since now you
are advised to not release, copy, distribute, check or, otherwise, use
the information contained in this message, because it is illegal. If
you received this message by mistake, we ask you to return this email,
making possible, as soon as possible, the elimination of its contents
of your database, registrations or controls system. The message that
bears any mandatory links, issued by someone who has no representation
powers, shall be null or void.


Re: [Dovecot] Per user quota on MySQL

2010-12-20 Thread Robert Schetterer
Am 20.12.2010 16:18, schrieb Tom Hendrikx:
> On 20/12/10 16:03, M. Rodrigo Monteiro wrote:
>> ===
>> Dovecot log
>> ===
>> Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=unspecified:
>> save failed to INBOX: Quota exceeded (mailbox for user is full)
>> Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=unspecified:
>> rejected: Quota exceeded (mailbox for user is full)
>> Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=: Return-Path
>> missing, rejection reason: Quota exceeded (mailbox for user is full)
>> ===
>>
>> As you can see in Postfix log, the message goes to Dovecot, dovecot
>> says that mailbox is full, bot don't reject message to Postfix and the
>> sender (me, in this case) don't recieve the bouce saying that the user
>> quota is full.
> 
> As you see in dovecot logging, no Return-Path is specified.  This is the
> reason that no error response is sent: because there is no-one to send
> it to.
> 
> This probably means that you need to alter the way that postfix delivers
> the message to the dovecot LDA: pass -f ${sender} to the LDA so that the
> LDA knows the return path.
> 
> See http://wiki2.dovecot.org/LDA and/or http://wiki2.dovecot.org/LDA/Postfix
> 
> 
> --
> Regards,
>   Tom
> 
anyway you should use lmtp
http://wiki2.dovecot.org/LMTP
this may avoid i.e backscatter quota bounces

-- 
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria


Re: [Dovecot] Per user quota on MySQL

2010-12-20 Thread Tom Hendrikx
On 20/12/10 16:03, M. Rodrigo Monteiro wrote:
> ===
> Dovecot log
> ===
> Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=unspecified:
> save failed to INBOX: Quota exceeded (mailbox for user is full)
> Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=unspecified:
> rejected: Quota exceeded (mailbox for user is full)
> Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=: Return-Path
> missing, rejection reason: Quota exceeded (mailbox for user is full)
> ===
> 
> As you can see in Postfix log, the message goes to Dovecot, dovecot
> says that mailbox is full, bot don't reject message to Postfix and the
> sender (me, in this case) don't recieve the bouce saying that the user
> quota is full.

As you see in dovecot logging, no Return-Path is specified.  This is the
reason that no error response is sent: because there is no-one to send
it to.

This probably means that you need to alter the way that postfix delivers
the message to the dovecot LDA: pass -f ${sender} to the LDA so that the
LDA knows the return path.

See http://wiki2.dovecot.org/LDA and/or http://wiki2.dovecot.org/LDA/Postfix


--
Regards,
Tom



signature.asc
Description: OpenPGP digital signature


Re: [Dovecot] Per user quota on MySQL

2010-12-20 Thread M. Rodrigo Monteiro
Hi!

With much help of Henrique Fernandes, now the quota per user is working.

I'm having problem now with the bounce message.

===
Postfix log
===
Dec 20 11:37:11 sec88 postfix/qmgr[20633]: CBCF2E7D77:
from=, size=2530, nrcpt=1 (queue active)
Dec 20 11:37:11 sec88 postfix/pipe[6178]: CBCF2E7D77:
to=, relay=dovecot, delay=0.55,
delays=0.52/0.01/0/0.02, dsn=2.0.0, status=sent (delivered via dovecot
service)
Dec 20 11:37:11 sec88 postfix/qmgr[20633]: CBCF2E7D77: removed
Dec 20 11:37:41 sec88 postfix/smtpd[6171]: disconnect from
mail-gy0-f182.google.com[209.85.160.182]
===


===
Dovecot log
===
Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=unspecified:
save failed to INBOX: Quota exceeded (mailbox for user is full)
Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=unspecified:
rejected: Quota exceeded (mailbox for user is full)
Dec 20 11:37:11 lda(te...@domain.com.br): Info: msgid=: Return-Path
missing, rejection reason: Quota exceeded (mailbox for user is full)
===

As you can see in Postfix log, the message goes to Dovecot, dovecot
says that mailbox is full, bot don't reject message to Postfix and the
sender (me, in this case) don't recieve the bouce saying that the user
quota is full.

Am I missing some configuration in Dovecot?



Regards,
Rodrigo.


-- 
M. Rodrigo Monteiro

"Free as in Freedom, not free as in free beer"
"As we are liberated from our own fear, our presence automatically
liberates others"
Linux User # 403730

Pense antes de imprimir. Think before printing.

AVISO LEGAL
Esta mensagem é destinada exclusivamente para a(s) pessoa(s) a quem é
dirigida, podendo conter informação confidencial e/ou legalmente
privilegiada. Se você não for destinatário desta mensagem, desde já
fica notificado de abster-se a divulgar, copiar, distribuir, examinar
ou, de qualquer forma, utilizar a informação contida nesta mensagem,
por ser ilegal. Caso você tenha recebido esta mensagem por engano,
pedimos que nos retorne este E-Mail, promovendo, desde logo, a
eliminação do seu conteúdo em sua base de dados, registros ou sistema
de controle. Fica desprovida de eficácia e validade a mensagem que
contiver vínculos obrigacionais, expedida por quem não detenha poderes
de representação.

LEGAL ADVICE
This message is exclusively destined for the people to whom it is
directed, and it can bear private and/or legally exceptional
information. If you are not addressee of this message, since now you
are advised to not release, copy, distribute, check or, otherwise, use
the information contained in this message, because it is illegal. If
you received this message by mistake, we ask you to return this email,
making possible, as soon as possible, the elimination of its contents
of your database, registrations or controls system. The message that
bears any mandatory links, issued by someone who has no representation
powers, shall be null or void.


Re: [Dovecot] Per user quota on MySQL

2010-12-18 Thread Denis Fateyev
Hello,

In my installation (postfixadmin, dovecot-1.2.x), postfixadmin sets and
stores user quota in bytes in `quota` field of `mailbox` table.
Dovecot retrieves stored quotas via `user_query` and `password_query`
mechanism.

---
wbr, Denis.

On Sat, Dec 18, 2010 at 2:59 AM, M. Rodrigo Monteiro <
fale...@rodrigomonteiro.net> wrote:

> On Fri, Dec 17, 2010 at 15:41, Henrique Fernandes 
> wrote:
> > It is missing an global mail plugins conf!
> > []'sf.rique
> >
>
> Ok, now I have the quota in dovecotadm.
>
> doveadm quota get -u te...@domain.com
> Quota name
>  TypeValue Limit %
> storage=1024000
>  STORAGE  5584 - 0
> storage=1024000
>  MESSAGE 7 - 0
>
> But I don't know how to configure to get work quota per user with
> Postfixadmin.
>
> Anyone?
>
>
> Regards,
> Rodrigo.
>
> --
> M. Rodrigo Monteiro
>


Re: [Dovecot] Per user quota on MySQL

2010-12-17 Thread M. Rodrigo Monteiro
On Fri, Dec 17, 2010 at 15:41, Henrique Fernandes  wrote:
> It is missing an global mail plugins conf!
> []'sf.rique
>

Ok, now I have the quota in dovecotadm.

doveadm quota get -u te...@domain.com
Quota name
  TypeValue Limit %
storage=1024000
  STORAGE  5584 - 0
storage=1024000
  MESSAGE 7 - 0

But I don't know how to configure to get work quota per user with Postfixadmin.

Anyone?


Regards,
Rodrigo.

-- 
M. Rodrigo Monteiro

"Free as in Freedom, not free as in free beer"
"As we are liberated from our own fear, our presence automatically
liberates others"
Linux User # 403730

Pense antes de imprimir. Think before printing.

AVISO LEGAL
Esta mensagem é destinada exclusivamente para a(s) pessoa(s) a quem é
dirigida, podendo conter informação confidencial e/ou legalmente
privilegiada. Se você não for destinatário desta mensagem, desde já
fica notificado de abster-se a divulgar, copiar, distribuir, examinar
ou, de qualquer forma, utilizar a informação contida nesta mensagem,
por ser ilegal. Caso você tenha recebido esta mensagem por engano,
pedimos que nos retorne este E-Mail, promovendo, desde logo, a
eliminação do seu conteúdo em sua base de dados, registros ou sistema
de controle. Fica desprovida de eficácia e validade a mensagem que
contiver vínculos obrigacionais, expedida por quem não detenha poderes
de representação.

LEGAL ADVICE
This message is exclusively destined for the people to whom it is
directed, and it can bear private and/or legally exceptional
information. If you are not addressee of this message, since now you
are advised to not release, copy, distribute, check or, otherwise, use
the information contained in this message, because it is illegal. If
you received this message by mistake, we ask you to return this email,
making possible, as soon as possible, the elimination of its contents
of your database, registrations or controls system. The message that
bears any mandatory links, issued by someone who has no representation
powers, shall be null or void.


Re: [Dovecot] Per user quota on MySQL

2010-12-17 Thread Henrique Fernandes
It is missing an global mail plugins conf!
[]'sf.rique


On Fri, Dec 17, 2010 at 4:07 PM, Pascal Volk <
user+dove...@localhost.localdomain.org
> wrote:

> On 12/17/2010 07:06 PM M. Rodrigo Monteiro wrote:
> >
> > There is no quota in doveadm.
>
> See the note at: http://wiki2.dovecot.org/Tools/Doveadm/Quota
>
>
> Regards,
> Pascal
> --
> The trapper recommends today: f007ba11.1035...@localdomain.org
>


Re: [Dovecot] Per user quota on MySQL

2010-12-17 Thread Pascal Volk
On 12/17/2010 07:06 PM M. Rodrigo Monteiro wrote:
> 
> There is no quota in doveadm.

See the note at: http://wiki2.dovecot.org/Tools/Doveadm/Quota


Regards,
Pascal
-- 
The trapper recommends today: f007ba11.1035...@localdomain.org


Re: [Dovecot] Per user quota on MySQL

2010-12-17 Thread M. Rodrigo Monteiro
On Fri, Dec 17, 2010 at 14:50, Henrique Fernandes  wrote:
> Try to use doveadm quota get to see if it is working!

There is no quota in doveadm.


# /usr/local/dovecot/bin/doveadm
usage: doveadm [-Dv] [-f ]  []

  altmove  [-u |-A] [-S ] 
  auth [-a ] [-x ]  []
  config   [doveconf parameters]
  director add|flush|map|remove|status
  dump [-t ] 
  expunge  [-u |-A] [-S ] 
  fetch[-u |-A] [-S ]  
  force-resync [-u |-A] [-S ] 
  help 
  import   [-u |-A] [-S ]   
  kick [-a ] [-f] [|]
  log  find|reopen|test
  mailbox  create|delete|list|mutf7|rename|status|subscribe|unsubscribe
  penalty  [-a ] []
  purge[-u |-A] [-S ]
  pw   [-l] [-p plaintext] [-r rounds] [-s scheme] [-u user] [-V]
  reload
  search   [-u |-A] [-S ] 
  sis  deduplicate|find
  stop
  user [-a ] [-x ]  [...]
  who  [-a ] [-1] [] []



-- 
M. Rodrigo Monteiro

"Free as in Freedom, not free as in free beer"
"As we are liberated from our own fear, our presence automatically
liberates others"
Linux User # 403730

Pense antes de imprimir. Think before printing.

AVISO LEGAL
Esta mensagem é destinada exclusivamente para a(s) pessoa(s) a quem é
dirigida, podendo conter informação confidencial e/ou legalmente
privilegiada. Se você não for destinatário desta mensagem, desde já
fica notificado de abster-se a divulgar, copiar, distribuir, examinar
ou, de qualquer forma, utilizar a informação contida nesta mensagem,
por ser ilegal. Caso você tenha recebido esta mensagem por engano,
pedimos que nos retorne este E-Mail, promovendo, desde logo, a
eliminação do seu conteúdo em sua base de dados, registros ou sistema
de controle. Fica desprovida de eficácia e validade a mensagem que
contiver vínculos obrigacionais, expedida por quem não detenha poderes
de representação.

LEGAL ADVICE
This message is exclusively destined for the people to whom it is
directed, and it can bear private and/or legally exceptional
information. If you are not addressee of this message, since now you
are advised to not release, copy, distribute, check or, otherwise, use
the information contained in this message, because it is illegal. If
you received this message by mistake, we ask you to return this email,
making possible, as soon as possible, the elimination of its contents
of your database, registrations or controls system. The message that
bears any mandatory links, issued by someone who has no representation
powers, shall be null or void.


Re: [Dovecot] Per user quota on MySQL

2010-12-17 Thread Henrique Fernandes
Try to use doveadm quota get to see if it is working!


#doveadm quota get -u exam...@domain.com
Quota name   Type Value   Limit  %
user STORAGE 133189 1048576 12
user MESSAGE   2002   -  0

Use quota recalc also and see what happens.


Se quiser falar comigo em portugues diretamente para discutirmos outros
problems fique a vontade!

[]'sf.rique


On Fri, Dec 17, 2010 at 3:20 PM, M. Rodrigo Monteiro <
fale...@rodrigomonteiro.net> wrote:

> Hi!
>
> I'm new on Dovecot.
> I'm using:
> - CentOS 5.5
> - Kernel 2.6.18-194.26.1.el5 x86_64
> - Dovecot 2.0.8 (from source)
> - Postfix 2.7.2 (from source)
> - MySQL 5.0.77 (CentOS binary)
> - Postfixadmin 2.3.2 (from source)
> - Horde Webmail 1.2.9
> - Thunderbird 3.1.7 (from CentOS)
>
> I follow this how to:
> http://wiki2.dovecot.org/HowTo/DovecotLDAPostfixAdminMySQL
> I was able to send and recieve e-mail via Postfix/Dovecot.
>
> I'm having troubles in the quota.
> As I said, I use Postfixadmin to manage users.
> When I log in Horde, it says that the quota is unlimited. Thunderbird too.
>
> I think it's because of the configuration on Dovecot.
>
>
> Here it's my confs files:
>
>
> =
> dovecot.conf
> =
> #ssl_cert_file = /etc/pki/dovecot/certs/myserver.example.com.crt
> #ssl_key_file = /etc/pki/dovecot/private/myserver.example.com.key
> #ssl_ca_file = /etc/pki/dovecot/certs/ca-bundle.crt
> #default_login_user = nobody
> disable_plaintext_auth = no
> log_path = /var/log/dovecot.log
>
>
> auth_mechanisms = plain login
> first_valid_uid = 200
> last_valid_uid = 200
> mail_location = maildir:/var/vmail/%d/%u
> ssl = no
>
> passdb {
>  args = /usr/local/dovecot/etc/dovecot/sql.conf
>  driver = sql
> }
> plugin {
>  #acl = vfile:/usr/local/dovecot/etc/dovecot/acls
>  quota = maildir:storage=10240:messages=1000
>  trash = /usr/local/dovecot/etc/dovecot/trash.conf
> }
> service auth {
>  unix_listener auth-userdb {
>group = vmail
>mode = 0660
>user = vmail
>  }
>  unix_listener auth-master {
>group = vmail
>mode = 0660
>user = vmail
>  }
>  unix_listener /var/spool/postfix/private/auth {
>group = vmail
>mode = 0660
>user = postfix
>  }
>  user = dovecot
> }
> userdb {
>  args = /usr/local/dovecot/etc/dovecot/sql.conf
>  driver = sql
> }
> userdb {
>  driver = prefetch
> }
> protocol imap {
>  imap_client_workarounds = delay-newmail
>  mail_plugins = quota imap_quota
> }
> protocol pop3 {
>  mail_plugins = quota
>  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
> }
> protocol lda {
>  mail_plugins = quota
>  postmaster_address = postmas...@mydomain.com
>  #log_path = /var/log/dovecot.log
>  #info_log_path = /var/log/dovecot.log
> }
> =
>
>
> =
> sql.conf
> =
> driver = mysql
> connect = host=localhost dbname=postfix user=dovecot password=password
> user_query = SELECT concat('/var/vmail/', maildir) as home,
> concat('maildir:/var/vmail/', maildir) as mail, 200 AS uid, 200 AS
> gid, concat('maildir:storage=', floor(quota/1024)) AS quota FROM
> mailbox WHERE username = '%u' AND active = '1'
> =
>
>
> =
> mysql
> =
> mysql> select * from mailbox;
>
> +--++--+---+-+++-+-++
> | username | password   | name
>| maildir   | quota   | local_part | domain |
> created | modified| active |
>
> +--++--+---+-+++-+-++
> | te...@mydomain.com | $1$bb3d6a71$IF/FORTbdoIqdzBLuSciJ0 | E-mail
> Teste | mydomain.com/teste/ | 1024000 | teste  | mydomain.com |
> 2010-12-17 10:32:16 | 2010-12-17 11:46:24 |  1 |
>
> +--++--+---+-+++-+-++
> =
>
>
> =
> mysql_virtual_mailbox_limit_maps.cf
> =
> user= postfix
> password= password
> hosts   = localhost
> dbname  = postfix
> query   = SELECT quota FROM mailbox WHERE username='%s' AND active
> = '1'
> =
>
>
> I think it's it. If I forgot something, please let me know.
>
>
> Regards,
> Rodrigo.
>
> --
>
> M. Rodrigo Monteiro
>
> "Free as in Freedom, not free as in free beer"
> "As we are liberated from our own fear, our presence automatically
> liberates others"
> Linux User # 403730
>
> Pense antes de imprimir. Think before printing.
>
> AVISO LEGAL
> Esta mensagem é destinada exclusivamente para a(s) pessoa(s) a quem é
> dirigida, podendo conter informação confidencial e/ou legalmente
> privilegiada. Se você não for destinatário desta mensagem, de

[Dovecot] Per user quota on MySQL

2010-12-17 Thread M. Rodrigo Monteiro
Hi!

I'm new on Dovecot.
I'm using:
- CentOS 5.5
- Kernel 2.6.18-194.26.1.el5 x86_64
- Dovecot 2.0.8 (from source)
- Postfix 2.7.2 (from source)
- MySQL 5.0.77 (CentOS binary)
- Postfixadmin 2.3.2 (from source)
- Horde Webmail 1.2.9
- Thunderbird 3.1.7 (from CentOS)

I follow this how to: http://wiki2.dovecot.org/HowTo/DovecotLDAPostfixAdminMySQL
I was able to send and recieve e-mail via Postfix/Dovecot.

I'm having troubles in the quota.
As I said, I use Postfixadmin to manage users.
When I log in Horde, it says that the quota is unlimited. Thunderbird too.

I think it's because of the configuration on Dovecot.


Here it's my confs files:


=
dovecot.conf
=
#ssl_cert_file = /etc/pki/dovecot/certs/myserver.example.com.crt
#ssl_key_file = /etc/pki/dovecot/private/myserver.example.com.key
#ssl_ca_file = /etc/pki/dovecot/certs/ca-bundle.crt
#default_login_user = nobody
disable_plaintext_auth = no
log_path = /var/log/dovecot.log


auth_mechanisms = plain login
first_valid_uid = 200
last_valid_uid = 200
mail_location = maildir:/var/vmail/%d/%u
ssl = no

passdb {
  args = /usr/local/dovecot/etc/dovecot/sql.conf
  driver = sql
}
plugin {
  #acl = vfile:/usr/local/dovecot/etc/dovecot/acls
  quota = maildir:storage=10240:messages=1000
  trash = /usr/local/dovecot/etc/dovecot/trash.conf
}
service auth {
  unix_listener auth-userdb {
group = vmail
mode = 0660
user = vmail
  }
  unix_listener auth-master {
group = vmail
mode = 0660
user = vmail
  }
  unix_listener /var/spool/postfix/private/auth {
group = vmail
mode = 0660
user = postfix
  }
  user = dovecot
}
userdb {
  args = /usr/local/dovecot/etc/dovecot/sql.conf
  driver = sql
}
userdb {
  driver = prefetch
}
protocol imap {
  imap_client_workarounds = delay-newmail
  mail_plugins = quota imap_quota
}
protocol pop3 {
  mail_plugins = quota
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
protocol lda {
  mail_plugins = quota
  postmaster_address = postmas...@mydomain.com
  #log_path = /var/log/dovecot.log
  #info_log_path = /var/log/dovecot.log
}
=


=
sql.conf
=
driver = mysql
connect = host=localhost dbname=postfix user=dovecot password=password
user_query = SELECT concat('/var/vmail/', maildir) as home,
concat('maildir:/var/vmail/', maildir) as mail, 200 AS uid, 200 AS
gid, concat('maildir:storage=', floor(quota/1024)) AS quota FROM
mailbox WHERE username = '%u' AND active = '1'
=


=
mysql
=
mysql> select * from mailbox;
+--++--+---+-+++-+-++
| username | password   | name
| maildir   | quota   | local_part | domain |
created | modified| active |
+--++--+---+-+++-+-++
| te...@mydomain.com | $1$bb3d6a71$IF/FORTbdoIqdzBLuSciJ0 | E-mail
Teste | mydomain.com/teste/ | 1024000 | teste  | mydomain.com |
2010-12-17 10:32:16 | 2010-12-17 11:46:24 |  1 |
+--++--+---+-+++-+-++
=


=
mysql_virtual_mailbox_limit_maps.cf
=
user= postfix
password= password
hosts   = localhost
dbname  = postfix
query   = SELECT quota FROM mailbox WHERE username='%s' AND active = '1'
=


I think it's it. If I forgot something, please let me know.


Regards,
Rodrigo.

-- 

M. Rodrigo Monteiro

"Free as in Freedom, not free as in free beer"
"As we are liberated from our own fear, our presence automatically
liberates others"
Linux User # 403730

Pense antes de imprimir. Think before printing.

AVISO LEGAL
Esta mensagem é destinada exclusivamente para a(s) pessoa(s) a quem é
dirigida, podendo conter informação confidencial e/ou legalmente
privilegiada. Se você não for destinatário desta mensagem, desde já
fica notificado de abster-se a divulgar, copiar, distribuir, examinar
ou, de qualquer forma, utilizar a informação contida nesta mensagem,
por ser ilegal. Caso você tenha recebido esta mensagem por engano,
pedimos que nos retorne este E-Mail, promovendo, desde logo, a
eliminação do seu conteúdo em sua base de dados, registros ou sistema
de controle. Fica desprovida de eficácia e validade a mensagem que
contiver vínculos obrigacionais, expedida por quem não detenha poderes
de representação.

LEGAL ADVICE
This message is exclusively destined for the people to whom it is
directed, and it can bear private and/or legally exceptional
information. If you are not addressee of this message, since now you
are advised to not release, copy, distribute, check or, otherwise, use
t