Skip to content

Commit

Permalink
Fix testing of email notification with multiple recipients.
Browse files Browse the repository at this point in the history
  • Loading branch information
donlorenzo committed Aug 8, 2024
1 parent b2388f1 commit 99a70ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion motioneye/handlers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import json
import logging
import os
import re
import socket

from tornado.ioloop import IOLoop
Expand Down Expand Up @@ -676,6 +677,9 @@ async def test(self, camera_id):
message = message % format_dict
subject = subject % format_dict

to = [t.strip() for t in re.split('[,;| ]', data['addresses'])]
to = [t for t in to if t]

old_timeout = settings.SMTP_TIMEOUT
settings.SMTP_TIMEOUT = 10
sendmail.send_mail(
Expand All @@ -685,7 +689,7 @@ async def test(self, camera_id):
data['smtp_password'],
data['smtp_tls'],
data['from'],
[data['addresses']],
to,
subject=subject,
message=message,
files=[],
Expand Down

0 comments on commit 99a70ab

Please sign in to comment.