[Dovecot] Quota is not working (Debian Squeeze - Dovecot 1.2)
Hi all, I'm trying to make quota work in Squeeze (Dovecot 1.2.15-7). The quota module is correctly loaded and, when receiving a message, from the log I see these messages:
Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): Loading modules from directory: /usr/lib/dovecot/modules/lda Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): Module loaded: /usr/lib/dovecot/modules/lda/lib10_quota_plugin.so Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): Module loaded: /usr/lib/dovecot/modules/lda/lib90_sieve_plugin.so Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): auth input: uid=5000 Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): auth input: gid=5000 Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): auth input: home=/mail/mailboxes/<mydomain>/testquota Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): Quota root: name=/mail/mailboxes/<mydomain>/testquota backend=maildir args= Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): maildir: data=/mail/mailboxes/<mydomain>/testquota@<mydomain> Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): maildir++: root=/mail/mailboxes/<mydomain>/testquota@<mydomain>, index=, control=, inbox=/mail/mailboxes/<mydomain>/testquota@<mydomain> Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): sieve: user's script path /mail/mailboxes/<mydomain>/testquota/.dovecot.sieve doesn't exist (using global script path in stead) Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): sieve: using sieve path for user's script: /mail/sieve/globalsieverc Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): sieve: opening script /mail/sieve/globalsieverc Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): sieve: executing compiled script /mail/sieve/globalsieverc Jan 16 11:20:04 mail-1 dovecot: deliver(testquota@<mydomain>): Namespace : Using permissions from /mail/mailboxes/<mydomain>/testquota@<mydomain>: mode=0700 gid=-1 Jan 16 11:20:05 mail-1 dovecot: deliver(testquota@<mydomain>): sieve: msgid=4F13F996.4000501@seat.it: stored mail into mailbox 'INBOX'
Now, since I've got a message like this:
Quota root: name=/mail/mailboxes/<mydomain>/testquota@<mydomain> backend=maildir args=
it seems that something is checked, but even if this directory is over quota, nothing happens.
This is my dovecot conf:
protocols = imap pop3 disable_plaintext_auth = no log_timestamp = "%Y-%m-%d %H:%M:%S " mail_location = maildir:/mail/mailboxes/%d/%n@%d mail_privileged_group = mail mail_debug = yes mail_nfs_storage = yes mmap_disable=yes fsync_disable=no mail_nfs_index = yes
protocol imap { mail_plugins = quota imap_quota }
protocol pop3 { pop3_uidl_format = %08Xu%08Xv mail_plugins = quota }
protocol managesieve { }
protocol lda { auth_socket_path = /var/run/dovecot/auth-master postmaster_address = postmaster@<mydomain> mail_plugins = sieve quota quota_full_tempfail = no log_path = }
auth default { mechanisms = plain passdb sql { args = /etc/dovecot/dovecot-sql.conf } userdb passwd { } userdb static { args = uid=5000 gid=5000 home=/mail/mailboxes/%d/%n@%d allow_all_users=yes } user = root socket listen { master { path = /var/run/dovecot/auth-master mode = 0600 user = vmail } client { path = /var/spool/postfix/private/auth mode = 0660 user = postfix group = postfix } } }
plugin { quota = maildir:/mail/mailboxes/%d/%n@%d sieve_global_path = /mail/sieve/globalsieverc }
The db connection works, this is /etc/dovecot/dovecot-sql.conf:
driver = mysql connect = host=<myserver> dbname=mail user=<myuser> password=<mypassword> default_pass_scheme = CRYPT password_query = SELECT username, password FROM mailbox WHERE username='%u' user_query = SELECT username AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
and for the user testquota the user_query results in this:
+-------------------+----------------------------+--------------------+ | user | home | quota_rule | +-------------------+----------------------------+--------------------+ | testquota@<mydom> | <mydom>/testquota@<mydom>/ | *:storage=1024000B | +-------------------+----------------------------+--------------------+
everything else is ok, for example I'm using sieve for the spam filter, and the SPAM is correctly put in the .SPAM dir.
I turned on debug on dovecot, but I can't see if the query in some way fails.
Can you please help me to understand what am I doing wrong?
-- RaSca Mia Mamma Usa Linux: Niente è impossibile da capire, se lo spieghi bene! rasca@miamammausalinux.org http://www.miamammausalinux.org
Il giorno Lun 16 Gen 2012 16:40:59 CET, Simone Caruso ha scritto:
Hi all, I'm trying to make quota work in Squeeze (Dovecot 1.2.15-7).
On 16/01/2012 11:42, RaSca wrote: try "auth_debug = yes"
In fact, enabling auth_debug gives me this:
Jan 16 17:21:06 mail-2 dovecot: auth(default): master in: USER#0111#011testquota@<mydomain>#011service=deliver Jan 16 17:21:06 mail-2 dovecot: auth(default): passwd(testquota@<mydomain>): lookup Jan 16 17:21:06 mail-2 dovecot: auth(default): passwd(testquota@<mydomain>): unknown user Jan 16 17:21:06 mail-2 dovecot: auth(default): master out: USER#0111#011testquota@<mydomain>#011uid=5000#011gid=5000#011home=/mail/mailboxes/<mydomain>/testquota@<mydomain>
But what I don't understand is that manually doing password_query and user_query works.
So why I receive unknown user? Is there something else to set?
-- RaSca Mia Mamma Usa Linux: Niente è impossibile da capire, se lo spieghi bene! rasca@miamammausalinux.org http://www.miamammausalinux.org
On Mon, 2012-01-16 at 11:42 +0100, RaSca wrote:
passdb sql { args = /etc/dovecot/dovecot-sql.conf } userdb passwd { } userdb static { args = uid=5000 gid=5000 home=/mail/mailboxes/%d/%n@%d allow_all_users=yes }
You're using SQL only for passdb lookup.
plugin { quota = maildir:/mail/mailboxes/%d/%n@%d
The above path probably doesn't do what you intended. It's only the user-visible quota root name. It could just as well be "User quota" or something.
The db connection works, this is /etc/dovecot/dovecot-sql.conf:
driver = mysql connect = host=<myserver> dbname=mail user=<myuser> password=<mypassword> default_pass_scheme = CRYPT password_query = SELECT username, password FROM mailbox WHERE username='%u' user_query = SELECT username AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
user_query isn't used, because you aren't using userdb sql.
Il giorno Mer 18 Gen 2012 15:56:41 CET, Timo Sirainen ha scritto: [...]
You're using SQL only for passdb lookup. [...] user_query isn't used, because you aren't using userdb sql.
Hi Timo, thank you, I confirm everything you wrote. In order to help someone with the same problem, when using virtual profiles in mysql, there must be declared both passwd sql (necessary to verify the authentication) and userdb sql (necessary to verify the user informations). For every value that has not a specific user override it is possible to declare a global value in the plugin area (and there must be also "a quota = maildir:User quota" declaration).
In the end, with this configuration the quota plugin works (the sql file remains the same I first posted):
protocols = imap pop3 disable_plaintext_auth = no log_timestamp = "%Y-%m-%d %H:%M:%S " mail_location = maildir:/mail/mailboxes/%d/%u mail_privileged_group = mail #mail_debug = yes #auth_debug = yes mail_nfs_storage = yes mmap_disable=yes fsync_disable=no mail_nfs_index = yes
protocol imap { mail_plugins = quota imap_quota }
protocol pop3 { pop3_uidl_format = %08Xu%08Xv mail_plugins = quota }
protocol managesieve { }
protocol lda { auth_socket_path = /var/run/dovecot/auth-master postmaster_address = postmaster@<mydomain> mail_plugins = sieve quota quota_full_tempfail = no }
auth default { mechanisms = plain
userdb sql { args = /etc/dovecot/dovecot-sql.conf }
passdb sql { args = /etc/dovecot/dovecot-sql.conf }
user = root
socket listen { master { path = /var/run/dovecot/auth-master mode = 0600 user = vmail } client { path = /var/spool/postfix/private/auth mode = 0660 user = postfix group = postfix } } }
plugin { quota = maildir:User quota quota2 = fs:Disk quota quota_rule = *:storage=1G quota_warning = storage=95%% /mail/scripts/quota-warning.sh 95 quota_warning2 = storage=80%% /mail/scripts/quota-warning.sh 80 sieve_global_path = /mail/sieve/globalsieverc }
-- RaSca Mia Mamma Usa Linux: Niente è impossibile da capire, se lo spieghi bene! rasca@miamammausalinux.org http://www.miamammausalinux.org
participants (3)
-
RaSca
-
Simone Caruso
-
Timo Sirainen