Page 1 of 1

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

Posted: Mon Oct 26, 2020 9:54 pm
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!!

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

Posted: Tue Oct 27, 2020 5:43 pm
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.

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

Posted: Wed Oct 28, 2020 5:43 am
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

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

Posted: Thu Oct 29, 2020 1:51 pm
by deebee
Thank so much for the quick replies - very helpful.. I will check it out!
Cheers!