Emails are no longer sent : problem with postfix, amavis and mysql

Discussion in 'Installation/Configuration' started by Pol, Aug 6, 2015.

  1. Pol

    Pol New Member

    Hi all,

    I have a problem with postfix and mysql : my emails are blocked in queue.
    Postfix can not connect to mysql :

    Aug 2 06:54:32 ns304995 amavis[4537]: (04537-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=dbispconfig;host=127.0.0.1;port=3306': Access denied for user 'ispconfig'@'127.0.0.1' (using password: YES)
    Aug 6 08:47:00 ns304995 amavis[328]: (00328-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 111) line 247.​

    Aug 6 09:02:10 ns304995 postfix/error[3868]: warning: mysql:/etc/postfix/mysql-virtual_relaydomains.cf: table lookup problem​

    Aug 6 09:02:10 ns304995 postfix/error[3957]: warning: 9ACD91600523: flush service failure

    Aug 6 09:02:10 ns304995 postfix/error[3952]: 994D816006E9: to=<xxx(at)yyy.tld>, relay=none, delay=501477, delays=501467/10/0/0.08, dsn=4.3.0, status=deferred (address resolver failure)​

    So, postfix and amavis can't connect to mysql. Bad possword.

    Have you an idea how to fix this ?

    Thaks by advance.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you change the password of the mysql user "ispconfig" manually?
     
  3. Pol

    Pol New Member

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    All services are using this password, so it is in many files across your server and you have to find all files that use the old password (e.g. by doing a recursive grep for the old password for everything in /etc and replace it in all files where it is used.
     
  5. Pol

    Pol New Member

    wow... it seems to be hard.
    but an other idea, what about modify le ispconfig's password directly in command line or phpmyadmin ?
    is it possible ?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    When you change it back in phpmyadmin to the original value, then the services start to work again.
     
  7. Pol

    Pol New Member

    ok thank you till but i really don't understand because i change back the passord in phpmyadmin to the original one and it still continue to not work...
    i give you more information :
    • in /usr/local/ispconfig/server/lib/mysql_clientdb.conf : i have the original password
    • the "ispconfig" user in mysql : have the original password
    • the "admin" user in dbispconfig : have the original password
    • all the files in /etc like amavis, postfix... have the same encrypted password like "e46cbf77ff8eb416ecc0276e72a5bb92" and i never changed the password manually in these files
    When i launch /usr/local/ispconfig/server/server.sh i have an error : PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'ispconfig'@'localhost' (using password: YES) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 62
    DB::__construct Access denied for user 'ispconfig'@'localhost' (using password: YES)

    You have to know that i have reinstall ispconfig with the update script many times to try to solve the problem. but nothing changed

    at that time i'm completly stuck...
    so, the password i suppose to be the "original" is not the good one ???
    in this case, can i find the password by reversing this "e46cbf77ff8eb416ecc0276e72a5bb92" ??
    and finally... What are the possibilities for me ?

    Thak you for your help
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    No. Thats the root password, not the ispconfig password.

    This password cant be correct, otherwise postfix, amavis etc. would be able to connect.

    This does not matter here as its the ispconfig interface login and not related to the mail system.

    Thats the clertext password of the mysql user "ispconfig" in the mysql database. if you change the password of the ispconfig user in mysql, then you have to change this password in all files where it appers, or your syste will break like you see it now.
     
  9. Pol

    Pol New Member

    Ok and is this command is ok ?
    UPDATE `mysql`.`user` SET `Password` = 'e46cbf77ff8eb416ecc0276e72a5bb92' WHERE `user`.`Host` = 'localhost' AND `user`.`User` = 'ispconfig';
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    No, you missed to tell mysql to encrypt the password. The correct one would be:

    UPDATE `mysql`.`user` SET `Password` = password('e46cbf77ff8eb416ecc0276e72a5bb92') WHERE `user`.`Host` = 'localhost' AND `user`.`User` = 'ispconfig';
     
  11. Pol

    Pol New Member

    Hello,
    Finally, i got it !
    @till your last sql command was the good one.
    But it was not finished... I always had the "cannot connect to 127.0.0.1..." error.
    Looking to the ispconfig user in mysql, the host he have is "localhost". And "localhost" is different than "127.0.0.1".
    So i've copied the "ispconfig" user and give him the host "127.0.0.1". And it works !
    Finaly the password problem was very simple to correct but the case 127.0.0.1/localhost was a little harder for me.
    Thank you @till for your help
     

Share This Page