MUTT+MSMTP implementing e-mail in a shell environment

Source: Internet
Author: User
Tags test email address

139 e-mail message will be sent automatically after the email, using this function can send the server's exception information to 139 boxes and then the phone will receive SMS reminders, to facilitate the management of the server function.

To avoid being treated as spam, we need to install both the Mutt and MSMTP software, as well as a 139 mailbox and a 163 mailbox for sending mail.

1) Download MSMTP

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

2) Unzip:

tar jxvf msmtp-1.4. . tar. bz2

3) Installation:

./configure--prefix=/usr/local/msmtpmake make andinstall

4) Configuration Msmtp

cd/usr/local/msmtp/mkdir  ETCCD etc/vim MSMTPRC

This is the configuration information for MSMTPRC.

for/usr/local/msmtp/msmtp.log# The SMTP server of the Provider.account [email protected]163  . com# SMTP mail server address host SMTP. 163 . com# sent mail emailfrom [email protected] 163  logintls off# mail server login account user [email protected]163. com# Mail server login password password password# Set a default accountaccount default: [email protected]163. com

5) Save exit to test if client is available

/USR/LOCAL/SMTP/BIN/MSMTP Target Mailbox

Enter some characters casually, and then press CTRL D to exit to see if the message was received from the destination email address.

6) Configure Mutt,mutt General Linux will be installed by default, you can use which mutt to view the path of mutt installation, if not installed, you can use Yum installation.

Yum Install Mutt

Edit Mutt configuration file

Vim/etc/muttrc

At the end of MUTTRC, add the following information

Set sendmail="/usr/local/msmtp/bin/msmtp"  #你的msmtp命令路径 set Use_from=Yesset Realname="Jimmy Chen"  #发信人setfrom [email protected]163. com # Email Set Editor="vim"

7) Save exit and test if Mutt is valid:

Echo " test the contents of a message " " test the title of the message the test email address

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.