HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Virtual Users And Domains With Postfix, Courier And MySQL: POP/IMAP authentication (http://www.howtoforge.com/forums/showthread.php?t=1715)

SeanG 18th December 2005 00:40

Virtual Users And Domains With Postfix, Courier And MySQL: POP/IMAP authentication
 
Great tutorial.

I set this up on a clean Sarge install. Had a few problems which have been resolved by reading this and other forums. This particular one has had me going for days -I have followed all the steps in related threads on this forum.

I am unable to connect using pop or imap on the LAN (so no firewall issues). The error I get is:

Dec 17 21:48:29 netserver authdaemond.mysql: failed to connect to mysql server (server=localhost , userid=mail_admin)

mysql is up and running and "mysql -h localhost -u mail_admin -p" works just fine. Postfix can connect to the DB because mail is being delivered to the correct place. SASL is not working but I think that this is unrelated and should have no effect.

Here is my /etc/courier/authdaemonrc # comments removed to make it shorter

##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $

authmodulelist="authmysql"

authmodulelistorig="authcustom authcram authuserdb authldap authpgsql authmysql authpam"
daemons=5

version=""

authdaemonvar=/var/run/courier/authdaemon



and my /etc/courier/authmysqlrc # comments removed to make it shorter
I have no whitespace at the end of lines and in all cases field and value are separated by a single space.

##VERSION: $Id: authmysqlrc,v 1.17 2004/04/20 01:38:17 mrsam Exp $
#
# authmysqlrc created from authmysqlrc.dist by sysconftool

MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWD myownpassword
MYSQL_PORT 0
MYSQL_OPT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
# MYSQL_CLEAR_PWFIELD clear
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
MYSQL_QUOTA_FIELD quota

I am pretty much a LINUX newbie, happ to investigate this myself but need some pointers as to where to start

Thanks

falko 18th December 2005 15:09

I think you should check /etc/courier/authmysqlrc again, especially the format (tabs, spaces, etc.). Courier is very finicky about the format.

SeanG 19th December 2005 00:38

hmm - reading through my post with the comments stripped out made this easy. It was the content, not the format - i.e. finger trouble... :o

bLuTm8 1st January 2006 17:08

Quote:

MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
the error is in this entry:
this is the name of the table used by authdaemon, not the table content

example:
Code:

MYSQL_MAILDIR_FIELD maildir


All times are GMT +2. The time now is 17:32.

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