Sendmail Connection Refused on localhost
RedHat often misconfigures the /etc/hosts file when setting the system up and sendmail is unable to send messages, leaving log file messages like "Connection refused by localhost.co.nz".
Email was the first “killer app” of the early Internet and today millions of emails are sent every day using a variety of emails servers such as postfix and sendmail. This section looks at how to use and configure email servers for sending and receiving email, mail filtering with services such as maildrop and procmail, and POP and IMAP servers such as Courier IMAP and Dovecot.
RedHat often misconfigures the /etc/hosts file when setting the system up and sendmail is unable to send messages, leaving log file messages like "Connection refused by localhost.co.nz".
If you cannot connect remotely to sendmail, postfix or other mail servers on port 25 make sure you have the port opened on your firewall. This article deals with opening port 25 with iptables on RedHat Linux.
How to enable sendmail to accept remote connections. By default most distributions (or when compiling sendmail yourself) will only allow local connections for security reasons.
When you restart dovecot, if it won’t start up again it’s likely the process crashed on startup but left the subsys lockfile in place. This prevents dovecot from starting up again. If you run /etc/init.d/dovecot status
and get the error message "dovecot dead but subsys locked" then you have this problem.
If you get a message like the one following, then you are filtering emails through spamassasin using /usr/bin/spamc but the spamassassin service is not running. connect(AF_INET) to spamd at 127.0.0.1 failed, retrying (#1 of 3): Connection refused.