Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th January 2007, 16:45
browngb browngb is offline
Member
 
Join Date: Dec 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default Not authenticating - Virtual users and domains with postfix, courier, and mysql

I've followed the instructions from the "Virtual Users and Domains with Postfix, Courier, and Mysql" and am having an issue with logging in. The setup receives emails fine, and apparently sends them fine too, because it will forward to an external email if asked too. The trouble is that I can not log in to the account. Log in attempts return "Login Failed". The log at /var/log/mail.log shows
Code:
Jan 25 15:07:55 web1 courierpop3login: Connection, ip=[::ffff:12.21.108.19]
Jan 25 15:08:18 web1 authdaemond.mysql: failed to connect to mysql server (server=localhost, userid=mail_admin.)
Jan 25 15:08:23 web1 courierpop3login: LOGIN FAILED, ip=[::ffff:12.21.108.19]
I see 250-STARTTTLS and 250-AUTH in ehlo. I've checked all the config files to make sure the username and password are correct for mysql connections, and it seems they are.

I am pretty sure that I'm not using the wrong email address and password to cause the login failure, because the log says it can't connect to the DB. I would appreciate it if someone could tell me where to start looking for a configuration problem that would cause it to not connect to the DB. Thanks in advance for your help.
Reply With Quote
Sponsored Links
  #2  
Old 25th January 2007, 17:06
jacob jacob is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I ran into this same thing. I reset the password for the mail_admin user in phpMyadmin for both the localhost and localhost.localdomain and this corrected the error.
Reply With Quote
  #3  
Old 25th January 2007, 17:12
jacob jacob is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can also test the user/pass by login in to MySql from the command line.
Try
mysql -u mail_admin -p

If that works then see if you have permissions to access the tables
use mail;
select * from users;
Reply With Quote
  #4  
Old 25th January 2007, 19:39
browngb browngb is offline
Member
 
Join Date: Dec 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can log into phpmyadmin and mysql fine with the username and password. It even lets me query for the users. I couldn't reset the password in phpmyadmin because it doesn't give me the option.

It receives and forwards emails just fine, so I know something is working right. It has to do db lookups to perform those actions, right? My gut feeling is that something in the authentication portion isn't set correctly, but I can't find it.
Reply With Quote
  #5  
Old 26th January 2007, 17:13
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Does the MySQL password contain special characters? That might be the reason.

Also make sure that the format of /etc/courier/authmysqlrc is correct (whitespace, etc.). Courier is very finicky about this.
__________________
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
  #6  
Old 27th January 2007, 01:47
browngb browngb is offline
Member
 
Join Date: Dec 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My mysql password is alphanumeric. Below is my /etc/courier/authmysqlrc:

Code:
MYSQL_SERVER            localhost
MYSQL_USERNAME          mail_admin
MYSQL_PASSWORD          (removed to protect the guilty)
MYSQL_PORT              0
MYSQL_DATABASE          mail
MYSQL_USER_TABLE        users
MYSQL_CRYPT_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_QUOTA_FIELD       quota
Does it look right?
Reply With Quote
  #7  
Old 27th January 2007, 12:22
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

I'm not familiar with this tutorial, but this
Quote:
MYSQL_PORT 0
does not look oke. The default port is 3306 for MySQL. Could that be (part of) your problem?
Reply With Quote
  #8  
Old 28th January 2007, 14:30
browngb browngb is offline
Member
 
Join Date: Dec 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried changing the port to 3306 and then restarting

/etc/init.d/courier-authdaemon restart
/etc/init.d/courier-imap restart
/etc/init.d/courier-imap-ssl restart
/etc/init.d/courier-pop restart
/etc/init.d/courier-pop-ssl restart

but it still doesn't work. Is there something else I'd need to restart for it to change the settings, or is the port not the problem?
Reply With Quote
  #9  
Old 28th January 2007, 14:32
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

Sorry, should have been more complete. To see if MySQL is listening, do
Code:
netstat -tap
and check if mysql is running and you can see on which port it's listening. If unsure, post the output of the above command here.
Reply With Quote
  #10  
Old 28th January 2007, 14:39
browngb browngb is offline
Member
 
Join Date: Dec 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Code:
web1:/home/admin# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 *:imaps                 *:*                     LISTEN     1245/couriertcpd
tcp        0      0 *:pop3s                 *:*                     LISTEN     1268/couriertcpd
tcp        0      0 localhost.localdo:10024 *:*                     LISTEN     474/amavisd (master
tcp        0      0 localhost.localdo:10025 *:*                     LISTEN     1478/master
tcp        0      0 localhost.localdo:mysql *:*                     LISTEN     1335/mysqld
tcp        0      0 *:843                   *:*                     LISTEN     1509/rpc.statd
tcp        0      0 *:pop3                  *:*                     LISTEN     1927/couriertcpd
tcp        0      0 *:imap2                 *:*                     LISTEN     1911/couriertcpd
tcp        0      0 *:sunrpc                *:*                     LISTEN     996/portmap
tcp        0      0 *:www                   *:*                     LISTEN     1778/apache
tcp        0      0 web1.brojoh.com:www     195-64-132-255.sof:1020 SYN_RECV   -
tcp        0      0 *:auth                  *:*                     LISTEN     1384/inetd
tcp        0      0 *:ftp                   *:*                     LISTEN     1516/proftpd: (acce
tcp        0      0 web1.brojoh.com:domain  *:*                     LISTEN     1503/mydns
tcp        0      0 localhost.locald:domain *:*                     LISTEN     1503/mydns
tcp        0      0 *:ssh                   *:*                     LISTEN     1498/sshd
tcp        0      0 *:smtp                  *:*                     LISTEN     1478/master
tcp        0      0 web1.brojoh.com:42869   208.67.80.27:www        CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:42868   208.67.80.27:www        CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:39419   mail2.unet.brandeis:www CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:39418   mail2.unet.brandeis:www CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:39422   mail2.unet.brandeis:www CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:38010   clamav-005.mirrors.:www CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:40938   soyuz.df.lth.se:www     CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:40939   soyuz.df.lth.se:www     CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:52475   182.63.21.72.revers:www CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:52476   182.63.21.72.revers:www CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:52459   182.63.21.72.revers:www CLOSE_WAIT 1214/freshclam
tcp        0      0 web1.brojoh.com:54145   edebris.com:www         CLOSE_WAIT 1214/freshclam
There's the netstat -tap output. There's probably another thousand lines of that freshclam. Is that normal? I know the database is working for everything but logins. Is there something in there that tells you if it is or isn't listening for the login script?
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 05:02
Virtual Users And Domains With Postfix, Courier And MySQL [+ procmail ?] immobilia HOWTO-Related Questions 5 29th June 2006 23:20
Virtual Users And Domains With Postfix, Courier And MySQL - "apt-get" and Courier burritonator HOWTO-Related Questions 3 15th March 2006 20:11
Problem with Virtual Users And Domains With Postfix, Courier And MySQL Howto fenix Server Operation 4 11th March 2006 02:53
Another Problem: Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP bluegrass Installation/Configuration 24 8th March 2006 01:41


All times are GMT +2. The time now is 14:03.


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