centos7 mutt安装配置
安装配置sendmail
sudo yum install -y sendmail
yum install -y sendmail-cf
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
set nss-config-dir=/etc/pki/nssdb
set ssl-verify=ignore
set smtp=smtps://smtp.exmail.qq.com:465
set smtp-auth=login
set smtp-auth-user=service-alert@gaojihealth.com
set smtp-auth-password=Gaoji_001#
set from=service-alert@gaojihealth.com
echo 'it is only a test' | mail -s "test eamil" hgliu@gaojihealth.com
mutt安装配置
yum -y install mutt
yum install msmtp
cp /etc/Muttrc ~/.muttrc
vi ~/.muttrc
末尾加入
# add
set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="service-alert@gaojihealth.com"
set editor="vim"
set from="service-alert@gaojihealth.com"
- 确认
msmtp
命令路径正确存在
- 配置msmtp
vi ~/.msmtprc
host smtp.exmail.qq.com
port 465
from service-alert@gaojihealth.com
auth login
tls_starttls off
tls on
tls_certcheck off
user service-alert@gaojihealth.com
password Gaoji_001#
logfile ~/.msmtp.log
echo "test " | mutt hgliu@gaojihealth.com -s "test 01"
可能出现的问题