Raspberry Pi msmtp and mutt installation and configuration tutorial

Raspberry Pi msmtp and mutt installation and configuration tutorial

1. Install mutt

sudo apt-get install mutt

2. Install msmtp

sudo apt-get install msmtp

3. Set up mutt

/etc/Muttrc # System global settings ~/.muttrc # Use a system user raspberrypi# vim ~/.muttrc 
set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="name_post" # sender's nickname set editor="vi"
set from=xxx@xxxx.com #sender's mailboxset envelope_from=yes
set crypt_use_gpgme=no
#tls off

4. Set up msmtp

Create ~/.msmtprc and ~/.msmtp.log as configuration and log files respectively

raspberrypi# vim ~/.msmtprc
account default
host smtp.xxxx.com # You can check it in the mailbox settings user xxxx # It must be the part before the @ in the mailbox from xxxx@xxxx.com
password 123456 # Email password (may be the authorization code)
auth plain
logfile ~/.msmtp.log

5. Check whether the SMTP server supports authenticated TLS encryption

raspberrypi# msmtp --host=smtp.sina.com --serverinfo        
SMTP server at smtp.sina.com (xk-6-242-a8.bta.net.cn [202.108.6.242]), port 25:
  smtp-5-121.smtpsmail.fmail.xd.sinanode.com ESMTP
Capabilities:
  STARTTLS:
    Support for TLS encryption via the STARTTLS command
  AUTH:
    Supported authentication methods:
    PLAIN LOGIN 
This server might advertise more or other capabilities when TLS is active.

It can be seen that authentication is supported (if it is not supported, uncomment the last item in .muttrc. It has not been tested personally, but it is generally supported).

6. Test email sending

echo text| mutt -s subject xxxx@xx.com -a attachment

Summarize

The above is the installation and configuration tutorial of Raspberry Pi msmtp and mutt introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to install Docker on Raspberry Pi
  • How to install NodeJS on Debian (Raspberry Pi)
  • Tutorial on installing Python and OpenCV on a Raspberry Pi 2 or Raspberry Pi B+
  • Ubuntu16.04/Raspberry Pi Python3+opencv configuration tutorial (sharing)

<<:  Problems and solutions encountered when deploying a project when upgrading the Mysql database from version 5.6.28 to version 8.0.11

>>:  Detailed explanation of filters and directives in Vue

Recommend

Native js realizes the drag and drop of the nine-square grid

Use native JS to write a nine-square grid to achi...

Nodejs combined with Socket.IO to realize websocket instant communication

Table of contents Why use websocket Socket.io Ope...

CSS flexible layout FLEX, media query and mobile click event implementation

flex layout Definition: The element of Flex layou...

Summary of pitfalls encountered in installing mysql and mysqlclient on centos7

1. Add MySQL Yum repository MySQL official websit...

VMWare15 installs Mac OS system (graphic tutorial)

Installation Environment WIN10 VMware Workstation...

How to install and uninstall open-vswitch in Linux

1. Compile and install ovs from source code: Inst...

Solution to forgetting mysql database password

You may have set a MySQL password just now, but f...

Vue uses echarts to draw an organizational chart

Yesterday, I wrote a blog about the circular prog...

Teach you how to use AWS server resources for free

AWS - Amazon's cloud computing service platfo...

How to get the real path of the current script in Linux

1. Get the real path of the current script: #!/bi...

vue+echarts realizes the flow effect of China map (detailed steps)

@vue+echarts realizes the flow effect of China ma...

CSS float (float, clear) popular explanation and experience sharing

I came into contact with CSS a long time ago, but...

Keep-alive multi-level routing cache problem in Vue

Table of contents 1. Problem Description 2. Cause...

Vue implements tree table through element tree control

Table of contents Implementation effect diagram I...