Msmtp+mutt+shell Send mail under Linux

Source: Internet
Author: User
Tags test email address

Linux under Install configuration msmtp and mutt send mail

Author: In-field Date: December 11, 2014 Comment (0) View Comments

Linux under Installation configuration msmtp and Mutt

Linux has the need to send mail, mail is uncertain, because many mail server blocked the mail sent requests (obviously, all the wood has sent source-_-).
Search on the Internet, using Msmtp+mutt can be done, recorded as follows.

First, installation configuration msmtp
1, download, decompression msmtp
wget http://downloads.sourceforge.net/msmtp/msmtp-1.4.16.tar.bz2 msmtp-1.4.16.tar.bz2
Tar jxvf msmtp-1.4.16.tar.bz2

2. Installation
CD msmtp-1.4.16
./configure–prefix=/usr/local/msmtp
Make
Make install
Note: Install directly with Yum, prompting you not to find the download source.

3. Configure MSMTP Account

Cd/usr/local/msmtp
mkdir etc
Vi/usr/local/msmtp/etc/msmtprc

The new MSMTPRC content is as follows:

?

123456789101112131415161718192021 # Set default values for all following accounts.defaults logfile /usr/local/msmtp/msmtp.log# The SMTP server of the provider.account test # SMTP邮件服务器地址host smtp.163.com# 发送的邮件Emailfrom [email protected]auth login# 邮件服务器登录账号user [email protected]# 邮件服务器登陆密码password 12xiongjian12# Set a default accountaccount default : test

Note: The password is clear text-_-

4. Testing
/USR/LOCAL/MSMTP/BIN/MSMTP [email protected]
Enter any character, and then press Ctrl+d to exit to see if the message was received.
can go to/usr/local/msmtp/msmtp.log, check the log, the success of the letter will be recorded.

Second, installation configuration mutt
1, General Linux will be installed by default Mutt
You can use the which mutt to view the path of the mutt installation, if not installed, you can use the # Yum install Mutt

2. Edit the Mutt configuration file
VI/ETC/MUTTRC, edit the total settings of the Mutt, modify the following lines

?

12345 set from="[email protected]"set sendmail="/usr/local/msmtp/bin/msmtp"set use_from=yesset realname="发件人"set editor="vi"

The sending address must be the same as the account set by MSMTP, or it may be an error.

3, test whether the mutt is effective
echo "Test test" | Mutt-s "test" test email address
echo "Test" |mutt-s "test" [email protected]

Below you can use Mutt to send and receive mail, combined with cron use, powerful.


This article is from the "Data Processing" blog, so be sure to keep this source http://9352163.blog.51cto.com/9342163/1588732

Msmtp+mutt+shell Send mail under Linux

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.