LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix (https://www.linuxquestions.org/questions/linux-server-73/postfix-654264/)

eliufoo 07-08-2008 05:44 AM

Postfix
 
Hi guys,

I'm testing new settings for my mailserver using Virtual Users With Postfix, PostfixAdmin, Courier, Mailscanner, ClamAV On CentOS.

All appears well, except that courier-imap or postfixadmin is not creating maildir for users. Hence, I'm getting the following pop3 error when login using a telnet session.

Quote:

-ERR chdir Maildir failed
maillog

Quote:

Jul 8 13:14:07 helen pop3d: Connection, ip=[::ffff:127.0.0.1]
Jul 8 13:14:07 helen pop3d: Connection, ip=[::ffff:127.0.0.1]
Jul 8 13:14:23 helen authdaemond: received auth request, service=pop3, authtype=login
Jul 8 13:14:23 helen authdaemond: received auth request, service=pop3, authtype=login
Jul 8 13:14:23 helen authdaemond: authmysql: trying this module
Jul 8 13:14:23 helen authdaemond: authmysql: trying this module
Jul 8 13:14:23 helen authdaemond: SQL query: SELECT username, password, password, '1001', '1001', '/var/vmail2', "", concat(quota,'S'), name, "" FROM mailbox WHERE username = 'test@example.com'
Jul 8 13:14:23 helen authdaemond: SQL query: SELECT username, password, password, '1001', '1001', '/var/vmail2', "", concat(quota,'S'), name, "" FROM mailbox WHERE username = 'test@example.com'
Jul 8 13:14:23 helen authdaemond: password matches successfully
Jul 8 13:14:23 helen authdaemond: password matches successfully
Jul 8 13:14:23 helen authdaemond: authmysql: sysusername=<null>, sysuserid=1001, sysgroupid=1001, homedir=/var/vmail2, address=test@example.com, fullname=test user 1, maildir=<null>, quota=0S, options=<null>
Jul 8 13:14:23 helen authdaemond: authmysql: sysusername=<null>, sysuserid=1001, sysgroupid=1001, homedir=/var/vmail2, address=test@example.com, fullname=test user 1, maildir=<null>, quota=0S, options=<null>
Jul 8 13:14:23 helen authdaemond: authmysql: clearpasswd=$1$d5af5760$/tmcedp.r38VgaexnBet2/, passwd=$1$d5af5760$/tmcedp.r38VgaexnBet2/
Jul 8 13:14:23 helen authdaemond: authmysql: clearpasswd=$1$d5af5760$/tmcedp.r38VgaexnBet2/, passwd=$1$d5af5760$/tmcedp.r38VgaexnBet2/
Jul 8 13:14:23 helen authdaemond: Authenticated: sysusername=<null>, sysuserid=1001, sysgroupid=1001, homedir=/var/vmail2, address=test@example.com, fullname=test user 1, maildir=<null>, quota=0S, options=<null>
Jul 8 13:14:23 helen authdaemond: Authenticated: sysusername=<null>, sysuserid=1001, sysgroupid=1001, homedir=/var/vmail2, address=test@example.com, fullname=test user 1, maildir=<null>, quota=0S, options=<null>
Jul 8 13:14:23 helen authdaemond: Authenticated: clearpasswd=test, passwd=$1$d5af5760$/tmcedp.r38VgaexnBet2/
Jul 8 13:14:23 helen authdaemond: Authenticated: clearpasswd=test, passwd=$1$d5af5760$/tmcedp.r38VgaexnBet2/
Jul 8 13:14:23 helen pop3d: chdir Maildir: No such file or directory
Jul 8 13:14:23 helen pop3d: chdir Maildir: No such file or directory
Please assist.

regards,
Elly

BlueC 07-08-2008 04:11 PM

Try sending an email to the address first and if everything is setup correctly then courier-imap will create the Maildir. You can automate this in postfixadmin by setting postfixadmin to send a welcome email when a new account is setup.

If it still doesn't work after sending an email to the address then there is something else amiss...

Mr. C. 07-08-2008 06:15 PM

Actually, courier will not create Maildirs. You must use maildirmake for that.

Postfix will create the Inbox Maildir if none exists, so the Welcome message as indicated by BlueC is a good method.

eliufoo 07-09-2008 12:58 PM

Got it fixed. :-)

It was a typo problem with authmysqlrc file. I found out that, trailing spaces are PROHIBITED and I had plenty of those. See below changes I made. (I will also advise others read authmysqlrc file. my is located in /etc/authlib/authmysqlrc)

Single space between field & value.

Quote:

MYSQL_SERVER localhost
MYSQL_USERNAME vmailuser
MYSQL_PASSWORD vmailpass
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_PORT 0
MYSQL_OPT 0
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD '1001'
MYSQL_GID_FIELD '1001'
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD '/opt/mail'
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD CONCAT("/opt/mail/",maildir)
MYSQL_QUOTA_FIELD concat(quota,'S')
Also, if you are using maildrop to delivery message to your virtual uses. You might encounter the following error.


Quote:

Jul 8 02:14:49 helen postfix/qmgr[9222]: warning: connect to transport maildrop: No such file or directory
Jul 8 02:14:49 helen postfix/qmgr[9222]: warning: connect to transport maildrop: No such file or directory
Jul 8 02:14:49 helen postfix/error[27271]: 71169C12DC: to=<elly@example.co.tz>, orig_to=<root>, relay=none, delay=75934, delays=75934/0.02/0/0.01, dsn=4.3.0, s
tatus=deferred (mail transport unavailable)
Jul 8 02:14:49 helen postfix/error[27271]: 71169C12DC: to=<elly@example.co.tz>, orig_to=<root>, relay=none, delay=75934, delays=75934/0.02/0/0.01, dsn=4.3.0, s
tatus=deferred (mail transport unavailable)
I solved this by changing the ownership of maildroprc.log file from root to vmail.

Quote:

[root@helen ~]# ls -l /var/log/maildroprc.log
-rw-r--r-- 1 vmail vmail 282 Jul 9 20:18 /var/log/maildroprc.log
Mr. C and BlueC, thanks for you advise. I'm using postfixadmin welcome message to create maildir for users.

Regards,


All times are GMT -5. The time now is 12:02 PM.