MUTT+MSMTP implementing e-mail in a shell environment

Source: Internet
Author: User

In order to automate the receipt of file backup information from the server, the MUTT+MSMTP is used to send e-mail in the shell environment, which is an easy and efficient way to complete operations.

Download MSMTP

wget http://downloads.sourceforge.net/msmtp/msmtp-1.4.16.tar.bz2?modtime=1217206451& Big_mirror=0

Decompression source installation 4 steps away

tar -xf msmtp-1.4. . Tar . BZ  # Decompression--install GCC, which will be used to compile the installation . /configure--prefix=/usr/local/msmtpmake make andinstall

Configure MSMTP

cd/usr/local/msmtp/mkdiretc #配置文件目录和配置文件需自己建cd etc[[email protected] etc]# More/usr/local/msmtp/etc/MSMTPRC Defaults logfile/var/log/Mmlog #输出错误日志文件路径Account163#邮箱类型--here, for example, host SMTP for 163.163. com #邮箱服务器地址 from [email protected] 163. com #要从哪个邮箱发出 authLogin
User [email protected] 163#邮箱用户名 Passwordpwd#邮箱密码 (recommended to use the password that comes with the mailbox) account default:163#邮箱类型

Install Mutt and configure

Yum Install Mutt-
[email protected] etc]# cat /etc/muttrc /etc/muttrc.localset sendmail="/usr/local/msmtp/bin/ MSMTP" #msmtp命令的绝对路径set use_from=yesset realname="Root " #发件人set Editor="vim"set copy=no

Test the sender

Echo  " Test " [Email protected] 163. com  <  /etc/hosts

"Content"--subject----the file content under absolute path

MUTT+MSMTP implementing e-mail in a shell environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.