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
# 发送的邮件Email
from [email protected]
auth login
# 邮件服务器登录账号
user [email protected]
# 邮件服务器登陆密码
password 12xiongjian12
# Set a default account
account 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=
yes
set 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