[[email protected] ~]# wget http://jaist.dl.sourceforge.net/project/msmtp/msmtp/1.4.32/msmtp-1.4.32.tar.bz2 Baidu Network disk: Http://pan.baidu.com/s/1o8w68ci [[email protected] msmtp-1.4.32]# pwd/root/msmtp-1.4.32[[email Protected] msmtp-1.4.32]# mkdir-p/usr/local/msmtp/etc[[email protected] msmtp-1.4.32]#./configure--prefix=/ USR/LOCAL/MSMTP--with-ssl=openssl [[email protected] msmtp-1.4.32]# make && make install config msmtp[[email& Nbsp;protected] msmtp-1.4.32]# mkdir-p/usr/local/msmtp/etc vim/usr/local/msmtp/etc/msmtprcaccount defaulthost smtp.163.com//SMTP Server Port 25from [email protected]auth logintls offuser clnking//mailbox user name is clnking instead of [email Protected]password xxxxxx #是授权码 Instead of the mailbox login password (the authorization code is the private password used to log in to the third-party mail client) Note the picture at the beginning of the article logfile/var/log/zabbix/msmtp.log//log path Test msmtp[[email protected] msmtp-1.4.30]#/usr/local/msmtp/bin/msmtp [email protected] (mailbox must be/usr/local/ MSMTP/ETC configuration of the mailbox) so the following will be an error!! Hellomsmtp:the server did not accept the Mailmsmtp:seRVer message:554 dt:spm 163 Smtp4,dtgowaaneru7+exxz+8haq--. 9856s2 1464662088,please See Http://mail.163.com/help/help _spam_16.htm?ip=123.57.36.227&hostid=smtp4&time=1464662088msmtp:could not send mail (account default from/ USR/LOCAL/MSMTP/ETC/MSMTPRC) [[email protected] msmtp-1.4.30]#/usr/local/msmtp/bin/msmtp [email protected]kkkkkkkkkkkkk^[, but there's nothing in the mailbox. Cat/var/log/mmlogmay 10:47:00 host=smtp.163.com tls=off auth=on user=clnking [ Email protected] [email protected] mailsize=15 smtpstatus=250 smtpmsg= ' + Mail OK queued as SMTP4, Dtgowadxjjqp+0xx0lciaq--. 5878s2 1464662820 ' EXITCODE=EX_OK because there is no configuration: mutt[[email protected] msmtp-1.4.32]# Yum Install mutt [[email protected] ~]# vi/etc/muttrcset sendmail= "/USR/LOCAL/MSMTP/BIN/MSMTP" set Use_from=yesset Editor= "Vim" set Realname= "[email protected]" [[email protected] ~]# echo "Test Mail" content tom2 "|mutt-s "Test Kkkkk" [email protected] access to the mailbox received mail------"Testing success!
Zabbix using Msmtp+mutt to send mail alerts