Skip to content

Commit 99a70ab

Browse files
committed
Fix testing of email notification with multiple recipients.
1 parent b2388f1 commit 99a70ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

motioneye/handlers/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import json
2020
import logging
2121
import os
22+
import re
2223
import socket
2324

2425
from tornado.ioloop import IOLoop
@@ -676,6 +677,9 @@ async def test(self, camera_id):
676677
message = message % format_dict
677678
subject = subject % format_dict
678679

680+
to = [t.strip() for t in re.split('[,;| ]', data['addresses'])]
681+
to = [t for t in to if t]
682+
679683
old_timeout = settings.SMTP_TIMEOUT
680684
settings.SMTP_TIMEOUT = 10
681685
sendmail.send_mail(
@@ -685,7 +689,7 @@ async def test(self, camera_id):
685689
data['smtp_password'],
686690
data['smtp_tls'],
687691
data['from'],
688-
[data['addresses']],
692+
to,
689693
subject=subject,
690694
message=message,
691695
files=[],

0 commit comments

Comments
 (0)