Zoneminder option to send an email?

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
ski007
Posts: 6
Joined: Tue Jun 25, 2019 6:49 pm

Zoneminder option to send an email?

Post by ski007 »

I have a question for more experienced with the Zoneninder program.
I do not know why despite sending emails correctly from the command line
Unfortunately, the sending of e-mails does not work with the program itself.
Sorry for my English. :oops:

Code: Select all

echo "Hello, World" | mail -s "My email check" user@linux.pl
echo "Subject: sendmail test" | sendmail -v XXX@linux.pl
both methods work.
However, when checking the logs, nothing happens?

Code: Select all

tail -f /var/log/syslog
I must mention that the program itself is installed on the ARM Odreoid HC1 platform. A webcam is under USB / uvc drivers
If it is not a program error or its version under ARM, it is probably the fault of my poor knowledge of Zoneminder :?
my choice in email options:
Image
Image
I installed Zoneminder using a script method :
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

Code: Select all

#!/bin/sh
clear
read -p "This script installs Apache2, Mariadb Server, PHP and Zoneminder 1.32.x on Ubuntu 18.04 ...
Press Enter to continue or Ctrl + c to quit" nothing
clear
read -p "You must be logged in as root using sudo su ...
Press Enter to continue or Ctrl + c to quit" nothing
apt install -y apache2 php mariadb-server php-mysql libapache2-mod-php7.2
clear
read -p "Next secure MySQL server by entering requested information. Press enter to continue" nothing
mysql_secure_installation
clear
read -p "Next we will add the PPA repository, install and configure the system to run Zoneminder. 
Press enter to continue" nothing
apt install -y software-properties-common
clear
add-apt-repository ppa:iconnor/zoneminder-1.32
apt update
clear
awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.2/apache2/php.ini
clear
apt install -y zoneminder
systemctl enable zoneminder
service zoneminder start
adduser www-data video
a2enconf zoneminder
a2enmod rewrite
chown -R www-data:www-data /usr/share/zoneminder/
service apache2 reload
clear
read -p "Install complete.Press enter to continue" nothing
clear
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Zoneminder option to send an email?

Post by kitkat »

Is SSMTP installed?

Can you use it successfully from the command line?
ski007
Posts: 6
Joined: Tue Jun 25, 2019 6:49 pm

Re: Zoneminder option to send an email?

Post by ski007 »

Yes ssmtp is installed according to howto:

Code: Select all

sudo apt-get update
apt-get install ssmtp
apt-get install mailutils
my ssmtp.conf:

Code: Select all

root=XXX@linux.pl

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=mail.linux.pl:587

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=Odroid-HC1

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES
RewriteDomain=linux.pl
UseSTARTTLS=YES
UseTLS=YES
AuthUser=XXX@linux.pl
AuthPass=my_password
my config /etc/ssmtp/revaliases :

Code: Select all

root:xxx@linux.pl:mail.linux.pl:587
www-data:xxx@linux.pl:mail.linux.pl:587
check sending from the command line works OK
echo "Hello, World" | mail -s "My email check" xxx@gmail.com
You probably also need to set the filter option
but how to set up an email filter for motion detection
ski007
Posts: 6
Joined: Tue Jun 25, 2019 6:49 pm

Re: Zoneminder option to send an email?

Post by ski007 »

OK ....I fixed it with this entry in the command line

Code: Select all

chmod 777 /etc/ssmtp /etc/ssmtp/*
and for sending an email when motion is detected on the camera, a Filter must be created in the options :shock:
the matter is not intuitive :cry:
regards
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Zoneminder option to send an email?

Post by snake »

Guides for email configuration are on the wiki:
https://wiki.zoneminder.com/How_to_get_ ... Zoneminder
https://wiki.zoneminder.com/SMS_Notifications

Filters are fundamental to ZM. They are used for scheduling everything. Heads up, you'll also need to make sure purgewhenfull filter points to the proper storage area if you use a secondary storage in 1.32.
vskatusa
Posts: 33
Joined: Sat Jan 02, 2016 4:02 pm

Re: Zoneminder option to send an email?

Post by vskatusa »

I know this is an old post. I had the same problem. I "enabled less secure app ON" using url https://myaccount.google.com/lesssecureapps?pli=1
https://pasteboard.co/J8eDkRg.png
hth
Post Reply