Linux msmtp+mutt

wget http://downloads.sourceforge.net/msmtp/msmtp-1.4.30.tar.bz2?big_mirror=0

bzip2 -d msmtp.bz2
tar -xvf msmtp-1.4.30.tar
./configure --prefix=/usr/local/msmtp
make
make install
mkdir -p /usr/local/msmtp/etc/

cat msmtprc

account default   
host smtp.qq.com    
port 25    
from [email protected]    
auth login    
tls off    
user [email protected]    
password 邮箱密码    
logfile /home/tong.li/msmtp.log

cp /usr/local/msmtp/etc/msmtprc ~/.msmtprc

检测:

msmtp -P
msmtp -S
ln -s  /usr/local/msmtp/bin/msmtp /usr/bin/msmtp
yum install mutt

cat ~/.muttrc

set from="[email protected]"   
set sendmail="/usr/local/msmtp/bin/msmtp" #你的msmtp命令路径    
set use_from=yes    
set realname="[email protected]"    
set editor="vim"
set charset="utf-8"

测试:

echo "test" | mutt -s "hello" [email protected]

# -a:附件   -c:抄送

你可能感兴趣的:(account,blank)