Virtual Users And Domains With Postfix, Courier And MySQL Login Problem

Discussion in 'HOWTO-Related Questions' started by BCNW, Dec 30, 2006.

  1. BCNW

    BCNW New Member

    Hey there, thanks in advance for any help here. I have followed the guide for Postfix's virtual config exactly, but I am unable to login with any users. The mail.log output is as follows:

    Dec 29 21:51:41 localhost imaplogin: Connection, ip=[::ffff:66.206.87.115]
    Dec 29 21:51:50 localhost imaplogin: LOGIN FAILED, ip=[::ffff:66.206.87.115]

    and netstat -tap:

    tcp 0 0 localhost.localdo:60000 *:* LISTEN 875/postgrey.pid --
    tcp 0 0 *:imaps *:* LISTEN 6701/couriertcpd
    tcp 0 0 *:pop3s *:* LISTEN 5066/couriertcpd
    tcp 0 0 localhost.localdo:10024 *:* LISTEN 9099/amavisd (maste
    tcp 0 0 localhost.localdo:10025 *:* LISTEN 8950/master
    tcp 0 0 localhost.localdo:mysql *:* LISTEN 6552/mysqld
    tcp 0 0 *:pop3 *:* LISTEN 8243/couriertcpd
    tcp 0 0 *:imap2 *:* LISTEN 8226/couriertcpd
    tcp 0 0 *:www *:* LISTEN 4937/apache
    tcp 0 0 *:ftp *:* LISTEN 1245/proftpd: (acce
    tcp 0 0 xen.belmontcompu:domain *:* LISTEN 860/named
    tcp 0 0 localhost.locald:domain *:* LISTEN 860/named
    tcp 0 0 *:ssh *:* LISTEN 1233/sshd
    tcp 0 0 *:smtp *:* LISTEN 8950/master
    tcp 0 0 localhost.localdoma:953 *:* LISTEN 860/named
    tcp 0 0 xen.belmontcomput:49292 nas01.bridgeband.ne:www CLOSE_WAIT 925/freshclam
    tcp 0 0 xen.belmontcomput:45873 soyuz.df.lth.se:www CLOSE_WAIT 925/freshclam
    tcp 0 0 xen.belmontcomput:45438 nas01.bridgeband.ne:www CLOSE_WAIT 925/freshclam
    tcp 0 0 localhost.localdo:mysql localhost.localdo:44169 ESTABLISHED6552/mysqld
    tcp 0 0 xen.belmontcomput:42241 soyuz.df.lth.se:www CLOSE_WAIT 925/freshclam
    tcp 0 0 localhost.localdo:52273 localhost.localdo:mysql ESTABLISHED9104/amavisd (child
    tcp 0 0 localhost.localdo:44169 localhost.localdo:mysql ESTABLISHED9105/amavisd (child
    tcp 0 0 xen.belmontcomput:51611 soyuz.df.lth.se:www CLOSE_WAIT 925/freshclam
    tcp 0 0 xen.belmontcomput:35068 clamav-001.mirrors.:www CLOSE_WAIT 925/freshclam
    tcp 0 0 localhost.localdo:mysql localhost.localdo:50917 ESTABLISHED6552/mysqld
    tcp 0 2360 xen.belmontcomputer:ssh 66.206.87.115:40097 ESTABLISHED8252/sshd: domadmin
    tcp 0 0 localhost.localdo:50917 localhost.localdo:mysql ESTABLISHED9106/amavisd (child
    tcp 0 0 localhost.localdo:mysql localhost.localdo:50928 ESTABLISHED6552/mysqld
    tcp 0 0 localhost.localdo:50928 localhost.localdo:mysql ESTABLISHED9107/amavisd (child
    tcp 0 0 localhost.localdo:mysql localhost.localdo:52273 ESTABLISHED6552/mysqld
    tcp 0 0 xen.belmontcomput:52612 soyuz.df.lth.se:www CLOSE_WAIT 925/freshclam

    The "login failed" error is mighty unhelpful, any way to get more verbose output?
     
  2. BCNW

    BCNW New Member

    So after trolling the forum archives a bit, I discovered a few fixes that had been pointed out by Falko before that I had wrong, namely the "proxy:" prefix in the postfix main.cf file:
    http://www.howtoforge.com/forums/showpost.php?p=14652&postcount=4
    and also found a similar problem with someone else not using courier for the MTA:
    http://www.howtoforge.com/forums/archive/index.php/t-1643.html
    The only problem (or rather, my CURRENT problem) is that I do have Courier installed, I see that when I try to apt-get the package, and I am not sure where I go to configure that (or even exactly what I would do to configure it).
     
  3. falko

    falko Super Moderator Howtoforge Staff

    Did you send an email to that account before you tried to fetch emails? Because Maildir is created when the first email arrives in a new account.

    Also, make sure that /etc/courier/authmysqlrc looks like the one from the tutorial. Take care about the formatting (whitespace, etc.) as Courier is very finicky about this.
     
  4. BCNW

    BCNW New Member

    Hmmm, is this message when opening /etc/courier/authmysqlrc something I should be seeing?:

     
  5. BCNW

    BCNW New Member

    Well, once again I have to smack my forehead on this one. It is kinda amazing how sure I am that I did everything according to Falko at the beginning of travails like this, only to find out that, yep, I didn't COPY AND PASTE properly.

    Ahhhh, to be a n00b. :eek:

    I forgot the trailing " in the MYSQL_HOME_FIELD "/home/vmail" line. The one thing I would share with you all is that it was very helpful to me to change the verbosity of the /etc/courier/authdaemonrc file to DEBUG_LOGIN=2, which gave me enough info to find that everything was correct, but the mysql query for logging in was failing.
     
  6. Kyse

    Kyse New Member

    Hold up, so just so I can check my settings to yours, what exactly did you forget to add to what file?
     
  7. BCNW

    BCNW New Member

    The file is /etc/courier/authmysqlrc. The thing I missed was the second quotation mark (") in the line
    Should be lin 111 or somewhere near there.

    The verbosity thing I was talking about is done by adding the line
    anywhere in the /etc/courier/authdaemonrc file. This gives a much greater level of info to failed login errors in the /var/log/mail.log file. Remember to restart all the courier processes as described at the end of page 2 in the original howto when making any changes to these files.
     

Share This Page