MantisSMTPServer : add method alert_sender()
Benjamin Renard

Benjamin Renard commited on 2012-04-20 15:54:20
Showing 1 changed files, with 11 additions and 0 deletions.

... ...
@@ -170,3 +170,14 @@ class MantisSMTPServer(smtpd.SMTPServer):
170 170
 				fd.close()
171 171
 			except Exception, e:
172 172
 				logging.error("Can't save message from %s to % receive from %s into %s : %s" % (mailfrom,rcpttos,peer,f,e))
173
+
174
+	def alert_sender(self,msg,subject,content):
175
+		logging.info('Warning send %s : %s' % (msg.mailfrom,subject))
176
+		MantisMail.send(
177
+			self._options['mail_from'],
178
+			msg.mailfrom,
179
+			subject,
180
+			content,
181
+			smtp_host=self._options['smtp_host'],
182
+			smtp_port=self._options['smtp_port']
183
+		)
173 184