Current time: 05-18-2024, 09:59 PM Hello There, Guest! (LoginRegister)


Post Reply 
[Howto] Per user quota edit within ispcp when using dovecot
Author Message
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
Post: #17
RE: [Howto] quota modification within ispcp when using dovecot
(06-09-2010 07:18 PM)TheCry Wrote:  @aseques
I'd read your docu and there is a litlle issue where you will get the wrong quota of the user...

The problem is you are using:
dovecot-sql-subdomain.conf
Code:
user_query = SELECT CONCAT('/var/mail/virtual/', subdomain.subdomain_name, ".", domain.domain_name, '/',mail_acc) AS home, '1001' AS uid, '8' AS gid FROM (mail_users INNER JOIN subdomain ON mail_users.sub_id = subdomain.subdomain_id) INNER JOIN domain ON mail_users.domain_id = domain.domain_id WHERE mail_acc='%n' and concat(subdomain.subdomain_name,".",domain.domain_name)='%d';

If you add several emailadresses with info@.... and you look in the mail.log you will see the problem!
You can make a test in phpmadmin and execute the query.
%n means the part before @... So you got different lines in your query.

If you are using the query below you will only get one line!
Or you change your query from
Code:
mail_acc='%n'
to
Code:
WHERE mail_addr='%u'

My Query:
Code:
user_query = SELECT concat('/var/mail/virtual/', subdomain.subdomain_name, ".", domain.domain_name, '/',mail_acc) as home, '1001' as uid, '8' as gid, concat('*:bytes=', quota) AS quota_rule FROM (mail_users INNER JOIN subdomain ON mail_users.sub_id = subdomain.subdomain_id) INNER JOIN domain ON mail_users.domain_id = domain.domain_id WHERE mail_addr='%u' and concat(subdomain.subdomain_name,".",domain.domain_name)='%d';


This only an example... You need to change this in every query of dovecot!
I think that you're not right, mail_addr is set for ALL the addresses (also the forwards) while mail_acc can be empty on normal_forward types.
Checking for the userpart + domain part should be fine, there won't be cases where you have to users from the same domain called info.

Otherwise can you give me some more information?
06-09-2010 09:07 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [Howto] quota modification within ispcp when using dovecot - aseques - 06-09-2010 09:07 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)