Tuesday, February 2, 2010

Postfix error -- connect to transport private/smtp: Connection refused

Problem:

Cannot send out any email, except to local users

Environment:

UNIX (Linux, FreeBSD, etc)
Postfix

Symptoms:

/var/log/maillog has these messages:
warning: connect to transport private/smtp: Connection refused

Reason:

"unix" smtp is disabled in Postfix configuration

Fix:

Uncomment this line in master.cf
smtp unix - - n - - smtp
(there are two more lines about smtp - they deal with external connections. Need them only if you want to accept mail from outside, not to send mail)

Additional thing to check:

mailer.conf should look like this:

$ cat /etc/mail/mailer.conf
#
# Execute the Postfix sendmail program, named /usr/local/sbin/sendmail
#
sendmail        /usr/local/sbin/sendmail
send-mail       /usr/local/sbin/sendmail
mailq   /usr/local/sbin/sendmail
newaliases      /usr/local/sbin/sendmail