[Dovecot] Problem with quota dovecot as lda and mysql

Claudio Prono claudio.prono at atpss.net
Mon Oct 27 11:55:54 EET 2008


Hello to all,

That is my situation: I am trying to use dovecot as LDA with postfix,
mysql e postfixadmin. So, all the users are stored in mysql, with quota
password and all other things. All works properly, except for quota. I
am trying to do some tests, but is not clear to me how to debug that
problem.

Scenario: user with 15 Mb of quota.

That is my dovecot.conf (dovecot version 1.1.3 on OpenSuSE 11.0):

 dovecot -n
# 1.1.3: /etc/dovecot/dovecot.conf
log_path: /var/log/dovecot-err.log
info_log_path: /var/log/dovecot-inf.log
protocols: imap imaps pop3 pop3s
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
first_valid_uid: 51
last_valid_uid: 51
first_valid_gid: 51
last_valid_gid: 51
mail_location: maildir:/var/mail/virtual/%d/%u
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
imap_client_workarounds(default): outlook-idle
imap_client_workarounds(imap): outlook-idle
imap_client_workarounds(pop3):
pop3_uidl_format(default): %08Xu%08Xv
pop3_uidl_format(imap): %08Xu%08Xv
pop3_uidl_format(pop3): %Mf
auth default:
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-mysql.conf
  userdb:
    driver: passwd
  userdb:
    driver: sql
    args: /etc/dovecot/dovecot-mysql.conf
  socket:
    type: listen
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
plugin:
  quota: maildir
  quota: maildir:user quota

And this is my dovecot-mysql.conf:

driver = mysql
connect = host=127.0.0.1 port=3306 user=postfix password=XXXXXXXXXXX
dbname=postfix
default_pass_scheme = MD5-CRYPT

password_query = SELECT username as user, password,
'/var/mail/virtual/%d/%u' as
userdb_home,'maildir:/var/mail/virtual/%d/%u' , 51 as userdb_uid, 51 as
userdb_gid FROM mailbox WHERE username = '%n@%d' AND active = '1'

user_query = SELECT maildir, 51 AS uid, 51 AS gid, 
concat('dirsize:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota FROM
mailbox WHERE username = '%u' AND active = '1'

But.. when i send a mail that "overquota" the mailbox, nothing happens,
the mail is normally delivered to maildir and the quota is not considered.

An example of the process:

I take a mailbox with 15Mb of quota, like test at test.com:

Email 	Nome 	Quota (MB) 	Ultima modifica 	Attivo 	 
test at test.com 	test 	15 	2008-10-27 11:47:43 	SI
<edit-active.php?username=test%40test.com&domain=test.com> 	modifica
<edit-mailbox.php?username=test%40test.com&domain=test.com> 	cancella
<delete.php?table=mailbox&delete=test%40test.com&domain=test.com>


I try to send an email to it:

Oct 27 11:48:53 dns postfix/smtpd[3489]: connect from
cla.mediaservice.pri[192.168.87.70]
Oct 27 11:48:53 dns postfix/smtpd[3489]: D8DF2837:
client=cla.mediaservice.pri[192.168.87.70]
Oct 27 11:48:53 dns postfix/cleanup[3494]: D8DF2837:
message-id=<49058EB2.5080208 at atpss.net>
Oct 27 11:48:58 dns postfix/qmgr[2636]: D8DF2837:
from=<claudio.prono at atpss.net>, size=7716371, nrcpt=1 (queue active)
Oct 27 11:48:58 dns postfix/smtpd[3489]: disconnect from
cla.mediaservice.pri[192.168.87.70]
Oct 27 11:48:59 dns postfix/pipe[3496]: D8DF2837: to=<test at test.com>,
relay=dovecot, delay=5.6, delays=4.9/0/0/0.71, dsn=2.0.0, status=sent
(delivered via dovecot service)
Oct 27 11:48:59 dns postfix/qmgr[2636]: D8DF2837: removed

Fine, the mail was put into mailbox.

dns:/var/mail/virtual/test.com/test at test.com # du -h
0       ./cur
7.3M    ./new
0       ./tmp
7.3M    .

Now i try to put in overquota the mailbox with other 2 mails of the same
dimension.

First one:

Oct 27 11:50:52 dns postfix/smtpd[3684]: connect from
cla.mediaservice.pri[192.168.87.70]
Oct 27 11:50:52 dns postfix/smtpd[3684]: 220D4837:
client=cla.mediaservice.pri[192.168.87.70]
Oct 27 11:50:52 dns postfix/cleanup[3689]: 220D4837:
message-id=<49058F28.8050004 at atpss.net>
Oct 27 11:51:13 dns postfix/qmgr[2636]: 220D4837:
from=<claudio.prono at atpss.net>, size=7716372, nrcpt=1 (queue active)
Oct 27 11:51:13 dns postfix/smtpd[3684]: disconnect from
cla.mediaservice.pri[192.168.87.70]
Oct 27 11:51:14 dns postfix/pipe[3691]: 220D4837: to=<test at test.com>,
relay=dovecot, delay=22, delays=22/0.01/0/0.56, dsn=2.0.0, status=sent
(delivered via dovecot service)
Oct 27 11:51:14 dns postfix/qmgr[2636]: 220D4837: removed

dns:/var/mail/virtual/test.com/test at test.com # du -h
0       ./cur
15M     ./new
0       ./tmp
15M     .

That's ok, the quota is 15Mb, next mail...

Oct 27 11:52:27 dns postfix/smtpd[3684]: connect from
cla.mediaservice.pri[192.168.87.70]
Oct 27 11:52:27 dns postfix/smtpd[3684]: 4441D837:
client=cla.mediaservice.pri[192.168.87.70]
Oct 27 11:52:27 dns postfix/cleanup[3689]: 4441D837:
message-id=<49058F87.4010600 at atpss.net>
Oct 27 11:52:49 dns postfix/qmgr[2636]: 4441D837:
from=<claudio.prono at atpss.net>, size=7716371, nrcpt=1 (queue active)
Oct 27 11:52:49 dns postfix/smtpd[3684]: disconnect from
cla.mediaservice.pri[192.168.87.70]
Oct 27 11:52:50 dns postfix/pipe[3691]: 4441D837: to=<test at test.com>,
relay=dovecot, delay=23, delays=22/0.01/0/0.56, dsn=2.0.0, status=sent
(delivered via dovecot service)
Oct 27 11:52:50 dns postfix/qmgr[2636]: 4441D837: removed

Wrong! The mail quota was not seen, and in fact...

dns:/var/mail/virtual/test.com/test at test.com # du -h
0       ./cur
22M     ./new
0       ./tmp
22M     .

Overquota is here!

Any suggestion? I have already readed the quota howto of dovecot, with
no results, all seems ok, but quota is not used... PLS HELP!!!

Thank u in advance,

Claudio Prono.

-- 
------------
Claudio Prono
Systems Development @ Atpss.net Srl, Divisione Implementazione Sistemi
Via San Bernardino, 17 - 10137 Torino (TO) - IT
Tel +39-011.32.72.100  Fax +39-011.32.46.497
PGP Fingerprint: 75C2 4049 E23D 2FBF A65F  40DB EA5C 11AC C2B0 3647
Disclaimer: http://atpss.net/disclaimer
------------ 



More information about the dovecot mailing list