0

I'm trying to configure a postfix/courier/mysql/SquirrelMail setup, using this guide, but i get the following error when trying to send an email:

451 4.3.0 <[email protected]>: Temporary lookup failure

/var/log/mail.log entry:

Mar 16 11:37:42 myserver postfix/smtpd[12750]: connect from localhost[127.0.0.1]
Mar 16 11:37:42 myserver postfix/smtpd[12750]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Mar 16 11:37:42 myserver postfix/smtpd[12750]: warning: mysql:/etc/postfix/mysql-virtual_email2email.cf lookup error for "[email protected]"
Mar 16 11:37:42 myserver postfix/smtpd[12750]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <[email protected]>: Temporary lookup failure; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<webmail.mydomain.com>
Mar 16 11:37:42 myserver postfix/smtpd[12750]: lost connection after RCPT from localhost[127.0.0.1]
Mar 16 11:37:42 myserver postfix/smtpd[12750]: disconnect from localhost[127.0.0.1]

I have rechecked the /etc/postfix/mysql-virtual_email2email.cf file, and it is configured correctly.

user = mypostfixusername
password = mypass
dbname = mail
query = SELECT email FROM users WHERE email='%s'
host = 127.0.0.1

My mysql server is running, i can connect to it using mysql -u mypostfixusername -p, and can run queries. I can also login with SquirrelMail.

4
  • 1
    Shouldn't the last line in your /etc/postfix/mysql-virtual_email2email.cf be hosts = 127.0.0.1?
    – clement
    Mar 16, 2014 at 11:05
  • I'm blind, was looking at the files for 2 hours, didn't notice that, thank you very much.
    – Ratzor
    Mar 16, 2014 at 11:12
  • 1
    If we specify 127.0.0.1 postfix should try to connect over TCP but your logline says that postfix cant connect to /var/run/mysqld/mysqld.sock.so that helped. :)
    – clement
    Mar 16, 2014 at 11:20
  • @masegaloeh done
    – clement
    Dec 10, 2014 at 13:08

1 Answer 1

1

The last line in your /etc/postfix/mysql-virtual_email2email.cf should be

hosts = 127.0.0.1

instead of

host = 127.0.0.1

If we specify 127.0.0.1 postfix should try to connect over TCP but your logline says that postfix cant connect to /var/run/mysqld/mysqld.sock and so it didn't recognize the host = 127.0.0.1 line. Hope that helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .