MUTT+MSMTP do Linux mail client 1. Installation Configuration Msmtp
L Installation
wget https://sourceforge.net/projects/msmtp/files/msmtp/1.4.32/msmtp-1.4.32.tar.bz2
Tar jxvf msmtp-1.4.32.tar.bz2
CD msmtp-1.4.32
./configure--PREFIX=/USR/LOCAL/MSMTP
Make && make install
L Configuration
cd/usr/local/msmtp/
mkdir etc
Vi/usr/local/msmtp/etc/msmtprc
Account Default
#设置日志
Logfile/usr/local/msmtp/msmtp.log
#设置SMTP邮件服务器地址
Host Smtp.163.com
#设置发送的邮件Email
from [email protected]
Auth Login
TLS off
#邮件服务器客户端授权密码或邮箱用户密码
Password xxxx
# # #切记logfile权限, and MSMTPRC file permissions, if the system user is not root, will not have permission to read these two files, will error.
L Test
/USR/LOCAL/MSMTP/BIN/MSMTP [email protected] (the mailbox must be configured in the/USR/LOCAL/MSMTP/ETC mailbox), otherwise it will be an error.
2. Installation Configuration Mutt
L Mounting Mutt
Yum-y Install Mutt
L Configuration Mutt
Edit the/etc/muttrc file and add the following:
# # #设置发件人地址
Set from= "[Email protected]"
# # #设置调用程序地址
Set sendmail= "/usr/local/msmtp/bin/msmtp"
Set Use_from=yes
# # #设置发件人显示信息
Set realname=[email protected]
L Test
Mutt-s "Sky City" [email protected] < ~/shscript/test.txt
Reference
Https://www.cnblogs.com/bass6/p/5544265.html
MUTT+MSMTP doing Linux mail client