Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Yesterday I set up a mail server following this tutorial and everything worked fine, but today I am unable to send or receive mails. When I want to send a mail with my from Thunderbird it asks for my password then it doesn't accept it (I checked 3 different mail addresses).

postfix/pickup[15575]: 8724D2C411F5: uid=33 from=<www-data>
postfix/cleanup[16104]: 8724D2C411F5: message-id=<20130715165704.8724D2C411F5@Ubuntu-1204-precise-64-minimal.localdomain>
postfix/cleanup[16104]: warning: connect to mysql server Can't connect to MySQL server on '' (111)
warning  mysql: /etc/postfix/maps/ lookup error for ""
warning: A3C912C411F5: virtual_alias_maps map lookup problem for "" -- deferring delivery

This is my personal address.

ls -la /etc/postfix
drwxr-xr-x   4 root root  4096 Jul 14 11:06 .
drwxr-xr-x 124 root root 12288 Jul 14 22:51 ..
-rw-r--r--   1 root root   329 Jul 14 09:50
-rw-r--r--   1 root root  1651 Jul 14 10:49
-rw-r--r--   1 root root  1286 Jul 14 09:50
drwxr-xr-x   2 root root  4096 Jul 15 18:42 maps
-rw-r--r--   1 root root  4798 Jul 14 09:57
-rw-r--r--   1 root root  5531 Jul 14 09:50
-rw-r--r--   1 root root 19707 Feb 20 21:03 postfix-files
-rwxr-xr-x   1 root root  8729 Feb 20 21:03 postfix-script
-rwxr-xr-x   1 root root 26498 Feb 20 21:03 post-install
drwxr-xr-x   2 root root  4096 Jul 14 10:07 sasl

ls -la /etc/postfix/maps
total 20
drwxr-xr-x 2 root    root    4096 Jul 15 18:42 .
drwxr-xr-x 4 root    root    4096 Jul 14 11:06 ..
-rwx------ 1 postfix postfix  158 Jul 15 18:42
-rwx------ 1 postfix postfix  170 Jul 14 10:05
-rwx------ 1 postfix postfix  235 Jul 14 10:05



When I set in /etc/mysql/my.cnf the bind-address to I can send and receive emails but I cannot open my website:

ERROR: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '' (111)

If I change it back to the IP address of the website, the website loads but then I cannot send or receive emails.

In /etc/hosts I have

my.ip.address Ubuntu-1204-precise-64-minimal

If I comment out the bind-address parameter everything is working fine but I think that parameter is there for a reason. Any ideas?

share|improve this question
Why do you not have your Postfix config and your website connecting to MySQL using the same IP address? – Ladadadada Jul 15 '13 at 18:21
What do you mean? What files and parameters should I check? Sorry, I am new to linux – erdomester Jul 15 '13 at 20:03

When you comment out the bind parameter mysql will bind to all interfaces. This leaves your mysql server exposed to the internet so If you need to have mysql listening on the internet facing interface because another remote server needs to use it then you can use iptables or hosts.allow to filter traffic to limit your attack surface.

share|improve this answer

As explained by @Shutupsquare, removing bind-address will make MySQL listen on all interfaces, including and loopback IP address

  • If your website reside on the same server of postfix, then it will be useful if you change MySQL parameter of your website so it will be connect to in instead connect to Then set bind-address to It will prevent other host connect your MySQL because the MySQL only listen on loopback IP address.

  • If your website in the other host, then the firewall solution from @Shutupsquare will limit IP address that can connect to MySQL

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.