Page 1 of 1

Trouble shooting email notification

Posted: Mon Jul 16, 2018 5:51 pm
by bbolin
Hello All,

Trying to get email notification working with filters. Installed postfix and have it pointing to an internal smart host. Email tests on the Zoneminder hosts work from the command line. I've also tried NEW_MAIL_MODULES without success

mail -stest realUser@realDomain.com

And it works fine. I've tried to configure the options settings in zm for mail to either localhost or the smarthost on the network. I can see these in /var/log/syslog
~
Jul 16 12:43:46 oc2 zmfilter_9[2033]: INF [Creating notification email]
Jul 16 12:43:46 oc2 zmfilter_9[2033]: INF [Creating notification email]
Jul 16 12:43:46 oc2 zmfilter_9[2033]: INF [Creating notification email]
Jul 16 12:43:46 oc2 zmfilter_9[2033]: INF [Creating notification email]
Jul 16 12:43:46 oc2 zmfilter_9[2033]: INF [Creating notification email]
Jul 16 12:43:46 oc2 zmfilter_9[2033]: INF [Creating notification email]
Jul 16 12:43:46 oc2 zmfilter_9[2033]: INF [Creating notification email]

But nothing ever gets sent to the smarthost

zm 1.31.44
ubuntu 16.04

Thanks

Re: Trouble shooting email notification

Posted: Mon Jul 16, 2018 6:21 pm
by bbolin
Fixed

Needed to install

apt install libnet-smtp-server-perl

Re: Trouble shooting email notification

Posted: Tue Jul 17, 2018 1:32 pm
by alabamatoy
bbolin wrote: Mon Jul 16, 2018 6:21 pm apt install libnet-smtp-server-perl
Not sure of what your machine is doing beyond ZM, but having a full-fledged SMTP host installed on it is fairly high risk if you do not know how to properly secure it. Something like ssmtp can be much safer since it has no functionality beyond sending messages, and can be used with gmail and other similar services as the actual SMTP host. Root and webmin and ZM and other services can easily leverage SSMTP for notifying you of what's going on.

Re: Trouble shooting email notification

Posted: Tue Jul 17, 2018 1:44 pm
by bbolin
ZM is just a security cam monitor running on my internal network. It forwards to a postfix smarthost(that connects to google TLS) for all my network email

Re: Trouble shooting email notification

Posted: Tue Jul 17, 2018 1:50 pm
by bbolin
I'm actually not sure I needed to install postfix at all on the ZM box. Would libnet-smtp-server-perl have taken care of this?

As long as I have the SMTP host defined in the ZM GUI?

Re: Trouble shooting email notification

Posted: Tue Jul 17, 2018 3:32 pm
by bbolin
Answer to my own question. Postfix or any other MTA is not needed for email notifications

Re: Trouble shooting email notification

Posted: Tue Jul 17, 2018 9:24 pm
by snake
The wiki has a guide on Email notification from scratch here:
https://wiki.zoneminder.com/How_to_get_ ... Zoneminder

I also wrote up troubleshooting tips in addition to that article here:
https://wiki.zoneminder.com/SMS_Notifications

Re: Trouble shooting email notification

Posted: Wed Jul 18, 2018 1:30 am
by rockedge
It sounds like you are missing the PERL modules that perform the email notification construction.
you only need to add the PERL modules MIME::Lite and Net::SMTP
I use cpanminus I install using cpan App::cpanminus

then

Code: Select all

cpanm MIME::Lite 
cpanm Net::SMTP
these are for the new mail method. install the MIME::Entity PERL module for the traditional ZM email function.

Or look for your distro's package manager to find these PERL mods as a package and install them that way.