Page 1 of 2
[SOLVED] Email alerts are not delivered zm 1.24.2 problem
Posted: Wed Jun 15, 2011 3:40 pm
by juricac
Hello im beginner of zoneminder. it works beautifly except that it wont send me email notifications.
What ive done so far is in options ive filled necessary infos and checked NEW_MAIL_MODULES,
edited
in it ive edited the line so it looks like this:
Code: Select all
MIME::Lite->send( "smtp", ZM_EMAIL_HOST, Timeout=>60, AuthUser=>'myusername@site', AuthPass=>'mypassword' );
saved the file and restarted zoneminder
however once i get alam events captured i still dont get email alerts received from zoneminder.
then i did create a script to test MIME::Lite works alone from shell that way and it works perfectly.
then i also installed email smtp client because i read somwhere (correct me if im wrong) that if NEW_MAIL_MODULES remains unchecked zoneminder uses email commandline tool and gets necessary info from /etc/mail/mail.conf
then i unchecked NEW_MAIL_MODULES and restarted zm to see if old method works for me and still i didnt get email notifications.
Could you guys please point me in the right direction, im wondering what im missing.
Is it really necessary to have my own mail server installed and configured correctly in order to use zoneminder?
also if its neccessary which logfile should i paste for you to diagnose the problem?
thanks alot
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Wed Jun 15, 2011 9:30 pm
by PacoLM
Hi,
If I remember correctly, you have to change the line in two functions,do it and psot results.
PacoLM
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Wed Jun 15, 2011 10:42 pm
by juricac
hello ive corrected second line as you suggested and done zm stop and zm start afterwards and still no joy, would you please be kind and tell me which logs i must check and post to you to diagnose the problem? i setuped that zoneminder send email alerts from gmx account to gmail.
thanks alot
heres what i get from zmdc.log
Code: Select all
tail /var/log/zm/zmdc.log
06/16/11 00:30:37.321779 zmdc[12124].ERR ['zmtrack.pl -m 6' exited abnormally, exit status 255]
06/16/11 00:31:57.054452 zmdc[12124].INF [Starting pending process, zmtrack.pl -m 6]
06/16/11 00:31:57.056352 zmdc[12124].INF ['zmtrack.pl -m 6' starting at 11/06/16 00:31:57, pid = 12204]
06/16/11 00:31:57.319229 zmdc[12124].ERR ['zmtrack.pl -m 6' exited abnormally, exit status 255]
06/16/11 00:34:37.018528 zmdc[12124].INF [Starting pending process, zmtrack.pl -m 6]
06/16/11 00:34:37.020833 zmdc[12124].INF ['zmtrack.pl -m 6' starting at 11/06/16 00:34:37, pid = 12220]
06/16/11 00:34:37.291976 zmdc[12124].ERR ['zmtrack.pl -m 6' exited abnormally, exit status 255]
06/16/11 00:39:57.051779 zmdc[12124].INF [Starting pending process, zmtrack.pl -m 6]
06/16/11 00:39:57.053683 zmdc[12124].INF ['zmtrack.pl -m 6' starting at 11/06/16 00:39:57, pid = 12240]
06/16/11 00:39:57.313385 zmdc[12124].ERR ['zmtrack.pl -m 6' exited abnormally, exit status 255]
heres what gives zmfilter.log
Code: Select all
tail /var/log/zm/zmfilter.log
06/15/11 09:40:20.992218 zmfilter[1876].INF [Scanning for events]
06/15/11 10:56:21.533483 zmfilter[1876].INF [Scanning for events]
06/15/11 15:24:41.362492 zmfilter[9483].INF [Scanning for events]
06/15/11 15:44:43.423575 zmfilter[9610].INF [Scanning for events]
06/15/11 16:12:16.301384 zmfilter[9961].INF [Scanning for events]
06/15/11 16:14:51.892140 zmfilter[10067].INF [Scanning for events]
06/16/11 00:09:38.340569 zmfilter[11923].INF [Scanning for events]
06/16/11 00:10:02.297518 zmfilter[11975].INF [Scanning for events]
06/16/11 00:29:22.891551 zmfilter[12160].INF [Scanning for events]
06/16/11 00:58:00.318460 zmfilter[12378].INF [Scanning for events]
to recap two lines looks like this
Code: Select all
MIME::Lite->send( "smtp", ZM_EMAIL_HOST, Timeout=>60,
AuthUser=>'username@provider', AuthPass=>'password' );
$mail->send();
and
Code: Select all
MIME::Lite->send( "smtp", ZM_EMAIL_HOST, Timeout=>60, AuthUser=>'usename@provider', AuthPass=>'password' );
$mail->send();
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Thu Jun 16, 2011 7:23 am
by PacoLM
Hi,
Which mailer application are you using?. I had to install postfix and mailx as mailer to get it working. I have my zmfilter.pl file similar to yours. In the configuration of ZM:
I have the EMAIL_HOST set to 'localhost', and the NEW_MAIL_MODULES unchecked.
Hope it helps,
PacoLM
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Thu Jun 16, 2011 8:02 am
by juricac
Hello! by default sendmail is installer i have mailx installed.
Before i do anything i want to ask you some questions.
When you said you had to install posfix in order to get it working, that means that you setuped local mailer with smtp in order for zoneminder to send mail properly automatically?
Im wondering if you tried to use other smtp servers alone before installing posfix? and in EMAIL_HOST to use their smtp, if yes did it work? if not,
Are you able to do the test for me just to see if you can change smtp of other provider to see if it working for you aswell since you have posfix installed please it really triggers me.
Thanks alot for kind help
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sat Jun 18, 2011 11:31 am
by juricac
@pacolm - just quick question when you did postfix configuration did you do relayhost in /etc/postfix/main.cf like this:
Code: Select all
relayhost = [smtp.server.tld]
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/sasl-passwords
# smtp_sasl_mechanism_filter = digest-md5 # enable if your isp supports this
and then in zmfilter.pl authuser and password that i have to edit will correspond to relayhost thats specified in /etc/postfix/main.cf
or you done it different way?
thanks
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sun Jun 19, 2011 5:16 pm
by PacoLM
Hi,
I didn't modified the postfix configuration manually, just followed the steps in the 'dpkg-reconfigure postfix'. Here is my /etc/postfix/main.cf':
Code: Select all
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = guruplug-debian
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = guruplug-d.org, localhost, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
And here are the settings in the ZM mail config:
* OPT_EMAIL: checked
* EMAIL_ADDRESS: your email account
* MESSAGE_ADDRESS: your email account
* EMAIL_HOST: localhost
* FROM_EMAIL: any name you want (invented also works)
Hope it helps,
PacoLM
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Tue Jun 21, 2011 11:50 pm
by juricac
@pacolm thanks for kind response, i will check this in a couple of days and will post results
thanks for now!
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Thu Jun 23, 2011 5:17 am
by cordel
Just a question in case it was overlooked, I see no mention of setting up your filters....
Have you setup filters for conditions that ZM should email you?
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Thu Jun 23, 2011 12:30 pm
by PacoLM
Good catch boss!
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Thu Jun 23, 2011 2:23 pm
by juricac
hey guys!
i didnt create filters before!
in combination with mailx and postfix, ive managed zoneminder to send to gmail, and it works beautifly
however is there any documentation about zm statistics so i can experiment with filters? I would like for instance that zoneminder sends me a picture to gmail to describe the event.
how can i do that?
thanks all!
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Thu Jun 23, 2011 5:45 pm
by PacoLM
Hi,
Find attached my config. Here's a good explanation of the codes to attach information to the email:
http://www.zoneminder.com/wiki/index.ph ... ing_Events
Regards,
PacoLM
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sat Jun 25, 2011 2:17 pm
by juricac
@pacolm thanks bro it works beautifly. too bad that i havent checked the manual from top to the bottom
btw I just wonder, since i have foscam camera is there a way in zm to automatically schedule change of the camera mode (in camera mode i have 50hz, 60hz, outdoor to choose from)?
also how i can make my thread solved please? i dont see thread tools.
thanks alot once again!
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sun Jun 26, 2011 8:29 am
by PacoLM
Hi,
Congratulations. About changing the mode, search my posts, there's an append to the standard Foscam control script to allow the users change the mode (50,60, outdoors).
PacoLM
Re: Email alerts are not delivered zm 1.24.2 problem(solved)
Posted: Sun Jun 26, 2011 12:50 pm
by bb99
To add the word "solved" to the title simply edit your last post and add to the subject line.