Sending email from ZM

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
weilseik
Posts: 1
Joined: Thu Jan 30, 2020 3:36 pm

Sending email from ZM

Post by weilseik »

I've searched the forums (and google) and tried many things but still unable to get email notifications working correctly.
It appears to be a permissions error, and I've tried several things but can't get it resolved. Any assistance or pointers would be grateful. I'm hoping I missed something simple.

I've installed ZM from krogerfeedback scratch several times so far. Each time I am able to get almost everything working. But email notifications is not working for. Here's all the relevant info:

"my_server" and "my_email@my_domain.com" are sanitized.
I am using a external hosting service for "my_domain.com"
If there's any info missing/needed let me know.

Ubuntu 18.04 LTS
ZM v1.32.3 installed via "Easy Way: Ubuntu 18.04 (Bionic)" PPA
Of minor note: MySQL never asked for a root user/password during setup (nor on any previous test installs).

syslog:
Dec 13 09:57:40 my_server zmfilter_6[26557]: INF [Checking filter oldcam1_event archive, video, email returned 2 events ]
Dec 13 09:57:40 my_server zmfilter_6[26557]: INF [Archiving event 5931]
Dec 13 09:57:40 my_server zmfilter_6[26557]: INF [Creating notification email]
Dec 13 09:57:40 my_server zmfilter_6[26557]: INF [Sending notification email 'ZoneMinder: Alarm - oldcam1-5931 (45 - 31 61)']
Dec 13 09:57:40 my_server sSMTP[26627]: Creating SSL connection to host
Dec 13 09:57:40 my_server sSMTP[26627]: SSL connection using ECDHE_RSA_AES_256_GCM_SHA384
Dec 13 09:57:41 my_server sSMTP[26627]: RCPT TO:<my_email@my_domain.com> (451 Temporary local problem - please try later)
Dec 13 09:57:41 my_server zmfilter_6[26557]: ERR [Unable to send email: error closing /usr/lib/sendmail: (exit 256)]
====================
ZM > Options > Email (other options tried)
OPT_EMAIL: checked
EMAIL_ADDRESS: my_email@my_domain.com
NEW_MAIL_MODULES: checked
EMAIL_HOST: localhost (my_server@localhost, my_email@my_domain.com)
FROM_EMAIL: root@localhost (my_server@localhost, my_email@my_domain.com)
SSMTP_MAIL: checked
SSMTP_PATH: /usr/sbin/ssmtp
====================
Command-line tests:
$ echo "Hello, World" | mail -s "My email check" my_email@my_domain.com - works
$ sudo -u root ssmtp -v my_email@my_domain.com < mail.txt - works
$ sudo -u www-data ssmtp -v my_email@my_domain.com < mail.txt - works
$ /usr/sbin/ssmtp -v my_email@my_domain.com < mail.txt - works
====================
ssmtp.conf:
#
# Config file for sSMTP sendmail
#
root=my_email@my_domain.com
mailhub=mail.my_domain.com:465
AuthUser=my_email@my_domain.com
AuthPass=my_password
UseTLS=YES
UesSTART-YES
rewriteDomain=my_domain.com
hostname=my_server.my_domain.com
FromLineOverride=YES
====================
revaliases:
#
# sSMTP aliases
#
root:my_email@my_domain.com:mail.my_domain.com:465
www-data:my_email@my_domain.com:mail.my_domain.com:465
====================
MMIME::Lite installed
MNet::SMTP installed
====================
/etc/ssmtp# ls -la
total 16
drwxrwxrwx 2 root mail 4096 Dec 13 10:28 .
drwxr-xr-x 113 root root 4096 Dec 13 09:54 ..
-rw-r----- 1 root www-data 108 Dec 9 18:05 revaliases
-rw-r----- 1 root www-data 232 Dec 9 18:04 ssmtp.conf

====================
/usr/lib# ls -la
...
lrwxrwxrwx 1 root root 16 Apr 3 2018 sendmail -> ../sbin/sendmail
...
====================
/usr/sbin# ls -la
...
lrwxrwxrwx 1 root root 5 Apr 3 2018 sendmail -> ssmtp
...
-rwxr-xr-x 1 root mail 39000 Apr 3 2018 ssmtp
...
====================
Per some online help I previously found:
User mail is in groups mail and www-data
User www-data is in groups www-data and mail
====================

Thank you in advance for any help.
Last edited by weilseik on Sat Feb 01, 2020 9:50 am, edited 1 time in total.
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Sending email from ZM

Post by snake »

Everything I know is covered in https://wiki.zoneminder.com/Email

You can try adding DEBUG=yes to ssmtp.conf

As a sanity check, try a different email server, something that other people have used on the forums. 400 errors I think mean it's an error on the servers part. 500 errors mean it's a user error.

Alternatively, you could opt not to use ssmtp / NEW_MAIL_MODULES, and setup sendmail or an equivalent. I haven't done this, though, so I can't help there.
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Sending email from ZM

Post by snake »

Literally the same post as viewtopic.php?f=38&t=28841&p=112796

Is this advanced AI spam? Or maybe you just reposted. Did you ever try the other email service?
Post Reply