Are Docker install event alerts via SSMTP possible or is Event Server required?

Previous development branch now released as 1.36
Locked
deebee
Posts: 2
Joined: Mon Oct 26, 2020 9:32 pm

Are Docker install event alerts via SSMTP possible or is Event Server required?

Post by deebee »

Love ZM!.... and now with Docker!! - appreciative of the genius and effort put into creating this fantastic application!

My question for the good people of the forum:
I had ZM running for several years (straight install/Lubunu) with email notifications; all worked fantastic.
Upgraded to Lubuntu 20 recently and now trying ZM on Docker and love it.. but cannot get email notifications to work via ssmtp.
Read a bunch but couldn't find a straight answer so hoping someone can help answer a likely silly question directly:
For email notifications to work on Docker 'install', can I use ssmtp or does Docker require Event Server?

Context:
My manual tests from CLI (eg echo "Hello, World" | mail -s "My email check" user@gmail.com) work fine so ssmtp config is good.
Followed instructions to set up ssmtp (https://wiki.zoneminder.com/How_to_get_ ... Zoneminder).
But when I try to send email alert via ZM (eg filter/email details of all matches).. I get error in ZM log: "Unable to send email: error closing /usr/lib/sendmail: (exit 256)"... and no email alert :( .

tail -f /var/log/syslog shows my successful manual CLI commands but nothing shows up regarding failed attempts via ZM.

Thanks so much for any insights!!
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Are Docker install event alerts via SSMTP possible or is Event Server required?

Post by burger »

MSMTP is recommended after Stretch. SSMTP is abandoned and doesn't work with certain type of email auth types.

Event server is not required for emails in normal ZM. I can't speak for docker, but I doubt its required.

Email disambiguation is here: https://wiki.zoneminder.com/Email. If you read through those docs, they should cover everything. Although I haven't heard of people using email alerts in Docker, there's no reason it shouldn't work. Buster needs to disable apparmor for msmtp.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
bkjaya1952
Posts: 282
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka

Re: Are Docker install event alerts via SSMTP possible or is Event Server required?

Post by bkjaya1952 »

Please refer the following link to get the details on installing MSMTP
https://bkjaya.wordpress.com/2019/10/21 ... ntu-19-04/
If the MSMTP is not installed in the docker zoneminder image that you are using , you will have to install it within the container as follows
Suppose the name of the container is "zm"
On the terminal run
sudo docker start zm
sudo docker exec -t -i zm /bin/bash ( to open the container )
apt update
apt install msmtp
ln -s /usr/bin/msmtp /usr/sbin/sendmail
exit
Prepare a file msmtprc in the home folder of the host (refer the link to get the codes for msmtprc )
Then copy a msmtprc file from the host machine to the contaier
sudo docker cp msmtprc zm:/etc/

Then configure Options>Email in the ZM panel ( refer the method used in the above link)
Prepare & run the zoneminder filter for emailing



Alternative method

Try the following zoneminder docker image where the MSMTP is already installed in the image
https://hub.docker.com/r/bkjaya1952/zon ... ker-latest

Then copy the msmtprc file to the docker container as follows
Suppose the name of the zoneminder container is "zm"
On the terminal run following command
sudo docker cp /etc/msmtprc zm:/etc/
Then configure Options>Email in the ZM panel
Prepare & run the zoneminder filter for emailing
Last edited by bkjaya1952 on Fri Oct 30, 2020 5:00 am, edited 1 time in total.
deebee
Posts: 2
Joined: Mon Oct 26, 2020 9:32 pm

Re: Are Docker install event alerts via SSMTP possible or is Event Server required?

Post by deebee »

Thank so much for the quick replies - very helpful.. I will check it out!
Cheers!
Locked