Ret Hat 下SendMail
Posted handsky
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ret Hat 下SendMail相关的知识,希望对你有一定的参考价值。
Ret Hat 下SendMail
工具:RHEL7.5、Win7
SendMail服务器:RHEL7.5
----------------------------------------------------------------------------------------------------------------------------
*****************************************************************************************************************************
1.安装sendmail组件
检查是否安装sendmail组件
rpm -qa | grep sendmail
查看是否有sendmail系列包
yum grouplist sendmail
查看sendmail相关的包
yum list | grep sendmail
2.安装sendmail组件
yum install sendmail -y
3.编辑/etc/aliases文件
vi /etc/aliases
# trap decode to catch security attacks
decode: root
# Person who should get root‘s mail
#root: marc
如果我配置别名为root的,配置接收邮件(下面邮件仅仅是一个模板而已)
4.修改配置文件sendmail.cf
vim /etc/mail/sendmail.cf
# host/domain names ending with a token in class P are canonical
CP.
# "Smart" relay host (may be null)
DS[xxx.xxx.xxx.xxx]
# operators that cannot be in local usernames (i.e., network indicators)
CO @ % !
# a class with just dot (for identifying canonical names)
5.重启sendmail服务
service sendmail restart
6.测试邮件服务
如下所示,使用mail命令测试能否成功收到邮件。如果成功,表示前面配置OK, 如果没有收到邮件,则必须检查日志,然后根据具体错误信息诊断问题。
[[email protected] ~]# cat > test.txt
it is only test
^Z
[1]+ Stopped cat > test.txt
[[email protected] ~]# mail -s "test" [email protected] < test.txt
[[email protected] ~]#
[azrlnx06azlnx06 ~]$ echo ‘it is only a test‘ | mail -s "test eamil" [email protected]
[[email protected] ~]$
以上是关于Ret Hat 下SendMail的主要内容,如果未能解决你的问题,请参考以下文章