Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I've just set up my first mail server with Postfix and Dovecot . I can send out going mail (via squirrel mail) fine but cannot recive them. Pingability tells me that ConnectException: Connection refused but my firewall is not blocking port 25 . I suspect it has something to do with my Postfix config file :

  smtpd_sasl_auth_enable = yes
  smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
  smtpd_sasl_security_options = noanonymous
  smtpd_sasl_type = dovecot
  smtpd_sasl_path = private/auth
  queue_directory = /var/spool/postfix
  command_directory = /usr/sbin
  daemon_directory = /usr/libexec/postfix      
  mail_owner = postfix
  myhostname = mail.myserver(i've blanked this out).com
  mydomain = myserver(i've blanked this out).com
  myorigin = $mydomain
  inet_interfaces = all
  mydestination = $myhostname, $mydomain,
  unknown_local_recipient_reject_code = 550
  alias_maps = hash:/etc/aliases
  alias_database = hash:/etc/aliases
  debug_peer_level = 2
  debugger_command =
       xxgdb $daemon_directory/$process_name $process_id & sleep 5
  sendmail_path = /usr/sbin/sendmail.postfix
  newaliases_path = /usr/bin/newaliases.postfix
  mailq_path = /usr/bin/mailq.postfix
  setgid_group = postdrop
  html_directory = no
  manpage_directory = /usr/share/man
  sample_directory = /usr/share/doc/postfix-2.3.3/samples
  readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
share|improve this question
up vote 4 down vote accepted

Connection refused error means that the port is closed (no listening service). You should make sure your postfix process is running and listening on port 25.

You can use:

sudo netstat -lnp | grep 25

You should see postfix process listed in the output. Also, you can look at the mail.log file for better diagnostics if you can reach the server.


Postfix process should NOT be listening on local address only. Otherwise, it will not be accessible from the network. To check this, look at postfix config for line like:

inet_interfaces = localhost
inet_interfaces =
share|improve this answer
Hi thanks for the quick reply , This returns : tcp 0* LISTEN 4506/master . What should I look for in the mail log? – Frank Astin Jan 22 '12 at 13:36
That's nice. It seems that postfix is running and listening on the right port. If you are still getting "connection refused" errors, I recommend you to double-check your firewall rules. – Khaled Jan 22 '12 at 13:39
I'm checking my CSF config now , is there anything obvious a noob like me would of missed? – Frank Astin Jan 22 '12 at 13:44
Ok , I've had a good look at CSF's config and there's nothing to sujjest it's blocking port 25 ... – Frank Astin Jan 22 '12 at 13:55
It might be the right port but it's the wrong interface. It's only listening on The config you posted says to listen on all interfaces. Did the above command show anything else? – Ladadadada Jan 22 '12 at 14:02

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.