Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th April 2009, 10: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 10:52.
Reply With Quote
Sponsored Links
  #2  
Old 6th April 2009, 20:01
VTCop VTCop is offline
Junior Member
 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I have seen that the tutorial has been corrected

Thanks
Reply With Quote
  #3  
Old 7th April 2009, 11:03
VTCop VTCop is offline
Junior Member
 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Another thing, how could I check if SpamAssaissin is working correctly? any log or some?

I see at /etc/default/spamsassissn that spamassassin daemon is not enabled. Is it normal?
Reply With Quote
  #4  
Old 7th April 2009, 16:14
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

Quote:
Originally Posted by VTCop View Post
Ok, I have seen that the tutorial has been corrected

Thanks
I didn't change the tutorial, and it was always working for me.

Quote:
Another thing, how could I check if SpamAssaissin is working correctly? any log or some?
Please check /var/log/mail.log.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 7th April 2009, 17:26
wasimriz wasimriz is offline
Junior Member
 
Join Date: Apr 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hello VTcop

I had checked my cat /etc/postfix/mysql-virtual_mailboxes.cf
below is the setting
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'
# Added by wasim 7 April 09
query = SELECT CONCAT(SUBSTRING_INDEX(email, '@', -1), '/', SUBSTRING_INDEX(email, '@', 1), '/') FROM users WHERE email='%s'
hosts = 127.0.0.1

# cat /etc/courier/authmysqlrc
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

Please tell me what changes i need to make so that i can able to login from Webmail
Reply With Quote
  #6  
Old 8th April 2009, 12:29
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

If you've followed the tutorial to the letter and sent a welcome mail to that account, you should be able to log in without any problems. If not, please check /var/log/mail.log.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 8th April 2009, 13:30
VTCop VTCop is offline
Junior Member
 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You must be sure that at ALL lines like
Quote:
MYSQL_PASSWORD mail_admin_password
you put your mysql user password.

There is some lines on some files that you must forgotten, sure.

For example at six Postfix configuration files
/etc/postfix/mysql-virtual_*.cf

or some saslauthd configuration file /etc/pam.d/smtp
Quote:
auth required pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
account sufficient pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
This is a common error
Reply With Quote
  #8  
Old 8th April 2009, 17:05
wasimriz wasimriz is offline
Junior Member
 
Join Date: Apr 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello

I'd re check every /etc/postfix/mysql-virtual_*.cf files user name and passwd is OK. but still i'm facing the same issue

Connection Drop By imap server
Please find my log@ /var/log/mail.log
63, delays=279862/0.12/0.29/1.3, dsn=4.0.0, status=deferred (host mx7.netmagicians.com[202.87.39.107] said: 450 <salil@mynetmagician.net>: Sender address rejected: Domain not found (in reply to RCPT TO command))
Apr 8 11:03:39 mynetmagician imapd: Connection, ip=[::ffff:127.0.0.1]
Apr 8 11:03:39 mynetmagician imapd: chdir mynetmagician.net/salil/: No such file or directory

Please solve my issue
Reply With Quote
  #9  
Old 9th April 2009, 11:37
rieschl rieschl is offline
Junior Member
 
Join Date: Jul 2008
Location: Vienna
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by VTCop View Post
Another thing, how could I check if SpamAssaissin is working correctly? any log or some?
hi

sure! spamassassin has a built-in test-feature: http://spamassassin.apache.org/gtube/
send a mail containing that string to your server and then search for it in the quarantine-folder (/var/lib/amavis/virusmails)
Quote:
Originally Posted by VTCop View Post
I see at /etc/default/spamsassissn that spamassassin daemon is not enabled. Is it normal?
yes, it's normal, because you don't use spamassassin directly but via amavis.


hth

cheers,
thomas
Reply With Quote
  #10  
Old 9th April 2009, 16:17
wasimriz wasimriz is offline
Junior Member
 
Join Date: Apr 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
 
Smile

Hi

I think there no any directories @ /home/vmail

i think due which i'm getting


ERROR: Connection dropped by IMAP server.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail Ubuntu 8.10 slohning HOWTO-Related Questions 5 5th March 2009 19:08
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.10) mrtot HOWTO-Related Questions 26 29th December 2008 12:36
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.10) mathie HOWTO-Related Questions 3 14th December 2008 15:02
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.04 superman HOWTO-Related Questions 3 23rd October 2008 09:19
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail Ubuntu 8.04 paulodani HOWTO-Related Questions 7 4th June 2008 00:46


All times are GMT +2. The time now is 04:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.