[CentOS] Setting up sendmail to mail system messages on CentOS 6 and 7

Mon Oct 29 01:38:10 UTC 2018
マスターズ・イアン <ian at ncsa.jp>

On 2018/10/27 21:00, centos-request at centos.org wrote:
> I've previously configured sendmail to send system messages on selected
> servers running CentOS 6. Usually they just kinda' work out of the box. No
> problems to speak of.
> However most of my CentOS 7-servers are rather flakey when it comes to
> sendmail. Most of the time they just won't send mails for whatever reason.
> Further, most of the time I can get it working, it's usually about a
> firewall rule not set, the firewall not having been reloaded or some simple
> such.

Another thing to try would be Postfix. I've always found that very easy to use and also requires almost no configuration:
https://www.server-world.info/en/note?os=CentOS_7&p=mail&f=1 (on the same site, a lot of very useful CentOS7 info)

Usually for local servers, all I do is:
1. Add root alias in /etc/aliases
2. Run 'newaliases'
3. Send test mail:
echo "test from `hostname`" | mail -s 'mail test' me at address

That's all.