10 messages in net.sourceforge.lists.courier-users[courier-users] Courier Authenticatio...
FromSent OnAttachments
Robert Samuel WhiteOct 31, 2005 1:29 am 
Robert Samuel WhiteOct 31, 2005 2:12 am 
Jerry AmundsonOct 31, 2005 8:02 am 
Gordon MessmerOct 31, 2005 9:25 am 
Robert Samuel WhiteOct 31, 2005 1:23 pm 
Gordon MessmerOct 31, 2005 1:37 pm 
Robert Samuel WhiteOct 31, 2005 1:59 pm 
Jay LeeOct 31, 2005 2:15 pm 
Gordon MessmerOct 31, 2005 3:23 pm 
Bill TaroliNov 1, 2005 7:26 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] Courier Authentication (MySQL)Actions...
From:Robert Samuel White (rswf@yahoo.com)
Date:Oct 31, 2005 1:29:16 am
List:net.sourceforge.lists.courier-users

I have read and read and read everything on the courier-mta.org website - I've
searched and searched and search everything on google.com. I'm close now.

It's taken all night again, but I actually have a fully-functional version of
Courier running on my system now, without Postfix, and it includes everything I
really wanted: pop, imap, and mysql support. But that's where I'm having
problems now.

I can't seem to get the authentication part to work. At first, I was getting a
strange error message, s_connect() failed, file not found. After tinkering with
things and then rebooting the server, that's gone away completely, and I can
actually telnet and attempt a login.

This time it actually tries to login but comes back with username/password
failed. It takes it a bit before it does this so I'm pretty sure it's actually
doing something positive. One thing is certain though, I don't believe it is
trying to connect to mysql at all for the authentication, and I'm not sure what
I need to do to make that happen.

I've set up the mysql config file but I don't believe it's using it. I was even
able to get the webmail and webadmin programs to work. I'm actually feeling
pretty good about this. Anyway, sorry for the rambling. I'm just hoping
someone can help me get the last of this wrapped up. Somehow, I need the pop
and imap servers to hook up with mysql to authorize my users.

COURIER CONFIG:

[root@server bin]# ./courier-config

prefix=/usr/lib/courier exec_prefix=/usr/lib/courier bindir=/usr/lib/courier/bin sbindir=/usr/lib/courier/sbin libexecdir=/usr/lib/courier/libexec sysconfdir=/etc/courier datadir=/usr/lib/courier/share localstatedir=/var/spool/courier mailuser=daemon mailgroup=daemon mailuid=2 mailgid=2 configure_args="'--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu'
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr/lib/courier'
'--exec-prefix=/usr/lib/courier' '--bindir=/usr/lib/courier/bin'
'--sbindir=/usr/lib/courier/sbin' '--sysconfdir=/etc/courier'
'--datadir=/usr/lib/courier/share' '--includedir=/usr/lib/courier/include'
'--libdir=/usr/lib/courier/lib' '--libexecdir=/usr/lib/courier/libexec'
'--localstatedir=/var/spool/courier' '--sharedstatedir=/usr/lib/courier/com'
'--mandir=/usr/share/man' '--infodir=/usr/share/info'
'--cache-file=courier.config.cache' '--enable-unicode=iso-8859-1,utf-8'
'CFLAGS=-O2 -g -pipe -march=i386 -mcpu=i686' 'CXXFLAGS=-O2 -g -pipe -march=i386
-mcpu=i686' 'FFLAGS=-O2 -g -pipe -march=i386 -mcpu=i686'
'build_alias=i686-redhat-linux-gnu' 'host_alias=i686-redhat-linux-gnu'
'target_alias=i386-redhat-linux-gnu' --with-db=gdbm
--enable-utf7-folder-encoding"

RC.LOCAL FILE:

[root@server bin]# tail /etc/rc.local

/usr/local/apache2/bin/apachectl start /usr/sbin/authdaemond start /usr/lib/courier/sbin/courier start /usr/lib/courier/sbin/pop3d start /usr/lib/courier/sbin/imapd start /usr/lib/courier/sbin/esmtpd start /usr/lib/courier/sbin/webmaild start

COURIER PROCESSES (ALL STARTED AT BOOT):

[root@server log]# ps -aux | grep courier

root 3644 0.0 0.0 1520 460 ? S 03:59 0:00
/usr/sbin/courierlogger -pid=/var/spool/authdaemon/pid -start
/usr/libexec/courier-authlib/authdaemond root 3645 0.0 0.0 1832 520 ? S 03:59 0:00
/usr/libexec/courier-authlib/authdaemond root 3655 0.0 0.0 1832 520 ? S 03:59 0:00
/usr/libexec/courier-authlib/authdaemond root 3656 0.0 0.0 1832 520 ? S 03:59 0:00
/usr/libexec/courier-authlib/authdaemond root 3657 0.0 0.0 1832 520 ? S 03:59 0:00
/usr/libexec/courier-authlib/authdaemond root 3658 0.0 0.0 1832 520 ? S 03:59 0:00
/usr/libexec/courier-authlib/authdaemond root 3659 0.0 0.0 1832 524 ? S 03:59 0:00
/usr/libexec/courier-authlib/authdaemond root 4004 0.0 0.0 2444 772 ? S 03:59 0:00
/usr/lib/courier/libexec/courier/courierd daemon 4005 0.0 0.1 2604 1096 ? S 03:59 0:00
/usr/lib/courier/libexec/courier/courierd uucp 4007 0.0 0.0 1624 516 ? S 03:59 0:00 ./courieruucp root 4008 0.0 0.0 1540 360 ? S 03:59 0:00 ./courierlocal root 4009 0.0 0.0 1592 328 ? S 03:59 0:00 ./courierfax daemon 4010 0.0 0.0 1732 468 ? S 03:59 0:00 ./courieresmtp daemon 4011 0.0 0.0 1544 440 ? S 03:59 0:00 ./courierdsn root 4015 0.0 0.0 1524 464 ? S 03:59 0:00
/usr/sbin/courierlogger -pid=/var/spool/courier/tmp/pop3d.pid -start -name=pop3d
/usr/lib/courier/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=4
-nodnslookup -noidentlookup 110
/usr/lib/courier/libexec/courier/courierpop3login /usr/lib/courier/libexec root 4016 0.0 0.0 1628 508 ? S 03:59 0:00
/usr/lib/courier/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=4
-nodnslookup -noidentlookup 110
/usr/lib/courier/libexec/courier/courierpop3login
/usr/lib/courier/libexec/courier/courierpop3d Maildir root 4022 0.0 0.0 1520 380 ? S 03:59 0:00
/usr/sbin/courierlogger -pid=/var/spool/courier/tmp/imapd.pid -start -name=imapd
/usr/lib/courier/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=4
-nodnslookup -noidentlookup 143 /usr/lib/courier/libexec/courier/imaplogin
/usr/lib/courier/bin/imapd Mail root 4023 0.0 0.0 1624 488 ? S 03:59 0:00
/usr/lib/courier/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=4
-nodnslookup -noidentlookup 143 /usr/lib/courier/libexec/courier/imaplogin
/usr/lib/courier/bin/imapd Maildir daemon 4031 0.0 0.0 2516 592 ? S 03:59 0:00
/usr/lib/courier/sbin/couriertcpd -stderrlogger=/usr/sbin/courierlogger
-user=daemon -group=daemon -access=/etc/courier/smtpaccess.dat -maxprocs=40
-maxperc=5 -maxperip=5 -pid=/var/spool/courier/tmp/esmtpd.pid smtp
/usr/lib/courier/sbin/courieresmtpd daemon 4035 0.0 0.0 1376 284 ? S 03:59 0:00
/usr/sbin/courierlogger courieresmtpd root 4041 0.0 0.0 1524 380 ? S 03:59 0:00
/usr/sbin/courierlogger -pid=/var/spool/courier/tmp/sqwebmaild.pid -start
/usr/lib/courier/libexec/courier/sqwebmaild root 4042 0.0 0.0 4220 1000 ? S 03:59 0:00
/usr/lib/courier/libexec/courier/sqwebmaild root 4051 0.0 0.0 4220 1000 ? S 03:59 0:00
/usr/lib/courier/libexec/courier/sqwebmaild root 4053 0.0 0.0 4220 1000 ? S 03:59 0:00
/usr/lib/courier/libexec/courier/sqwebmaild root 4055 0.0 0.0 4220 1000 ? S 03:59 0:00
/usr/lib/courier/libexec/courier/sqwebmaild root 4057 0.0 0.0 4220 1000 ? S 03:59 0:00
/usr/lib/courier/libexec/courier/sqwebmaild root 4059 0.0 0.0 4220 1000 ? S 03:59 0:00
/usr/lib/courier/libexec/courier/sqwebmaild root 4167 0.0 0.0 3792 668 pts/0 S 04:01 0:00 grep courier

TELNET AND MAIL LOG INFO:

[root@server log]# telnet localhost 110

Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. +OK Hello there. user rs@rswfire.com +OK Password required. pass ***** -ERR Login failed. quit +OK Better luck next time. Connection closed by foreign host.

[root@server log]# tail mail.log

Oct 31 04:09:18 server pop3d: LOGIN: ip=[::ffff:127.0.0.1], command=USER Oct 31 04:09:21 server pop3d: LOGIN: ip=[::ffff:127.0.0.1], command=PASS Oct 31 04:09:21 server pop3d: LOGIN: ip=[::ffff:127.0.0.1],
username=rs@rswfire.com Oct 31 04:09:21 server pop3d: LOGIN: ip=[::ffff:127.0.0.1], password=***** Oct 31 04:09:21 server pop3d: LOGIN FAILED, user=rs@rswfire.com,
ip=[::ffff:127.0.0.1] Oct 31 04:09:22 server courieresmtpd: started,ip=[::ffff:65.210.151.142] Oct 31 04:09:23 server courieresmtpd: error,relay=::ffff:65.210.151.142,msg="535
Authentication required.",cmd: MAIL FROM: <germ@ams.com> Oct 31 04:09:29 server pop3d: LOGIN: ip=[::ffff:127.0.0.1], command=QUIT Oct 31 04:09:29 server pop3d: LOGOUT, ip=[::ffff:127.0.0.1] Oct 31 04:09:29 server pop3d: Disconnected, ip=[::ffff:127.0.0.1]

(Unfortunately, it doesn't explain why it is failing - before it was stating an
s_connect() problem, but with that fixed, now it has no information, and I have
Courier set up to display all debug messages.)

DEBUG LOG:

[root@server log]# tail debug.log

Oct 31 04:00:50 server pop3d: LOGIN: ip=[::ffff:127.0.0.1], command=EXIT Oct 31 04:00:51 server pop3d: LOGIN: ip=[::ffff:127.0.0.1], command=QUIT Oct 31 04:00:51 server pop3d: LOGOUT, ip=[::ffff:127.0.0.1] Oct 31 04:00:51 server pop3d: Disconnected, ip=[::ffff:127.0.0.1] Oct 31 04:01:00 server CROND[4161]: (root) CMD (run-parts /etc/cron.hourly) Oct 31 04:02:00 server CROND[4169]: (root) CMD (run-parts /etc/cron.daily) Oct 31 04:02:04 server logrotate: ALERT exited abnormally with [1] Oct 31 04:02:04 server postfix/sendmail[4234]: fatal: open /etc/postfix/main.cf:
No such file or directory Oct 31 04:02:30 server courieresmtpd: started,ip=[::ffff:64.70.54.15] Oct 31 04:02:30 server courieresmtpd: error,relay=::ffff:64.70.54.15,msg="535
Authentication required.",cmd: MAIL FROM:<bulk@la1bms00.befree.com>

(I can't get rid of the postfix/sendmail errors - even though I removed it -
anyone know where in the startup process these are being called from?)

AUTHDAEMONRC:

##VERSION: $Id: authdaemonrc.in,v 1.12 2005/07/05 12:25:08 mrsam Exp $ ##NAME: authmodulelist:2 authmodulelist="authmysql" ##NAME: authmodulelistorig:3 authmodulelistorig="authuserdb authpam authpgsql authldap authmysql authcustom
authpipe" ##NAME: daemons:0 daemons=5 ##NAME: authdaemonvar:2 authdaemonvar=/var/spool/authdaemon ##NAME: DEBUG_LOGIN:0 DEBUG_LOGIN=0 ##NAME: DEFAULTOPTIONS:0 DEFAULTOPTIONS="" ##NAME: LOGGEROPTS:0 LOGGEROPTS=""

AUTHMYSQLRC:

##VERSION: $Id: authmysqlrc,v 1.18 2004/11/14 02:58:16 mrsam Exp $ ##NAME: LOCATION:0 MYSQL_SERVER localhost MYSQL_USERNAME postmaster MYSQL_PASSWORD postmasterpassword ##NAME: MYSQL_SOCKET:0 MYSQL_SOCKET /var/lib/mysql/mysql.sock ##NAME: MYSQL_PORT:0 MYSQL_PORT 0 ##NAME: MYSQL_OPT:0 MYSQL_OPT 0 ##NAME: MYSQL_DATABASE:0 MYSQL_DATABASE clients ##NAME: MYSQL_USER_TABLE:0 MYSQL_USER_TABLE mail_users ##NAME: MYSQL_CRYPT_PWFIELD:0 MYSQL_CRYPT_PWFIELD crypt ##NAME: MYSQL_CLEAR_PWFIELD:0 MYSQL_CLEAR_PWFIELD clear ##NAME: MYSQL_DEFAULT_DOMAIN:0 DEFAULT_DOMAIN server.enetwizard.info ##NAME: MYSQL_UID_FIELD:0 MYSQL_UID_FIELD uid ##NAME: MYSQL_GID_FIELD:0 MYSQL_GID_FIELD gid ##NAME: MYSQL_LOGIN_FIELD:0 MYSQL_LOGIN_FIELD email ##NAME: MYSQL_HOME_FIELD:0 MYSQL_HOME_FIELD homedir ##NAME: MYSQL_NAME_FIELD:0 MYSQL_NAME_FIELD name ##NAME: MYSQL_MAILDIR_FIELD:0 MYSQL_MAILDIR_FIELD maildir ##NAME: MYSQL_DEFAULTDELIVERY:0 #MYSQL_DEFAULTDELIVERY defaultdelivery ##NAME: MYSQL_QUOTA_FIELD:0 MYSQL_QUOTA_FIELD quota ##NAME: MYSQL_AUXOPTIONS:0 #MYSQL_AUXOPTIONS_FIELD auxoptions ##NAME: MYSQL_WHERE_CLAUSE:0 ##NAME: MYSQL_SELECT_CLAUSE:0 ##NAME: MYSQL_ENUMERATE_CLAUSE:1 ##NAME: MYSQL_CHPASS_CLAUSE:0

AND FINALLY, ONE RANT:

The Installation instructions on the website need to be updated! Many of the
paths on that website do not correlate to the paths that were AUTOMATICALLY
placed on my server when doing the RPM install - making it very difficult for
someone like me to know if I need to move things around to make sure the correct
files are read (authdaemonrc, for example.)!