Saturday, May 16, 2015

email - setup mail on centos



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=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Con\ nection refused by [127.0.0.1]



my question is:
1. do I need to setup a smtp mail server on localhost for mail to work?


Answer



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.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...