View Single Post
  #1  
Old 6th April 2009, 11:43
VTCop VTCop is offline
Junior Member
 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.10)

I have one problem with this tutorial

Postfix works as MTA, but there is a problem. Its crearte the virtual users folder in wrong place. Then when courier goes to look for email says: chdir failed.

I think the problem is that postfix leave the emails in one place an courier search it in other.

Postfix create this folder structure
/home/vmail/domain1.com/cur
/home/vmail/domain1.com/new
/home/vmail/domain1.com/tmp

/home/vmail/domain2.com/cur
/home/vmail/domain2.com/new
/home/vmail/domain2.com/tmp

But courier search the emails at

/home/vmail/domain1.com/user/
/home/vmail/domain2.com/user/

I think that the problem is in postfix configuration at file /etc/postfix/mysql-virtual_mailboxes.cf
At the tutorial says:
Quote:
user = mail_admin
password = mail_admin_password
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s'
hosts = 127.0.0.1
I think than the line query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s' its wrong. Its output some like domain1.com

Courier search the emails with the configuration in /etc/courier/authmysqlrc:
Quote:
MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD mail_admin_password
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
#MYSQL_NAME_FIELD
MYSQL_QUOTA_FIELD quota
The line CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') output some like domain1.com/user but Postfix configuration output some like domain1.com/

Is this true?
Is this the cause of chdir failed at courier?

I think that the correct line at /etc/postfix/mysql-virtual_mailboxes.cf must be:
query = SELECT CONCAT(SUBSTRING_INDEX(email, '@', -1), '/', SUBSTRING_INDEX(email, '@', 1), '/') FROM users WHERE email='%s'
Am I ok?

Thanks, I have learned a lot with this tutorial

Last edited by VTCop; 6th April 2009 at 11:52.
Reply With Quote
Sponsored Links