Skip to contentSkip to conversation

emailhandler: actually send messages to cc_list as well

PATCH New Alexander Kanavin 1 participant 2 messages Jun 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 emailhandler: actually send messages to cc_list as well

---
 modules/utils/emailhandler.py | 2 ++
 1 file changed, 2 insertions(+)
modules/utils/emailhandler.py +2 -0
index 066f013..8c8b85b 100644
@@ -103,6 +103,8 @@ class Email(object):
         try:
             smtp = SMTP(self.smtp_host, self.smtp_port)
             smtp.sendmail(self.from_addr, to_addr, msg_text)
+            if cc_addr is not None:
+                smtp.sendmail(self.from_addr, cc_addr, msg_text)
             smtp.close()
         except Exception as e:
             E("Could not send email: %s" % str(e))
Signature · 1 line
2.27.0
#1 lore raw

PATCH 2/2 upgradehelper: use a separate setting for CCing recipe upgrades

Previously it was same as status update recipients.

---
 upgrade-helper.conf | 3 +++
 upgradehelper.py    | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
upgrade-helper.conf +3 -0
index 98ef58f..e926300 100644
@@ -31,6 +31,9 @@
 # except when recipes are owned by specific maintainer_override entries above.
 #[email protected]
 
+# who should be CCd with all upgrade emails (optional)
+#[email protected]
+
 # who should get the status mail with statistics, at the end (optional)
 #[email protected]
 
upgradehelper.py +2 -2
index 061d18d..c2480f1 100755
@@ -321,8 +321,8 @@ class Updater(object):
             to_addr = pkg_ctx['MAINTAINER']
 
         cc_addr = None
-        if "status_recipients" in settings:
-            cc_addr = settings["status_recipients"].split()
+        if "cc_recipients" in settings:
+            cc_addr = settings["cc_recipients"].split()
 
         newversion = pkg_ctx['NPV'] if not pkg_ctx['NPV'].endswith("new-commits-available") else pkg_ctx['NSRCREV']
         subject = "[AUH] " + pkg_ctx['PN'] + ": upgrading to " + newversion
Signature · 1 line
2.27.0