[Dovecot] Dovecot Quotas in Version 2
Hello all,
Just upgraded from Ubuntu 10.04 to 12.04 on a server today and went through a few issues that I finally got corrected with many different services.
However, one of them - I absolutely cannot figure out.
I was using Dovecot 1 in Ubuntu 10.04 - but in Ubuntu 12.04, it has been upgraded to Dovecot 2. Finally managed to get the configuration to work and get it to use MySQL as the back-end authentication method (had to install the dovecot-mysql package).
But, I cannot get quotas to work. The moment I uncomment a quota line, Dovecot fails to start.
Would appreciate any help with this. I am not using any of the individual configuration files on the conf.d folder - simply the dovecot.conf and dovecot-sql.conf file. Here is a copy of those. You can see the one commented line (mail_plugins under imap) simply will not work - but yet the one under POP works (although I don't think it is used):
base_dir = /var/run/dovecot/ disable_plaintext_auth = no first_valid_uid = 33 last_valid_uid = 33 listen = * log_timestamp = "%Y-%m-%d %H:%M:%S " mail_privileged_group = www-data passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } plugin { quota = maildir quota_rule = Trash:storage=100M } protocols = imap pop3 service auth { user = root } service imap-login { executable = /usr/lib/dovecot/imap-login } service imap { executable = /usr/lib/dovecot/imap } ssl = no userdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } protocol imap { imap_client_workarounds = mail_plugin_dir = /usr/lib/dovecot/modules/imap # mail_plugins = quota imap_quota } protocol pop3 { mail_plugins = quota pop3_uidl_format = %08Xu%08Xv }
And for the dovecot-sql.conf file (passwords changed, of course):
driver = mysql connect = dbname=horde user=<USER> password=<PASSWORD> host=localhost default_pass_scheme = PLAIN password_query = SELECT user_uid as user, user_pass as password FROM horde_users WHERE user_uid = '%u'; user_query = SELECT uid, gid, home, maildir, concat('maildir:storage=', quota) AS quota FROM horde_users WHERE user_uid = '%u';
I did not update the dovecot-sql.conf file at all - so I don't know if there maybe be some configuration issue with how it is pulling the quota limit from the database. Quotas are in bytes in the database.
Certainly would appreciate any help with this. I went through the Dovecot Quota Configuration in the wiki but it wasn't any help - as I basically already have that line in the config file, but it will fail to start Dovecot.
Thank you!
Brian S.
On 24.6.2012, at 3.10, Brian Spraker wrote:
plugin { quota = maildir quota_rule = Trash:storage=100M
This should be quota_rule2. Otherwise you'll just overwrite this here:
}
user_query = SELECT uid, gid, home, maildir, concat('maildir:storage=', quota) AS quota FROM horde_users WHERE user_uid = '%u';
You didn't update the quota configuration in here. Should be: concat('*:storage=', quota) AS quota_rule.
BTW. This change happened during Dovecot v1.0 -> v1.1 change. Years ago for most people. :)
--- On Sat, 6/23/12, Timo Sirainen tss@iki.fi wrote:
From: Timo Sirainen tss@iki.fi Subject: Re: [Dovecot] Dovecot Quotas in Version 2 To: "Brian Spraker" spraker@yahoo.com Cc: dovecot@dovecot.org Date: Saturday, June 23, 2012, 7:23 PM On 24.6.2012, at 3.10, Brian Spraker wrote:
plugin { quota = maildir quota_rule = Trash:storage=100M
This should be quota_rule2. Otherwise you'll just overwrite this here:
}
user_query = SELECT uid, gid, home, maildir, concat('maildir:storage=', quota) AS quota FROM horde_users WHERE user_uid = '%u';
You didn't update the quota configuration in here. Should be: concat('*:storage=', quota) AS quota_rule.
BTW. This change happened during Dovecot v1.0 -> v1.1 change. Years ago for most people. :)
Thank you, Timo. I have made this change.
However, I do remember before when I set set something as "quota_rule2", it was being ignored for some reason. I have updated at your response though.
This still didn't correct the issue - and Dovecot won't start when I have the mail_plugins line under 'protocol imap' uncommented.
Error in the syslog says:
init: dovecot main process (xxxxx) terminated with status 89
Brian S.
On 24.6.2012, at 3.29, Brian Spraker wrote:
This still didn't correct the issue - and Dovecot won't start when I have the mail_plugins line under 'protocol imap' uncommented.
You should also enable quota globally so it will work for doveadm and other tools you may end up using.
Error in the syslog says:
init: dovecot main process (xxxxx) terminated with status 89
There should be another error message before this.
--- On Sat, 6/23/12, Timo Sirainen tss@iki.fi wrote:
From: Timo Sirainen tss@iki.fi Subject: Re: [Dovecot] Dovecot Quotas in Version 2 To: "Brian Spraker" spraker@yahoo.com Cc: dovecot@dovecot.org Date: Saturday, June 23, 2012, 7:33 PM On 24.6.2012, at 3.29, Brian Spraker wrote:
This still didn't correct the issue - and Dovecot won't start when I have the mail_plugins line under 'protocol imap' uncommented.
You should also enable quota globally so it will work for doveadm and other tools you may end up using.
Error in the syslog says:
init: dovecot main process (xxxxx) terminated with status 89
There should be another error message before this.
Thank you for the fast replies Timo.
I'm not sure I understand how to enable quota to work globally..? But what would be preventing it from working under 'protocol imap' as it did before?
As for the log, here is the other lines that appeared above it:
Jun 23 19:31:13 server dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) Jun 23 19:31:13 server dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) Jun 23 19:31:13 server kernel: [100996.340925] init: dovecot main process (11580) terminated with status 89
On 24.6.2012, at 3.45, Brian Spraker wrote:
I'm not sure I understand how to enable quota to work globally..?
Just put "mail_plugins = quota" outside protocol {} sections.
But what would be preventing it from working under 'protocol imap' as it did before?
No idea, the error log should say the reason.
As for the log, here is the other lines that appeared above it:
Jun 23 19:31:13 server dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) Jun 23 19:31:13 server dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
These mean that dovecot master process was stopped by init process. Why it's doing that I have no idea.
Jun 23 19:31:13 server kernel: [100996.340925] init: dovecot main process (11580) terminated with status 89
Status 89 means that Dovecot should have logged an error about it. But I see no error here. I think Ubuntu is doing something weird. See what happens if you start dovecot using "dovecot -F" instead of any init script or such.
--- On Sat, 6/23/12, Timo Sirainen tss@iki.fi wrote:
From: Timo Sirainen tss@iki.fi Subject: Re: [Dovecot] Dovecot Quotas in Version 2 To: "Brian Spraker" spraker@yahoo.com Cc: dovecot@dovecot.org Date: Saturday, June 23, 2012, 7:51 PM On 24.6.2012, at 3.45, Brian Spraker wrote:
I'm not sure I understand how to enable quota to work globally..?
Just put "mail_plugins = quota" outside protocol {} sections.
But what would be preventing it from working under 'protocol imap' as it did before?
No idea, the error log should say the reason.
As for the log, here is the other lines that appeared above it:
Jun 23 19:31:13 server dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) Jun 23 19:31:13 server dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
These mean that dovecot master process was stopped by init process. Why it's doing that I have no idea.
Jun 23 19:31:13 server kernel: [100996.340925] init: dovecot main process (11580) terminated with status 89
Status 89 means that Dovecot should have logged an error about it. But I see no error here. I think Ubuntu is doing something weird. See what happens if you start dovecot using "dovecot -F" instead of any init script or such.
Perfect!
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: mail_plugin_dir: access(/usr/lib/dovecot/modules/imap) failed: No such file or directory
I changed it to /usr/lib/dovecot/modules and now it works fine.
Thank you for the help again!
Brian S.
On 2012-06-23 8:10 PM, Brian Spraker spraker@yahoo.com wrote:
Would appreciate any help with this. I am not using any of the individual configuration files on the conf.d folder - simply the dovecot.conf and dovecot-sql.conf file. Here is a copy of those.
Please don't just copy/paste from your configs, always provide doveconf -n output.
This will prove that you are using the config that you *think* you are using (one problem with debian derivatives is that they often use chroot by default which can cause problems). So, if you have something in one of those other individual conf files in conf.d causing the problem, you'll see it in the doveconf -n output.
Then, when providing logs, try not to censor them too much... often the real problem can be evident one or more lines above or below the line that you *think* is the most relevant...
--
Best regards,
Charles
participants (3)
-
Brian Spraker
-
Charles Marcus
-
Timo Sirainen