I too had this issue and through many many google searches I was able to find my solution and I wanted to include my major mistakes and how I ultimately resolve the issue.
Can't send email: error closing /usr/lib/sendmail: (exit 256)
: check your config based on this guide https://wiki.zoneminder.com/index.php/H ... Zoneminder
: DOUBLE CHECK the ssmtp.conf entries and the revaliases. (one of my issues was I had a stupid "." instead of a ":" for the www-data entry.)
: Try to isolate the issue outside of ZoneMinder I found a helpful suggestion on a different post
"Have you tested your config with below commands (from unix.stackexchange forum)?
First you need to create a mail.txt file with some text.
$ nano mail.txt
$ sudo -u root ssmtp -v email@example.com
$ sudo -u www-data ssmtp -v firstname.lastname@example.org
$ /usr/sbin/ssmtp -v email@example.com
If one of these fails, then you still have problems with permissions/owners... Check also the "mail" group, as you might want to add www-data to this group. " from user bobylapointe69300 viewtopic.php?t=25346
: Check your perl installations for MMIME::Lite and MNet::SMTP I glossed over this
Making sure you have MIME::Lite and Net::SMTP
So after getting various errors, I discovered Ubuntu Server did not install MIME::Lite with its default install.
It's good idea to install them if you don't have it. To check if you have them:
perl -MMIME::Lite -e "print \"Module installed.\\n\";"
perl -MNet::SMTP -e "print \"Module installed.\\n\";"
And to install:
sudo perl -MCPAN -e shell
: check the permissions of the ssmtp files "ssmtp.conf" "revaliases" to ensure www-data has read access to them.
tail -f /var/log/syslog is your friend. Use it and watch the output when you think your filter is firing off. I noticed at some point during my troubleshooting that my event was firing but it wasnt producing any results to email me about. Its a good way to see whats going on when your filters run and whats going wrong.
I know some of this is redundant but I wanted to consolidate all of it in one place.
Thanks to everyone for their support best of luck.