No delivery and log warnings after postfix/mysql tutorial

Discussion in 'HOWTO-Related Questions' started by TWadmin, Dec 27, 2006.

  1. TWadmin

    TWadmin New Member

    I followed "Virtual Users And Domains With Postfix, Courier And MySQL (Fedora Core 5)" at but it's not working for me. The setup process went well, but I'm receiving errors and warnings in the maillog, and am unable to get a client (OE, in this case) to authenticate with the server.

    First in maillog, I get a couple of these:
    Dec 26 20:15:38 spider postfix/proxymap[20190]: warning: connect to mysql server Access denied for user 'mail_admin'@'localhost' (using password: YES)
    Dec 26 20:15:38 spider postfix/proxymap[20190]: warning: connect to mysql server Access denied for user 'mail_admin'@'localhost' (using password: YES)

    But, I can login from the terminal:
    [[email protected] init.d]# mysql -u mail_admin -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 588 to server version: 5.0.27
    blah blah blah

    After the first error above, I get many (20 - 30) of these in a row:
    Dec 26 20:15:38 spider postfix/trivial-rewrite[21981]: fatal: proxy:mysql:/etc/postfix/,100): table lookup problem

    They all have different PIDs.

    Then I get as many, if not more, of these:
    Dec 26 20:15:39 spider postfix/smtpd[14094]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
    Dec 26 20:15:39 spider postfix/smtpd[14094]: warning: problem talking to service rewrite: Connection reset by peer
    Dec 26 20:15:39 spider postfix/smtpd[14039]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
    Dec 26 20:15:39 spider postfix/smtpd[14039]: warning: problem talking to service rewrite: Success

    Then the cycle starts over. I don't know where it begins and ends, but I assumed the mail_admin connection problem would have to be near the top of the problem list.

    I only have one user/domain in the table for testing but it seems I am unable to authenticate. On a send/receive (again, in OE), I'm presented with a password box that's never accepted. Maillog has one entry each time:
    Dec 26 20:25:12 spider dovecot: pop3-login: Disconnected: user=<[email protected]>, method=PLAIN, rip=::ffff:, lip=::ffff:, TLS
    ([email protected] is, of course, listed appropriately in the actual entry.)

    If I cancel the password prompt, client reports a rejected password. I've adjusted it a couple of times via phpmyadmin, but to no avail.

    Any ideas where I might have gone astray?
  2. TWadmin

    TWadmin New Member


    I'm a dumb-head. 2 problems solved.

    First, and the cause of most of the errors, I stupidly left the password in the six custom /etc/postfix/mysql-* files as mail_admin_password. That will break some things, no? :( :(

    Second, note the last errors above: pop instead of imap. Changed that in the client. Now, as mentioned previously, I'm testing with Outlook Express (which is what most of the clients will be). It's attempting to download folders but I'm still getting an authentication error when that happens. Is something broken, or is this to be expected? Pardon the stupidity, but I'm unfamiliar with imap.
  3. TWadmin

    TWadmin New Member

    I changed the client back to pop rather than imap and have experimented some more. I'm still getting password rejected errors on the pop side (haven't tried smtp).

    I've tried both regular and ssl connections and have received the same rejected password message. I've also used telnet to connect as [email protected] and attempted to enter tha pass that way, but it is still rejected.

    I had thought that maybe the password was being corrupted when changing it via phpmyadmin since the interface never seems to successfully complete the update, so I made the change manually in the db with an UPDATE statement. The password is still rejected.

    Anyone have a shove in he right direction?
    Last edited: Dec 27, 2006
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please enable logging in the mysql my.cnf configuration file by removing the comment in front of the following line:

    log = /var/log/mysql/mysql.log

    Then restart mysql. All mysql queries from the authentication process where now logged into the file /var/log/mysql/mysql.log
  5. TWadmin

    TWadmin New Member

    Thanks for the response.

    It'll be a few hours before I can swap hard drives to do this, but I'll give it a shot and report back with results.
  6. TWadmin

    TWadmin New Member

    Ok. That line wasn't in my.cnf so I added it instead of uncommenting. I placed it under the [mysqld] heading.

    I should add that I originally set this box up following the perfect setup for fc5 with the option of ISPconfig, but later removed ISPconfig. Don't know if that's why my config file is different than expected.

    With the logging line added, I had to add a mysql directory under /var/log. There is a mysqld.log file in /var/log, but it has very little information. It is referenced in my.cnf under the [mysqld_safe] heading in the line log-error=/var/log/mysqld.log.

    Now, attempting to telnet again, this is what happens:
    [[email protected] ~]# telnet localhost 110
    Connected to localhost.localdomain (
    Escape character is '^]'.
    +OK Dovecot ready.
    user [email protected]
    pass mypassinplaintext
    -ERR Authentication failed.
    +OK Logging out
    Connection closed by foreign host.
    The log shows no attempt at connection, from what I can see:
    [[email protected] ~]# cat /var/log/mysql/mysql.log |grep mydom.ain
    [[email protected] ~]# cat /var/log/mysql/mysql.log |grep myuser
    There are other select queries in the log as other servers are trying to reach my real (working) server, so that part is working, at least.

    What have I broken?
  7. TWadmin

    TWadmin New Member

    More possible useful information.

    Postfix does receive mail for the test user in the table. There is a mydom.ain directory under /home/vmail containing more subdirectories, one of which looks like it's holding two messages which I'm guessing are the two test messages I sent from an external account. So, it seems like the inbound part works.

    Am I correct, then, in isolating my troubleshooting to the authentication?
  8. TWadmin

    TWadmin New Member

    For those keeping score, the respectable side of me is losing to the stupid side by a huge margin.

    It was bloody Dovecot! I don't know why I didn't notice that earlier. The tutorial covers Courier, but Dovecot was installed when following the "perfect setup" that I mentioned earlier. The service was still running and was jumping into the mix before courier. Once I stopp the Dovecot service, I had to start Courier and the thing worked as it should ha all along.

    Ever have one of those weeks where you can't help but screw up everything and look like a complete idiot? :(

    Now, I'm going to try to set up Courier to only use SSL, so maybe I'll be back after I break that, too. :eek:

    Thanks for the how-to. It was easy to follow, but perhaps too easy as I didn't use my brain while following it. :)

Share This Page