Longer and longer delays sending Event emails

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
GeorgeDuckett
Posts: 8
Joined: Thu Feb 13, 2020 8:05 am

Longer and longer delays sending Event emails

Post by GeorgeDuckett »

When I clear all events I'll consistently get event emails 1-2 minutes after the event. Then, gradually there will be more and more of a delay. After about a week the delay between the time the event happened and the email being sent is around 20-25 minutes.
My log fills up with "Unable to send email: error closing /usr/sbin/sendmail: Broken pipe (exit -1)" when there's this long delay. Those messages start appearing after a couple of days, depending on frequency of events.

I'm on Raspbian (Buster) on a Pi4 (4GB) on ZM 1.34.0 (I'm waiting for the latest to be available in the repo to upgrade). I'm quite new to Linux, but have read through countless articles about troubleshooting ZM emails and can't find anything wrong. It seems odd to me that emails would initially work with no error, but then give many error messages (one every 1-2 mins) about sending the email, but still manage to eventually send it.

If anyone could point me in a direction for things to try I'd appreciate any help as I'm a bit stuck at this point.
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Longer and longer delays sending Event emails

Post by iconnor »

There should be 1.34.6 packages available for buster on pi.

As to the delayed filter emailing... I can't imagine why that would be. We would have to get some zmfilter debug logs.
GeorgeDuckett
Posts: 8
Joined: Thu Feb 13, 2020 8:05 am

Re: Longer and longer delays sending Event emails

Post by GeorgeDuckett »

Re log files:

25/03/20 11:50:43.638730 zmfilter_3[1108].INF [main:180] [Scanning for events using filter id '3']
25/03/20 11:50:43.716604 zmfilter_3[1108].INF [main:804] [Creating notification email]
25/03/20 11:50:43.885887 zmfilter_3[1108].INF [main:812] [Sending notification email 'ZM: Alarm at 2020-03-14 11:10:57 for 358.19s']
25/03/20 11:50:44.263762 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-14/2514/00076-capture.jpg']
25/03/20 11:50:44.270255 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-14/2514/01346-capture.jpg']
25/03/20 11:50:44.273463 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-14/2514/2514-video.mp4']
25/03/20 11:51:51.412753 zmfilter_3[1108].ERR [main:879] [Unable to send email: error closing /usr/sbin/sendmail: (exit 17664)]
25/03/20 11:51:51.419797 zmfilter_3[1108].INF [main:804] [Creating notification email]
25/03/20 11:51:51.457361 zmfilter_3[1108].INF [main:812] [Sending notification email 'ZM: Alarm at 2020-03-15 03:23:49 for 415.23s']
25/03/20 11:51:51.468572 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-15/2527/00076-capture.jpg']
25/03/20 11:51:51.473000 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-15/2527/00857-capture.jpg']
25/03/20 11:51:51.478175 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-15/2527/2527-video.mp4']
25/03/20 11:52:43.135872 zmfilter_3[1108].ERR [main:879] [Unable to send email: error closing /usr/sbin/sendmail: (exit 17664)]
25/03/20 11:52:43.143179 zmfilter_3[1108].INF [main:804] [Creating notification email]
25/03/20 11:52:43.200273 zmfilter_3[1108].INF [main:812] [Sending notification email 'ZM: Alarm at 2020-03-15 10:38:11 for 407.59s']
25/03/20 11:52:43.206428 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-15/2536/00076-capture.jpg']
25/03/20 11:52:43.211893 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-15/2536/01464-capture.jpg']
25/03/20 11:52:43.215217 zmfilter_3[1108].INF [main:830] [Attaching '/var/cache/zoneminder/events/1/2020-03-15/2536/2536-video.mp4']

My theory is that these files are too big for Gmail (which I'm sending from and to). The files are approx 45MB and the limit on Gmail is 25MB. I guess it's continually trying to send these emails, failing because Gmail cuts it off when too much data is sent. As a consequence it's not marking it as sent (as it wasn't sent) and trying again next time.

So, can I do anything to only attach the file if it's under a specified size? If not, for now can I filter out large files from the email filter?
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Longer and longer delays sending Event emails

Post by iconnor »

Yeah most of the world has a limit 10 10MB.

So I'm going to suggest that you NOT attach the mp4 to the email. Why not just put a link to the event in the email so you can click on it.
There is a DiskSpace filter option... it applies to all event files though, not just the mp4.

I should probably add a warning to zmfilter to make this more clear.
GeorgeDuckett
Posts: 8
Joined: Thu Feb 13, 2020 8:05 am

Re: Longer and longer delays sending Event emails

Post by GeorgeDuckett »

For now I'll leave off the attachment. Emailing it is a nice easy zero-config method of viewing the events externally, and archiving them off site. It would be nice if there was a way of attaching them if they were below a certain size, otherwise inserting a link. Like you say, a more specific warning/error would be good too.

Thanks a lot for the help.
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Longer and longer delays sending Event emails

Post by iconnor »

It occurs to me now, it might be an interesting/useful change to limit the length of an event by size... instead of time or frames. Will have to think about that.
Post Reply