When I try to send mail on CentOS:

mail -s "hello" root

to=root, ctladdr=root (0/0), delay=00:00:00\ , xdelay=00:00:00,
mailer=relay, pri=30031, relay=[] [], dsn=4.0.0,
stat=Deferred: Connection refused by []

My question is:

Do I need to setup an SMTP mail server on localhost for mail to work?

1 Answer 1


Yes. There are plenty of HOWTOs on configuring sendmail, but iirc CentOS comes out of the box ready to run a working sendmail (for sending) on localhost. Try

chkconfig --list sendmail

and if it's not running,

chkconfig sendmail on
service sendmail start

and try again.

You must log in to answer this question.

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