Centos7 Mutt安装配置
Centos7 Mutt安装配置
Alexcentos7 mutt安装配置
安装配置sendmail
1 | sudo yum install -y sendmail |
vi /etc/mail/sendmail.mc
1
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')
1
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
vi /etc/mail.rc
末尾加入1
2
3
4
5
6
7set 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测试sendmail
1
echo 'it is only a test' | mail -s "test eamil" hgliu@gaojihealth.com
mutt安装配置
- 安装mutt
1
2yum -y install mutt
yum install msmtp cp /etc/Muttrc ~/.muttrc
vi ~/.muttrc
末尾加入1
2
3
4
5
6# 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
1
2
3
4
5
6
7
8
9
10host 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- 测试mutt发送
1
echo "test " | mutt hgliu@gaojihealth.com -s "test 01"
可能出现的问题
- msmtp问题超照
msmtp -P