[rtems-source-builder commit] sb: Make a to_addr comma list a Python list for sending.
Chris Johns
chrisj at rtems.org
Tue Oct 31 00:57:38 UTC 2017
Module: rtems-source-builder
Branch: master
Commit: 4e7fdaf15de5ff822042a3532b2c5d13bd23b47d
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=4e7fdaf15de5ff822042a3532b2c5d13bd23b47d
Author: Chris Johns <chrisj at rtems.org>
Date: Tue Oct 31 11:56:23 2017 +1100
sb: Make a to_addr comma list a Python list for sending.
---
source-builder/sb/mailer.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/source-builder/sb/mailer.py b/source-builder/sb/mailer.py
index b9ef812..42b4fa6 100644
--- a/source-builder/sb/mailer.py
+++ b/source-builder/sb/mailer.py
@@ -92,9 +92,13 @@ class mail:
from_addr = self.from_address()
msg = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % \
(from_addr, to_addr, subject) + body
+ if type(to_addr) is str:
+ to_addr = to_addr.split(',')
+ if type(to_addr) is not list:
+ raise error.general('invalid to_addr type')
try:
s = smtplib.SMTP(self.smtp_host())
- s.sendmail(from_addr, [to_addr], msg)
+ s.sendmail(from_addr, to_addr, msg)
except smtplib.SMTPException as se:
raise error.general('sending mail: %s' % (str(se)))
except socket.error as se:
More information about the vc
mailing list