Linux Automatic Logon email
20:49:04 label: Linux
Mutt + msmtp Linux Mail Client Configuration
Leisure
Workplace
The MAIL command is often used to send emails when writing shell scripts. However, emails sent directly are often rejected as spam because they are invalid. Is there a similar Foxmail in Linux, the mail client software such as outlook has a command line to send emails. Mutt and msmtp provide a good solution.
The configuration scheme is as follows:
1) download msmtp
Wget
Http://downloads.sourceforge.net/msmtp/msmtp-1.4.16.tar.bz2? Modtime = 1217206451 & big_mirror = 0
2) decompress:
Tar jxvf msmtp-1.4.16.tar.bz2
3) installation:
./Configure -- prefix =/usr/local/msmtp
Make & make install
4) configure the msmtp account:
Create a file/usr/local/msmtp/etc/msmtprc (you can also create a. msmtprc file in the main directory, if it is only for your own use)
Edit content:
Ults
Account Test
Host sending email server name or IP address
Email address sent from
AUTH LOGIN
User email server Logon account
Password email server login password
Account default: Test // set the default account
5) test whether the client is available
/Usr/local/msmtp/bin/msmtp target email address
Enter some characters and press Ctrl + D to exit. Go to the target email address and check whether the email is received.
6) Configure mutt. Mutt is usually installed by default in Linux.
Edit the mutt configuration file:/etc/muttrc and modify the following lines: (you can also create a file in the main directory. edit the muttrc file, if only used by yourself) set Sendmail = "/usr/local/msmtp/bin/msmtp"
Set use_from = Yes
Set realname = "sending email address"
Set Editor = "Vi"
7) Save and exit, and test whether mutt is valid:
Echo "Test content" | mutt-s "Test Topic" target email address