Page 1 of 1

Sending email from ZM

Posted: Sat Dec 14, 2019 3:58 pm
by Ryandor
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 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 "" are sanitized.
I am using a external hosting service for ""
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).

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:<> (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_HOST: localhost (my_server@localhost,
FROM_EMAIL: root@localhost (my_server@localhost,
SSMTP_MAIL: checked
SSMTP_PATH: /usr/sbin/ssmtp
Command-line tests:
$ echo "Hello, World" | mail -s "My email check" - works
$ sudo -u root ssmtp -v < mail.txt - works
$ sudo -u www-data ssmtp -v < mail.txt - works
$ /usr/sbin/ssmtp -v < mail.txt - works
# Config file for sSMTP sendmail
# sSMTP aliases
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.

Re: Sending email from ZM

Posted: Sun Dec 15, 2019 11:59 pm
by snake
Are you sure you should have both of these? You didn't spell the second correctly. I typically use STARTTLS OR TLS.


Make sure your route tables are right. If it works from command line it should work in ZM. I don't think email code has had any changes since 1.30.4 from what is obvious from the GUI.

Only one of the messages in the email pane works with ssmtp (see the wiki links for more details).

All the guides / troubleshooting is at

If you have to, you can put some debugging in the script to see what is different. It looks like your email service is giving you a 451 error, so perhaps try a different email provider or find out why they are giving that error.

Re: Sending email from ZM

Posted: Mon Dec 16, 2019 3:45 am
by Ryandor
Thank you for the reply. I corrected the typo and restarted everything. No change, same error. I'll reply back when I've tested with another email provider (but I really wanted this one to work).