Hello,
Thank you for your replies.
joximu Wrote:You may create a mysql table with the values and setup postfix to lookup theese values...
/J
Below are the steps we've taken to do what you have suggested. However, postfix is still not bouncing back messages when it should. I think we're pretty close. Can you think of something we left out?
We used an article we found at
http://www.howtoforge.org/virtual_postfi...courier_p2 to integrate the ISPCP mail_user quota with postfix.
1. Looking towards the bottom of /etc/postfix/main.cf:
#virtual_create_maildirsize = yes
#virtual_mailbox_extended = yes
#virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/ispcp/mysql_virtual_mailbox_limit_maps.cf
#virtual_mailbox_limit_override = yes
#virtual_maildir_limit_message = "The user you're trying to reach is over mailbox quota."
#virtual_overquota_bounce = yes
Uncommented the lines shown above.
2. Created a view in the ISPCP database that will retreive just the data postfix needs:
mysql> CREATE VIEW postfix_quota_checker as SELECT quota, CONCAT(mail_acc,'@',domain_name) as email from mail_users mu INNER JOIN domain d ON (mu.domain_id = d.domain_id) WHERE mail_type='normal_mail';
3. Then, create a mysql user that post fix can use to log in to the ispcp database with:
mysql> GRANT SELECT ON ispcp.postfix_quota_checker TO 'postfix_admin'@'localhost' IDENTIFIED BY 'postfix_mail_admin_password';
mysql> FLUSH PRIVILEGES;
4. Next, create the file /etc/postfix/ispcp/mysql_virtual_mailbox_limit_maps.cf :
user = postfix_admin
password = postfix_mail_admin_password
dbname = ispcp
table = postfix_quota_checker
select_field = quota
where_field = email
hosts = 127.0.0.1
5. Give postfix permissions on this file:
#> chmod o= /etc/postfix/ispcp/mysql_virtual_mailbox_limit_maps.cf
#> chgrp postfix /etc/postfix/ispcp/mysql_virtual_mailbox_limit_maps.cf
6. Restart Postfix and Saslauthd:
#> /etc/init.d/postfix restart
#> postfix check
#> /etc/init.d/saslauthd restart
What are we missing?
Thanks again!