[Dovecot] Quota not showing properly in webmail
Hi
I have a virtual users system using postfix / mysql / dovecot.
Everything is working like a charm except for the quota display on webmail systems. It is working properly but showing GB instead of MB.
For example. If I create a user with 100MB of quota and send him 50MB of mail, squirrelmail and roundcubemail display 50MB of 100GB If I create another user with 20MB quota and send him 10MB of mail, squirrelmail and roundcube dipslay 10MB of 20GB. if I send 50MB more I get the quota error msg I should get. So everything is workign but its displaying incorrectly. At first I though it was squirrelmail`s fault but it happens with roundcube as well, since both get their quota info from the imap server than I think its dovecot.
I`m using Debian 4.0
This is the output of the --version and the -n dovecot commands.
qgalvao-dns:/# dovecot --version 1.0.rc15 qgalvao-dns:/var/log# dovecot -n # /etc/dovecot/dovecot.conf base_dir: /var/run/dovecot/ log_path: /var/log/dovecot.log log_timestamp: %Y-%m-%d %H:%M:%S protocols: imap imaps pop3s pop3 listen(default): *:143 listen(imap): *:143 listen(pop3): *:110 ssl_listen(default): *:993 ssl_listen(imap): *:993 ssl_listen(pop3): *:995 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: 150 last_valid_uid: 150 mail_privileged_group: mail mail_location: maildir:/vmail/%n@%d maildir_copy_with_hardlinks: yes 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): 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 pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %08Xu%08Xv auth default: mechanisms: login plain digest-md5 cram-md5 user: nobody verbose: yes debug: yes passdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: sql args: /etc/dovecot/dovecot-sql.conf socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: postfix master: path: /var/run/dovecot/auth-master mode: 432 user: vmail group: mail
On Apr 26, 2008, at 1:18 AM, Eden wrote:
Everything is working like a charm except for the quota display on
webmail systems. It is working properly but showing GB instead of MB.
Dovecot expects you to give quota limits in kilobytes, but you're
trying to give the limit in bytes. Divide the quota limit by 1024 and
that should fix it.
I configured dovecot to read the maildirsize file as described here: http://wiki.dovecot.org/Quota/Maildir
This link shows de maildirsize file using bytes as well.
What should I do to make it display right? maybe a bug?
2008/4/26 Timo Sirainen <tss@iki.fi>:
On Apr 26, 2008, at 1:18 AM, Eden wrote:
Everything is working like a charm except for the quota display on webmail systems. It is working properly but showing GB instead of MB.
Dovecot expects you to give quota limits in kilobytes, but you're trying to give the limit in bytes. Divide the quota limit by 1024 and that should fix it.
On 4/27/2008, Eden (edencaldas@gmail.com) wrote:
I configured dovecot to read the maildirsize file as described here: http://wiki.dovecot.org/Quota/Maildir
This link shows de maildirsize file using bytes as well.
What should I do to make it display right? maybe a bug?
First - you are using a very old (well over a year) version (1.0rc15), you really should upgrade - and personally I'd recommend going ahead and upgrading to the new 1.1 version... its rc status, and very close to going gold, and is much better...
Regardless, upgrading to either a current 1.0.x stable version (current is 1.0.13) or the latest 1.1rc (current is rc4) may very well fix the problem...
Second... you still haven't shown whats in maildirsize file...
--
Best regards,
Charles
This one is filled it on purpose to test if it quota is working as intended.
102400000S 98789511 1
It show on webmail clients 98MB of 100GB
If I try to send a large mail it gets bloqued and I recieved the overquota mail.
This one has 20MB quota
20480000S 1001 1
About the version, its the newer I can get from official debian repo.
2008/4/28 Charles Marcus <CMarcus@media-brokers.com>:
On 4/27/2008, Eden (edencaldas@gmail.com) wrote:
I configured dovecot to read the maildirsize file as described here: http://wiki.dovecot.org/Quota/Maildir
This link shows de maildirsize file using bytes as well.
What should I do to make it display right? maybe a bug?
First - you are using a very old (well over a year) version (1.0rc15), you really should upgrade - and personally I'd recommend going ahead and upgrading to the new 1.1 version... its rc status, and very close to going gold, and is much better...
Regardless, upgrading to either a current 1.0.x stable version (current is 1.0.13) or the latest 1.1rc (current is rc4) may very well fix the problem...
Second... you still haven't shown whats in maildirsize file...
--
Best regards,
Charles
On 4/28/2008, Eden (edencaldas@gmail.com) wrote:
About the version, its the newer I can get from official debian repo.
I would never use a distro that would force me to run buggy s/w that was well over a year old, especially when all of the bugs have been fixed long ago.
Daebian backports has 1.0.13...
--
Best regards,
Charles
Just installed version 1.0.13 and exactly the same thing happens. I`ll try to install the lasted tarball version
2008/4/28 Charles Marcus <CMarcus@media-brokers.com>:
On 4/28/2008, Eden (edencaldas@gmail.com) wrote:
About the version, its the newer I can get from official debian repo.
I would never use a distro that would force me to run buggy s/w that was well over a year old, especially when all of the bugs have been fixed long ago.
Daebian backports has 1.0.13...
--
Best regards,
Charles
Just installed version 1.0.13 and exactly the same thing happens. I`ll try to install the lasted tarball version
2008/4/28 Charles Marcus <CMarcus@media-brokers.com>:
On 4/28/2008, Eden (edencaldas@gmail.com) wrote:
About the version, its the newer I can get from official debian repo.
I would never use a distro that would force me to run buggy s/w that was well over a year old, especially when all of the bugs have been fixed long ago.
Daebian backports has 1.0.13...
--
Best regards,
Charles
I use 1.0.rc15-2etch4 and quota seems to work correctly for me :)
-- Pozdrawiam, Tommy
On Sun, 2008-04-27 at 22:49 -0300, Eden wrote:
I configured dovecot to read the maildirsize file as described here: http://wiki.dovecot.org/Quota/Maildir
This link shows de maildirsize file using bytes as well.
Yes, it's bytes in the maildirsize file. But how do you return the "quota" setting? I guess you're returning it from sql userdb? Show me the user_query from dovecot-sql.conf?
(I'm guessing it contains "quota=maildir:storage=n" where n is quota limit in bytes (instead of in kilobytes), which overrides limits from maildirsize file).
Showing all My confg again this time including the sql config:
*################ dovecot.conf: ##############*
## Dovecot configuration file # base_dir = /var/run/dovecot/ disable_plaintext_auth = no # # imap imaps pop3 pop3s (use imaps and pop3s if configured for SSL) protocols = imap imaps pop3s pop3 # # Uncomment the ssl_listen statements and comment out listen if using SSL protocol imap { listen = *:143 ssl_listen = *:993 mail_plugins = quota imap_quota } protocol pop3 { listen = *:110 ssl_listen = *:995 } log_path = /var/log/dovecot.log log_timestamp = "%Y-%m-%d %H:%M:%S " #syslog_facility = mail # # Uncomment these if using SSL #ssl_cert_file = /etc/ssl/mycompany/mailserver/mail-cert.pem #ssl_key_file = /etc/ssl/mycompany/mailserver/mail-key.pem #ssl_ca_file = /etc/ssl/mycompany/ca/mycompany.pem #ssl_verify_client_cert = yes #ssl_parameters_regenerate = 168 #verbose_ssl = no # # Where the mailboxes are located #mail_location = maildir:/vmail/%d/%u mail_location = maildir:/vmail/%n@%d # #mail_access_groups = mail vmail postfix #mail_extra_groups = mail vmail postfix mail_privileged_group = mail mail_debug = no first_valid_uid = 150 last_valid_uid = 150 maildir_copy_with_hardlinks = yes # protocol imap { login_executable = /usr/lib/dovecot/imap-login mail_executable = /usr/lib/dovecot/imap imap_max_line_length = 65536 } protocol pop3 { login_executable = /usr/lib/dovecot/pop3-login mail_executable = /usr/lib/dovecot/pop3 pop3_uidl_format = %08Xu%08Xv } #protocol lda { #postmaster_address = postmaster@mydomain.com #sendmail_path = /usr/lib/sendmail #auth_socket_path = /var/run/dovecot/auth-master #} # auth_verbose = yes auth_debug = yes auth_debug_passwords = no # auth default { mechanisms = login plain digest-md5 cram-md5 passdb sql { args = /etc/dovecot/dovecot-sql.conf } userdb sql { args = /etc/dovecot/dovecot-sql.conf } user = nobody socket listen { master { path = /var/run/dovecot/auth-master mode = 0660 user = vmail group = mail } client { path = /var/spool/postfix/private/auth mode = 0660 user = postfix group = postfix } } # # If you want client certificates, use these lines # ssl_require_client_cert = yes # ssl_username_from_cert = yes }
plugin { quota = maildir }
*####################### dovecot-sql.conf ###################################*
driver = mysql connect = host=127.0.0.1 dbname=SECRET-DB user=SECRET-USER password=SECRET-PASS default_pass_scheme = MD5 user_query = SELECT '/vmail/%n@%d' AS home, 'maildir:/vmail/%n@%d' AS mail, 150 AS uid, 8 AS gid, CONCAT('dirsize:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1' password_query = SELECT username AS user, password, '/vmail/%n@%d' AS userdb_home, 'maildir:/vmail/%n@%d' AS userdb_mail, 150 AS userdb_uid, 8 AS userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
2008/4/28 Timo Sirainen <tss@iki.fi>:
On Sun, 2008-04-27 at 22:49 -0300, Eden wrote:
I configured dovecot to read the maildirsize file as described here: http://wiki.dovecot.org/Quota/Maildir
This link shows de maildirsize file using bytes as well.
Yes, it's bytes in the maildirsize file. But how do you return the "quota" setting? I guess you're returning it from sql userdb? Show me the user_query from dovecot-sql.conf?
(I'm guessing it contains "quota=maildir:storage=n" where n is quota limit in bytes (instead of in kilobytes), which overrides limits from maildirsize file).
On Apr 29, 2008, at 8:13 PM, Eden wrote:
user_query = SELECT '/vmail/%n@%d' AS home, 'maildir:/vmail/%n@%d' AS mail, 150 AS uid, 8 AS gid, CONCAT('dirsize:storage=', quota) AS quota
Looks like you're not even using Maildir++ quota. Change the above to:
CONCAT('maildir:storage=', quota div 1024) AS quota
On 4/29/2008 1:13 PM, Eden wrote:
Showing all My confg again this time including the sql config:
Please don't do that, just provide the output of dovecot -n...
Until Timo gets around to making this command output ALL config settings being used, you'll still have to provide those settings that it doesn't output separately.
This way, you are sure that dovecot is actually using the config file you think it is using, *and* that you haven't typod something somewhere...
--
Best regards,
Charles
Thanks a lot Timo, that was exactly what was causing the error. It works now with every dovecot version I try.
2008/4/29 Charles Marcus <CMarcus@media-brokers.com>:
On 4/29/2008 1:13 PM, Eden wrote:
Showing all My confg again this time including the sql config:
Please don't do that, just provide the output of dovecot -n...
Until Timo gets around to making this command output ALL config settings being used, you'll still have to provide those settings that it doesn't output separately.
This way, you are sure that dovecot is actually using the config file you think it is using, *and* that you haven't typod something somewhere...
--
Best regards,
Charles
participants (4)
-
Charles Marcus
-
Eden
-
Timo Sirainen
-
Tommy