
26th January 2007, 08:40
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
-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 !!
|

27th January 2007, 00:30
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 00:33.
|

27th January 2007, 13:50
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
Yes, Courier is very finicky about the format.
|

5th February 2007, 03:35
|
|
Junior Member
|
|
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 03:42.
|

5th February 2007, 08:33
|
|
Senior Member
|
|
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 16 Times in 15 Posts
|
|
Courier has a tool called . See http://www.courier-mta.org/?maildirmake.html for more information.
|

6th February 2007, 13:29
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
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.
|

6th February 2007, 14:12
|
|
Junior Member
|
|
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|

6th February 2007, 15:00
|
|
Senior Member
|
|
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 16 Times in 15 Posts
|
|
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.
|

8th February 2007, 15:40
|
|
Junior Member
|
|
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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).
|

9th February 2007, 02:15
|
|
Junior Member
|
|
Join Date: Feb 2007
Location: Belgrade
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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)
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 17:28.
|
|
Recent comments
2 days 8 hours ago
2 days 17 hours ago
2 days 20 hours ago
2 days 21 hours ago
2 days 22 hours ago
3 days 21 min ago
3 days 1 hour ago
3 days 3 hours ago
3 days 19 hours ago
3 days 19 hours ago