邮件服务器配置

#邮件配置
yum -y install mailx
yum -y install mailx sendmail
chmod -R 777 /var/spool/mail
service sendmail restart

#测试
echo 'hello!' | mail -s "hello test" zjl@zendaimoney.com
mail -s "test" zjl@zendaimoney.com < file.log

#邮件发送附件格式配置
yum -y install mutt
cp /etc/Muttrc /root/.muttrc

修改内容/root/.muttrc
set charset="utf-8"
set rfc2047_parameters=yes
set envelope_from=yes
set use_from=yes
set from=root@lcb.com
set realname="lcb"

测试示例:
echo "test111333" | mutt zjl@zendaimoney.com -s "logs" -a install.log

原文地址:https://www.cnblogs.com/franjia/p/5707824.html