How to resolve e- mailing problem in Zoneminder when using msmtp with gmail

Please refer the procedure at the link below to install masmatp on Ubuntu and to use with Zoneminder

How to use MSMTP as email software in Zoneminder (v1.33.14.) on Ubuntu 19.04

After 30 may 2022 , It has been observed that the sending e – mail alerts of motion detection events are not working for the host smtp.gmail.com .

The error message found in the Zoneminder logs is given in the figure below

Figure:- 1 ZM Error log

After a thorough investigation , it has found the google is not allowing less secure apps to be used with gmail accounts . Please refer the figure below

Figure:- 2 Google notice on Less secure apps

Therefore , we have to drop using a gmail accounts in sending e-mail alerts .

It has found aol mail can be used successfully for sending e- mail alerts .

First you will have to open an aol mail account and login . Then generate an app password for msmtprc as follows.

After login to aol mail , go to Options at the right > Account info

Then go to Account Security at the left corner > Other ways to sign in > App password

Then generate app password for msmtp and keep it for use in msmtprc file.

Using the text editor make a file named msmtprc by including the following codes

# Set default values for all following accounts.
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log

# aol
account aolmail
host smtp.aol.com
port 587
from youraolmail@aol.com
user youraolmail@aol.com
password generated app password

# Set a default account
account default : aolmail

Figure:- 3 msmtprc file

Then copy the file to /etc/msmtprc as follows

sudo cp msmtprc /etc/msmtprc

Then open the zoneminder panel >Options>email and fill the cages accordingly

Then create filter with the conditions and save and activate as shown in the at the top of this post.

Figure :- 4 email alerts using smtp.aol.com

Now you can see the Zonminder is sending e- mail alerts of motion detection events in the figure 4.