Quick question about Postfix + MySQL

Discussion in 'HOWTO-Related Questions' started by asterix, Sep 10, 2006.

  1. asterix

    asterix New Member

    Hi,

    I followed this guide: http://www.howtoforge.com/virtual_postfix_mysql_quota_courier

    I reached the end of page 2, but the command "telnet localhost pop3" failed, so I went to check why.

    I found the following in my logs:

    Code:
    Sep 10 02:32:40 server postfix/cleanup[22630]: warning: connect to mysql server unix:/var/run/mysqld/mysqld.sock: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    Code:
    server:/etc/postfix# mysql -u mail_admin -p --socket=/var/run/mysqld/mysqld.sock
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 28 to server version: 4.0.24_Debian-10sarge2-log
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql>
    All of my config files are the defaults (except for changing the hosts =, since I only access the server via local socket) e.g.:

    Code:
    server:/etc/postfix# cat mysql-virtual_forwardings.cf
    user = mail_admin
    password = mail_admin_password
    dbname = mail
    table = forwardings
    select_field = destination
    where_field = source
    hosts = unix:/var/run/mysqld/mysqld.sock
    I can connect via the command-line mysql client and via PHP/Perl with the same socket/user/pass, why isn't Postfix working? [​IMG]

    Thanks!

    (P.S. this is the first time I've ever encountered a problem with one of your articles. Keep up the good work. :))
     
  2. asterix

    asterix New Member

    Little note I forgot to mention:

    My current setup DOES work if I allow MySQL access from localhost via:

    iptables -I INPUT 1 -p tcp -s 127.0.0.1 --destination-port 3306 -j ACCEPT

    I would like to use it over a socket though!
     
  3. asterix

    asterix New Member

    Still haven't resolved my socket syntax issue, but I have a more pressing concern atm:

    Code:
    Sep 10 13:21:28 server imaplogin: LOGIN, user=me@mysite.com, ip=[::ffff:127.0.0.1], protocol=IMAP
    Sep 10 13:22:04 server imaplogin: LOGOUT, user=me@mysite.com, ip=[::ffff:127.0.0.1], headers=445, body=0, time=36
    I have Squirrelmail up and running correctly, but it's taking almost 40 SECONDS to switch between pages in its interface.

    Why on EARTH would it take 40 seconds to query a local imap server? [​IMG]
     
  4. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Please use 127.0.0.1 instead of the MySQL socket, and also switch off your firewall for now.
     
  5. asterix

    asterix New Member

    Ok, I am using 127.0.0.1 (although socket would be preferred... and faster), and everything seems to work ok.

    Aside from viewing the Squirrelmail interface, which takes between 15 and 45 seconds to load a page. Any ideas?
     
  6. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Any errors in your mail log and in Apache's error log?
     

Share This Page