dovecot 1.0.15
Hello,
i try to set quota settings for my users. currentyl i use a mysql table for auth process and now i want to add quotasettings for each individual user. at the moment i have the problem that only global quota is effective and no userquota which is stored in usertable.
This is my mysql-usertable:
login varchar(255) password varchar(64) home varchar(128) uid int(11) gid int(11) quota_kb varchar(10) active char(1)
In my main-dovecot.conf i have quota/imap_quota activated for pop/imap and protocol lda This is the auth-section which contains passdb/userdb
auth default { mechanisms = plain login passdb sql { args = /etc/dovecot-sql.conf } userdb sql { args = /etc/dovecot-sql.conf } user = root socket listen { client { path = /var/spool/postfix/private/auth mode = 0660 user = postfix group = postfix } } socket listen { client { path = /var/run/dovecot/auth-master mode = 0755 user = nobody } } }
SQL-queries in /etc/dovecot-sql.conf (connection itselfs is ok, auth per mysql is working already)
password_query = SELECT login as user, password, home as userdb_home, uid as userdb_uid, gid as userdb_gid FROM mail_users WHERE login = '%u' AND active='Y'
user_query = SELECT login as user, home, uid, gid, concat('dirsize:storage=', quota_kb) AS quota FROM mail_users WHERE login = '%u'
I think there is something missing in my conf but have no idea what it could be. I need a little hint please.
Thanks, Andre
Em 16/02/2010 09:18, Andre Hübner escreveu:
dovecot 1.0.15
Hello,
i try to set quota settings for my users. currentyl i use a mysql table for auth process and now i want to add quotasettings for each individual user.
Mine is working flawlesslly with the following configuration ....
but i think that's only 1.1+ compatible, because of the Trash thing.
Anyway, seems the big difference from my conf to your is that
you're using
concat('dirsize:storage=', quota_kb) while i'm using concat('*:storage=', quota)
try to change that 'dirsize' to '*' and see what happens ...
my actual working conf for dovecot 1.2.10
# Get the mailbox user_query = select '/var/spool/mail/%u' as home, 'maildir:/var/spool/mail/%u' as mail, 8 as uid, 12 as gid, concat('*:storage=', quota) as quota_rule, 'Trash:storage=100M' as quota_rule2 from emails where endereco = '%u' and ativa = '1'
# Get the password password_query = select endereco as user, password, '/var/spool/mail/%u' as userdb_home, 'maildir:/var/spool/mail/%u' as userdb_mail, 8 as userdb_uid, 12 as userdb_gid, concat('*:storage=', quota) as userdb_quota_rule, 'Trash:storage=100M' as userdb_quota_rule2 from emails where endereco = '%u' and ativa = '1'
--
Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br
Minha armadilha de SPAM, NÃO mandem email
gertrudes@solutti.com.br
My SPAMTRAP, do not email it
Hello,
try to change that 'dirsize' to '*' and see what happens ...
this is unfortunately not compatible with dovecot 1.0, is not working But i noticed that user-quota is working when copying/moving mails within imap-account. But is it not working at incoming mails. any idea?
Thanks, Andre
Em 16/02/2010 10:48, Andre Hübner escreveu:
this is unfortunately not compatible with dovecot 1.0, is not working But i noticed that user-quota is working when copying/moving mails within imap-account. But is it not working at incoming mails. any idea?
so seems your quota is working !!!! What are you using as your
Local Delivery Agent (LDA) ?? Is it dovecot LDA ? Is it some MTA LDA, like Postfix ?
Maybe quota is not working on your LDA ... not on IMAP4/POP3.
--
Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br
Minha armadilha de SPAM, NÃO mandem email
gertrudes@solutti.com.br
My SPAMTRAP, do not email it
Hello,
thanks for your help :)
so seems your quota is working !!!! What are you using as your Local
Delivery Agent (LDA) ?? Is it dovecot LDA ? Is it some MTA LDA, like Postfix ?
Maybe quota is not working on your LDA ... not on IMAP4/POP3.
i switched from procmail to deliver in my postfix main.cf is:
mailbox_command = /usr/libexec/dovecot/deliver
in dovecot.conf:
protocol lda {
postmaster_address = postmaster@example.com sendmail_path = /usr/sbin/sendmail auth_socket_path = /var/run/dovecot/auth-master mail_plugins = quota }
the configured socket is listening: srwxrwxrwx 1 nobody root 0 2010-02-16 14:53 /var/run/dovecot/auth-master
"deliver" is delivering the mail. here a log-line:
Feb 16 14:53:49 myhostname deliver(m01204c5): msgid=26D0A508EF3641EE9F79DCEC887753EF@me.local: saved mail to INBOX
There are no errors etc. logged. but quota ist still working only when logged in into mailaccounts but not on incoming mails. If there would be some errors i could do anything but there is nothing special in the logs...
Thanks, Andre
Hello,
this is unfortunately not compatible with dovecot 1.0, is not working
i switched now to dovecot 1.2.10, which is current stable release. unfortunately my userquoata is not working, just global quota ist active and is not overwritten by userquota from userdb I cannot go on with my setup, the devil's in the detail but i dont find it... I repeat my setup, maybe somebody is seeing something.
this is my mysql-table i use for auth and quota:
login varchar(255) password varchar(64) home varchar(128) uid int(11) gid int(11) quota_bytes varchar(15) active char(1)
typical dataset: username| 027c57a0bda1922cb475b39817e08c0514651a03| /home/popuser/username |508| 500| 10| Y
my password_query: password_query = SELECT login as user, password FROM mail_users WHERE login = '%u' AND active='Y'
my user_query: user_query = SELECT home, uid, gid, concat('*:storage=', quota_bytes,'M') AS quota_rule FROM mail_users WHERE login = '%u'
quota/imap_quota is activated for pop/imap/lda lda is used to deliver mails: plugin-section is:
plugin { quota = dirsize:user quota_rule = *:storage=1000G }
I have no idea why its not working. Quota is only effective if i decrease global quota lower values, it gets not overwritten with data from userdb. in verbose mailog i can see queries to mysql, i double checked format etc. but have no solution.
Thanks, Andre
On Wed, Feb 17, 2010 at 12:26 PM, Andre Hübner andre.huebner@gmx.de wrote:
... I have no idea why its not working. Quota is only effective if i decrease global quota lower values, it gets not overwritten with data from userdb. in verbose mailog i can see queries to mysql, i double checked format etc. but have no solution.
I have the same problem here running 1.2.10. No userdb quota_rule is applied to users, only dovecot.conf ones and if I remove them no quota_rules are loaded. No answers on IRC too.
Regards.
[ ]'s Aledr - Alexandre "OpenSource Solutions for SmallBusiness Problems"
Figured It out... You need to return quota rules in password_query just as you do in user_query. Remember to add userdb_ prefix.
Regards.
On Wed, Feb 17, 2010 at 12:38 PM, aledr matrixworkstation@gmail.com wrote:
On Wed, Feb 17, 2010 at 12:26 PM, Andre Hübner andre.huebner@gmx.de wrote:
... I have no idea why its not working. Quota is only effective if i decrease global quota lower values, it gets not overwritten with data from userdb. in verbose mailog i can see queries to mysql, i double checked format etc. but have no solution.
I have the same problem here running 1.2.10. No userdb quota_rule is applied to users, only dovecot.conf ones and if I remove them no quota_rules are loaded. No answers on IRC too.
Regards.
[ ]'s Aledr - Alexandre "OpenSource Solutions for SmallBusiness Problems"
-- [ ]'s Aledr - Alexandre "OpenSource Solutions for SmallBusiness Problems"
On Wed, 2010-02-17 at 15:26 +0100, Andre Hübner wrote:
my user_query: user_query = SELECT home, uid, gid, concat('*:storage=', quota_bytes,'M') AS quota_rule FROM mail_users WHERE login = '%u'
Do you really want quota_bytes number of megabytes? If not, change the ,'M' part to ,'B'.
quota = dirsize:user
I hope you're not using Maildir?
I have no idea why its not working.
Set auth_debug=yes and mail_debug=yes and show logs. Full dovecot -n output might also be helpful.
Hello,
thanks for help.
On Wed, 2010-02-17 at 15:26 +0100, Andre Hübner wrote:
my user_query: user_query = SELECT home, uid, gid, concat('*:storage=', quota_bytes,'M') AS quota_rule FROM mail_users WHERE login = '%u'
Do you really want quota_bytes number of megabytes? If not, change the ,'M' part to ,'B'. this was just a test, value in db is 10, content of mailbox much bigger.
quota = dirsize:user
I hope you're not using Maildir? yes, still using mbox ;)
I have no idea why its not working.
Set auth_debug=yes and mail_debug=yes and show logs. Full dovecot -n output might also be helpful.
it is working now. had a problem with my virtuell users. this tutorial helped me to set up my postfix http://heinous.org/wiki/Virtual_Domains,_Postfix,_Dovecot_LDA,_and_LDAP
one problem is left ;)
we use a lot of procmail rules. best way would be if we could pipe mails from procmail to deliver like described here: http://wiki.dovecot.org/procmail
but in this case lda ignores my quota and is putting mails in inbox which is actual over quota. is there a way to combine procmail-rules and delivering via dovecot lda?
Thanks for help, Andre
On Fri, 2010-02-19 at 11:32 +0100, Andre Hübner wrote:
best way would be if we could pipe mails from procmail to deliver like described here: http://wiki.dovecot.org/procmail
but in this case lda ignores my quota and is putting mails in inbox which is actual over quota. is there a way to combine procmail-rules and delivering via dovecot lda?
Call deliver with -d $USER parameter.
Hello,
Call deliver with -d $USER parameter.
puhh, thanks, i got it now. lda works + all procmail rules. one thing is left, but i think this is not possible.
our users have full access to procmailparts. if they use procmailrules to attach mails on folders it its possible to bypass the quoatarules because deliver is called at the end of the procmail. if i could call deliver at the beginning of the procmail and deliver would only bouncing mails if mailbox over quota and do nothing in else cases the bypass would be eliminated. but i dont see a way to get mail back to procmailprocessing after piping to binary.
ok, thanks a lot for helping, problem itself is solved, Andre
participants (4)
-
aledr
-
Andre Hübner
-
Leonardo Rodrigues
-
Timo Sirainen