Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 26th January 2007, 09:40
jacob jacob is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default -ERR chdir Maildir failed Virtual Users And Domains With Postfix, Courier And MySQL

I've almost got this working. I can send messages and they show up in /home/vmail/user/domain . I am receiving the following error when I try to pop.

-ERR chdir Maildir failed
Connection closed by foreign host.

maillog:

Jan 25 23:26:57 gabriel pop3d: Connection, ip=[::ffff:xx.xxx.xxx.xx]
Jan 25 23:26:57 gabriel authdaemond: received auth request, service=pop3, authtype=login
Jan 25 23:26:57 gabriel authdaemond: authmysql: trying this module
Jan 25 23:26:57 gabriel authdaemond: SQL query: SELECT email, password, "", 5000, 5000, "/home/vmail", "", "", "", "" FROM users WHERE email = "xxx@xxxxxxxxxx.com"
Jan 25 23:26:57 gabriel authdaemond: password matches successfully
Jan 25 23:26:57 gabriel authdaemond: authmysql: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=xxxxxx@xxxxxxx.com, fullname=<null>, maildir=<null>, quota=<null>, options=<null>
Jan 25 23:26:57 gabriel authdaemond: authmysql: clearpasswd=<null>, passwd=Tw3i7telHCPEw
Jan 25 23:26:57 gabriel authdaemond: Authenticated: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=xxxxx@xxxxxxx.com, fullname=<null>, maildir=<null>, quota=<null>, options=<null>
Jan 25 23:26:57 gabriel authdaemond: Authenticated: clearpasswd=xxxxxxx, passwd=xyxyxyxyxyxyx
Jan 25 23:26:57 gabriel pop3d: chdir Maildir: No such file or directory

Please help !!
Reply With Quote
Sponsored Links
  #2  
Old 27th January 2007, 01:30
jacob jacob is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Found the problem

When the doc says
Then edit /etc/authlib/authmysqlrc. It should look exactly like this (again, make sure to fill in the correct database details):

It really should be exactly

I had a space at the begining of the third line from the bottom


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

Last edited by jacob; 27th January 2007 at 01:33.
Reply With Quote
  #3  
Old 27th January 2007, 14:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Yes, Courier is very finicky about the format.
__________________
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
  #4  
Old 5th February 2007, 04:35
sremac sremac is offline
Junior Member
 
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default almost done...

Hi to everyone,

POSTFIX is working perfectly, but there is problem:

I made user in mysql database, and then try to login but there is an error when
try to get it via telnet:
(use courrier-pop and courrier-auth):


Escape character is '^]'.
+OK Hello there.
user test3@virtual.test
+OK Password required.
pass test
-ERR chdir virtual.test/test3/ failed
Connection closed by foreign host.



and in /var/log/mail.log:


courierpop3login: chdir virtual.test/test3/: No such file or directory


Only when I send mail to that user or manually make directory
in /home/vmail/virtual.test it works!

Question is: how to automatically add user only via mysql, without need to send e-mail to user or to made directory?

Does it mean that every mail that is sended, POSTFIX will create new directory at /home/vmail/virtual.test ?

Thanx!

Last edited by sremac; 5th February 2007 at 04:42.
Reply With Quote
  #5  
Old 5th February 2007, 09:33
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

Courier has a tool called
Code:
maildirmake
. See http://www.courier-mta.org/?maildirmake.html for more information.
Reply With Quote
  #6  
Old 6th February 2007, 14:29
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Quote:
Originally Posted by sremac
Only when I send mail to that user or manually make directory
in /home/vmail/virtual.test it works!
That's the normal behaviour. Maildir is created after the first email arrives.
__________________
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 6th February 2007, 15:12
sremac sremac is offline
Junior Member
 
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default why?

So,

it means that senders can send e-mail to my domain, without knowing of my users, and postfix will create directories??

Is there any option like "user unknown", etc?

If postfix create directory for every sent mail (for example test1@domain, test2@domain, test3@domain...) it will be a mess in /home/vmail, won`t it?
Reply With Quote
  #8  
Old 6th February 2007, 16:00
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

No, postfix default behavioral is to only accept users it knows about. But you need to sent an initial mail to this (existing) user. Or use the maildirmake tool yourself in advance.
Reply With Quote
  #9  
Old 8th February 2007, 16:40
sremac sremac is offline
Junior Member
 
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default I got it..

Thanx,

I got it:

first (if using mysql) user must be created in mysql users table (if not postfix will notice "User unknown" error), and then you can send e-mail to that user or create necessery folders in /home/vmail, but must create as vmail user (because there will be error with permissions, for example if root create /home/vmail/virtual_domain).
Reply With Quote
  #10  
Old 9th February 2007, 03:15
sremac sremac is offline
Junior Member
 
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default but...

Thought that everything work, but:

when try to send from one host in network (it`s IP is in $mynetworks in main.cf), there is error with username/password:

mail.log:


02:01:29 KanotixBox postfix/smtpd[27738]: > unknown[192.168.2.8]: 334 UGFzc3dvcmQ6
Feb 9 02:01:29 KanotixBox postfix/smtpd[27738]: < unknown[192.168.2.8]: dGVzdA==
Feb 9 02:01:29 KanotixBox postfix/smtpd[27738]: xsasl_cyrus_server_next: decoded response: test
02:01:29 KanotixBox postfix/smtpd[27738]: warning: unknown[192.168.2.8]: SASL LOGIN authentication failed: authentication failure
Feb 9 02:01:29 KanotixBox postfix/smtpd[27738]: > unknown[192.168.2.8]: 535 5.7.0 Error: authentication failed: authenticationfailure
Feb 9 02:01:31 KanotixBox postfix/smtpd[27738]: smtp_get: EOF
02:01:31 KanotixBox postfix/smtpd[27738]: match_hostname: unknown ~? 127.0.0.0/8
Feb 9 02:01:31 KanotixBox postfix/smtpd[27738]: match_hostaddr: 192.168.2.8 ~? 127.0.0.0/8
Feb 9 02:01:31 KanotixBox postfix/smtpd[27738]: match_hostname: unknown ~? 192.168.2.0/24
Feb 9 02:01:31 KanotixBox postfix/smtpd[27738]: match_hostaddr: 192.168.2.8 ~? 192.168.2.0/24
Feb 9 02:01:31 KanotixBox postfix/smtpd[27738]: lost connection after AUTH from unknown[192.168.2.8]
Feb 9 02:01:31 KanotixBox postfix/smtpd[27738]: disconnect from unknown[192.168.2.8]
Feb 9 02:01:31 KanotixBox postfix/smtpd[27738]: master_notify: status 1
Feb 9 02:01:31 KanotixBox postfix/smtpd[27738]: connection closed



it seems like there is error with SASL/mySQL or...?

(username and password are good in mysql and directory is created in /home/vmail.. and smtpd.conf in /etc/postfix/sasl is good, too, also installed SSL sertificate)
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 And MySQL Secondary MX acoghlan HOWTO-Related Questions 1 8th March 2008 06:02
Virtual Users And Domains With Postfix, Courier And MySQL [+ procmail ?] immobilia HOWTO-Related Questions 5 30th June 2006 00:20
Virtual Users And Domains With Postfix, Courier And MySQL - "apt-get" and Courier burritonator HOWTO-Related Questions 3 15th March 2006 21:11
Problem with Virtual Users And Domains With Postfix, Courier And MySQL Howto fenix Server Operation 4 11th March 2006 03:53
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs ebbay Installation/Configuration 9 4th March 2006 12:47


All times are GMT +2. The time now is 19:00.


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