+

MantisSMTPServer : add method alert_sender()

Benjamin Renard [2012-04-20 15:54:20]
MantisSMTPServer : add method alert_sender()
Filename
src/usr/share/mantis-smtp/MantisSMTPServer.py
diff --git a/src/usr/share/mantis-smtp/MantisSMTPServer.py b/src/usr/share/mantis-smtp/MantisSMTPServer.py
index 1c2ca68..3126ccd 100755
--- a/src/usr/share/mantis-smtp/MantisSMTPServer.py
+++ b/src/usr/share/mantis-smtp/MantisSMTPServer.py
@@ -170,3 +170,14 @@ class MantisSMTPServer(smtpd.SMTPServer):
 				fd.close()
 			except Exception, e:
 				logging.error("Can't save message from %s to % receive from %s into %s : %s" % (mailfrom,rcpttos,peer,f,e))
+
+	def alert_sender(self,msg,subject,content):
+		logging.info('Warning send %s : %s' % (msg.mailfrom,subject))
+		MantisMail.send(
+			self._options['mail_from'],
+			msg.mailfrom,
+			subject,
+			content,
+			smtp_host=self._options['smtp_host'],
+			smtp_port=self._options['smtp_port']
+		)
ViewGit