Linux install using Mutt mail client and configure mail alert features

Source: Internet
Author: User
Tags openssl openssl version

0, before the official installation of Mutt
Check the two security components first.
Openssl:

The code is as follows:
OpenSSL version-a #检查安装及版本信息
SASL (the system has been usually brought):

The code is as follows:

Rpm-qa | grep SASL

The query can be as follows:
Cyrus-sasl-gssapi-2.1.23-15.el6_6.2.x86_64
Cyrus-sasl-devel-2.1.23-15.el6_6.2.x86_64
Cyrus-sasl-lib-2.1.23-15.el6_6.2.x86_64
Cyrus-sasl-plain-2.1.23-15.el6_6.2.x86_64
Cyrus-sasl-2.1.23-15.el6_6.2.x86_64
If SASL is not running, start first:

The code is as follows:


/ETC/INIT.D/SASLAUTHD start


It is best to add to your startup project:

The code is as follows:

Chkconfig SASLAUTHD on

Because you will need to use security authentication when sending mail.

1, installation
The official website downloads the latest version.

The code is as follows:

# after decompression into the mutt directory
cd/root/mutt-1.6.0
Compiler
./configure--prefix=/usr/local/mutt--enable-pop--enable-smtp--with-ssl--WITH-SASL
# description
--enable-pop Enable pop
--ENABLE-SMTP Enable SMTP
--with-ssl--WITH-SASL with the above protocol enabled, you must use more secure encryption

PS: Because I used the test account is QQ mail, QQ Mail using the SMTP protocol when required to use SSL security connection, and in the mutt use of secure connection must use SASL encryption, so the above 2 security components in the compilation of the installation must be added. Otherwise, "SMTP authentication requires SASL" or another SSL-related error will appear when you send the message.

The code is as follows:

# installation
Make && make install

2, the basic use of mutt
Using mutt to send mail is extremely convenient, is a text-mode mail management program, provides a Full-screen operating interface. You need only one command to send or bulk mail:

The code is as follows:

Mutt [-hnprvxz][-a< File >][-b< address >][-c< address >][-f< mail file >][-F< profile >][-H< Mail Draft >][-i < file >][-m< type >][-s< subject >][mailing address]

Here's a detailed argument:
-a< File > Add additional files to the message.
-b< address > Specify the recipient address for the blind copy.
-c< address > The recipient address of the specified replica.
-f< mail File > Specify the mail file to load.
-f< configuration File > Specifies the settings file for the Mutt program, and does not read the preset. muttrc file.
-h displays Help.
-h< Message Draft > send the specified message draft.
-i< File > Inserts the specified file into the text of the message.
-m< type > Specify a preset mail box type.
-N Do not read the program implant file (/ETC/MUTTRC).
-P When you finish editing a message in mutt, and you do not want to send the message immediately, you can postpone sending the message.
-R opens the mail file in read-only mode.
-s< topics > Specify the subject of a message.
-V Displays the version information of the mutt and the parameters that were given when the file was originally compiled.
-X simulates how Mailx is edited.
-Z when used with the-f parameter, does not start mutt if there is no mail in the mail file.
Master these basically can use mutt, easy enough ~ next to introduce the topic of this article, use its mail alert features:

3, configure the mail alarm function
Method 1:
After installation, copy a/usr/local/mutt/etc/configuration file muttrc to/ROOT/.MUTTRC in the installation directory, or modify the configuration file directly, set the read profile path to the security directory, so no copy is required.
Default settings:

The code is as follows:

Set alias_file= "~/.muttrc"

Method 2:

The code is as follows:

CAT/USR/LOCAL/MUTT/ETC/MUTTRC | Grep-v ^# | Grep-v ^$ > ~/.muttrc

This allows you to get the default profile information.
After the installation is complete, we only need to set the following information:

The code is as follows:

Set folder= "./mail" #设置本地的收件箱, if you do not set the Send message will be prompted
Set from= "123456789@qq.com" #设置发件人地址
Set Realname= "John" #发件人姓名
Set smtp_pass= "999999" #密码
Set smtp_url= "smtps://123456789@smtp.qq.com:465/" #发件人帐号和邮件主机信息, QQ mailbox must use a secure connection
Set Use_envelope_from=yes #使用自定义发件人邮箱
Set Use_from=yes #使用自定义发件人姓名

4, testing
The syntax of the mutt-1.6 version of the message is slightly different from the 1.4 version, with the following specific commands:
Mutt-s "title use"-a/usr/local/mutt/content.txt--rep@shoujianren.com </ROOT/1
Description
-S Message header
-A attachment
--Follow the recipient information
< is followed by the message body content, also can be given in the form of the preceding echo XXX. As follows:

The code is as follows:

echo xxx|mutt-s "title use"-a/usr/local/mutt/content.txt-rep@shoujianren.com

See, do not need to cooperate with other software, Mutt can send the mail independently, of course, receive also no problem, just in the mail alarm this need not need.
One of the error messages:

The code is as follows:

[Root@x63 mutt]# echo "Hello" | Mutt-s "Title"--xxx@xxxx.com

TLSv1.2 Connection using Tlsv1/sslv3 (aes256-sha256)
SMTP authentication requires SASL
Could not send the message.
This is a certificate failure.
Send a successful message:

The code is as follows:

[Root@x63 mutt]# echo "Hello3" | Mutt-s "Title"--xxx@xxxx.com

TLSv1.2 Connection using Tlsv1/sslv3 (aes256-sha256)

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.