In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "centos how to configure mutt and msmtp to send mail", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "centos how to configure mutt and msmtp to send mail" this article.
First, install mutt
Yum install mutt-y
2. Configure mutt
Vim / etc/Muttrc
Find the following lines inside and modify the content to your own (the following lines are distributed in different locations, please look for them patiently, and remember to remove the # at the beginning of the line)
Set from= "send email address" set sendmail= "/ usr/local/msmtp/bin/msmtp" set use_from=yes set realname= "Sender name" set editor= "vim"
Download and decompress msmtp
Wget http://downloads.sourceforge.net/msmtp/msmtp-1.4.30.tar.bz2?big_mirror=0 tar xf msmtp-1.4.30.tar.bz2
Depending on the system, wget and bzip2 need to be installed
Yum install wget bzip2-y
IV. Compiling msmtp
Once unzipped, go to the directory and run the following statement
. / configure-- prefix=/usr/local/msmtpmakemake install
5. Configure msmtp
Cd / usr/local/msmtpmkdir etccd etcvim msmtprc
Add the following to the file:
Defaults # specifies the location of the log logfile / usr/local/msmtp/msmtp.log # The SMTP server of the provider. Account test # SMTP mail server address host smtp.qq.com # used to send mail Email from xxxxx@qq.com auth login # account used to send mail user xxxxxx@qq.com # login password password 123456 # Set a default account account default: test
Save exit
Since the password is in clear text, it is best to modify the permissions of the file here: chmod 600msmtprc
VI. Testing
After you have configured the above configuration, you can test it and run the statement.
Echo "message content" | mutt-s "message subject" recipient mailbox
If everything is all right, the recipient's mailbox can accept mail.
VII. Use
The reason for setting up the program to send mail is that if you need to prompt the administrator in the server management, you can use the way to send email to remind the administrator.
For example, check the disk occupancy regularly every day, and if the occupancy rate is high, send an email to remind the administrator that it is time to deal with it.
For other uses, you can write your own scripts according to your needs.
VIII. Mutt parameters
Grammar: mutt [- hnpRvxz] [- a] [- b] [- c] [- f] [- F] [- H] [- I] [- m] [- s] [email address]
Note: mutt is a text-mode mail manager that provides a full-screen interface.
Parameters:
-an add an additional file to the message.
-b specify the address of the recipient of the BCC copy.
-c specifies the address of the recipient of the copy.
-f specifies the mail file to load.
-F specifies the settings file for the mutt program instead of reading the preset .muttrc file.
-h displays help.
-H sends the specified draft mail.
-I inserts the specified file into the message body.
-m specifies the default mailbox type.
-n do not read the program cultivation file (/ etc/Muttrc).
-p after editing the message in mutt, and do not want to send the message immediately, you can postpone the message.
-R opens the mail file as read-only.
-s specifies the subject of the message.
-v displays the version information of mutt and the parameters given when the file was compiled.
-x simulates the editing of mailx.
When the-z parameter is used with the-f parameter, mutt is not started if there is no message in the mail file.
The above is all the contents of the article "how to configure mutt and msmtp to send mail by centos". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.