Mail Quota with Dovecot (User + Domain) - Printable Version +- ispCP - Board - Support (http://www.isp-control.net/forum) +-- Forum: ispCP Omega Support Area (/forum-30.html) +--- Forum: System Setup & Installation (/forum-32.html) +--- Thread: Mail Quota with Dovecot (User + Domain) (/thread-9361.html) |
Mail Quota with Dovecot (User + Domain) - kouga - 01-25-2010 06:20 PM Hi all, I'm enabling mail quota per user by sending mail through Dovecot LDA. Each user's mail quota DOES work, but domain quota isn't calculated while mails are sent to user's mailbox. For example, an environment like below. User quota = 500 MB (set by mistake) Domain quota = 100 MB When more than 100MB of diskspace is used, uploading files through FTP connection will be disabled. But mails will still be sent to users unless it uses 500MB. My question: Is there a way to enable BOTH user and domain quota when receiving mails through Dovecot? RE: Mail Quota with Dovecot (User + Domain) - TheCry - 01-25-2010 06:35 PM Please post the Line from Dovecot, which you are using to calculate the the quota... I postet some month ago, another user query for dovecot because the query from the wiki doesn't work correctly! But no one gives a reply to it, so i don't want to change the wiki. RE: Mail Quota with Dovecot (User + Domain) - aseques - 01-25-2010 07:01 PM (01-25-2010 06:35 PM)TheCry Wrote: Please post the Line from Dovecot, which you are using to calculate the the quota...Hello, I am the mantainer for the wiki page, and I am looking at the forum quite often. If you have any problem with dovecot I'd recommend you to post to this thread: http://www.isp-control.net/forum/thread-6088.html I am subscribed to it, so I get mailed of the answers. BTW: What's the problem with the sql query? RE: Mail Quota with Dovecot (User + Domain) - kouga - 01-25-2010 07:01 PM (01-25-2010 06:35 PM)TheCry Wrote: Please post the Line from Dovecot, which you are using to calculate the the quota... I hope this is what you're looking for.... /etc/dovecot/dovecot-sql-domain.conf Code: driver = mysql /etc/dovecot.conf Code: - partial - RE: Mail Quota with Dovecot (User + Domain) - aseques - 01-25-2010 07:12 PM This is the first time I see the quota_rule stuff, I am still using the 1.0 behaviour of ('maildir:storage=', floor(quota/1024)) AS quota instead of your ('*:storage=', floor(quota/1024)) AS quota_rule I'll have a look at that, with the previous behavior, it was impossible to have a per domain quota. Will see with the post 1.1 version... RE: Mail Quota with Dovecot (User + Domain) - TheCry - 01-25-2010 07:13 PM (01-25-2010 07:01 PM)kouga Wrote: I hope this is what you're looking for....Yes.. It's right Code: user_query = SELECT concat('/var/mail/virtual/', domain.domain_name, '/',mail_acc) as home, '3001' as uid, '12' as gid, concat('*:storage=', floor(quota/1024)) AS quota_rule FROM mail_users inner join domain on mail_users.domain_id = domain.domain_id WHERE mail_acc='%n' and (mail_type='normal_mail' OR mail_type='normal_mail,normal_forward'); In my opinion is this not correct, because %n ist the wrong variable. %n means Quote:user part in user@domain, same as %u if there's no domainIf you have different emailadresses eg "info@..." you will get more than one line in this query. I use this query Code: user_query = SELECT concat('/var/mail/virtual/', domain.domain_name, '/',mail_acc) as home, '1000' as uid, '8' as gid, concat('*:bytes=', quota) AS quota_rule FROM mail_users inner join domain on mail_users.domain_id = domain.domain_id WHERE mail_addr='%u' and (mail_type='normal_mail' OR mail_type='normal_mail,normal_forward'); More info about dovecot variables: http://wiki.dovecot.org/Variables Btw... Code: as home, '3001' as uid, '12' This are the uid and gid of the user vmail! Please check this in your passwd! RE: Mail Quota with Dovecot (User + Domain) - kouga - 01-25-2010 07:23 PM (01-25-2010 07:12 PM)aseques Wrote: This is the first time I see the quota_rule stuff, I am still using the 1.0 behaviour of I'm using Dovecot 1.2.6. So, it's waste of time figuring out how to have per domain quota for mail...? RE: Mail Quota with Dovecot (User + Domain) - TheCry - 01-25-2010 07:27 PM I'm using the same version.. So your config for the quota is ok! RE: Mail Quota with Dovecot (User + Domain) - kouga - 01-25-2010 07:30 PM (01-25-2010 07:13 PM)TheCry Wrote: I see...I'll test this movement. Quote:I use this query This is my setting in master.cf for postfix(partial). Code: dovecot unix - n n - - pipe RE: Mail Quota with Dovecot (User + Domain) - TheCry - 01-25-2010 07:50 PM (01-25-2010 07:30 PM)kouga Wrote:Check this!!! This is important! (01-25-2010 07:30 PM)kouga Wrote: This is my setting in master.cf for postfix(partial).Check the path of deliver This is my config Code: dovecot unix - n n - - pipe |