+

MantisSMTPServer : send email alert to sender on error adding his new issue

Benjamin Renard [2012-04-20 15:55:10]
MantisSMTPServer : send email alert to sender on error adding his new issue
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 3126ccd..57195b9 100755
--- a/src/usr/share/mantis-smtp/MantisSMTPServer.py
+++ b/src/usr/share/mantis-smtp/MantisSMTPServer.py
@@ -133,6 +133,12 @@ class MantisSMTPServer(smtpd.SMTPServer):
 			return issue_id
 		else:
 			logging.error('Error during add issue')
+			self.alert_sender(
+				msg,
+				u"[Mantis] Error occured adding your issue '%s'" % msg.subject(),
+				u"An error occured adding your issue :\n\nSubject : %s\n--\n%s" % (issue_id,msg.subject(),msg.get_text())
+			)
+

 	def add_note_to_issue_from_msg(self,msg):
 		if self.ws is None:
ViewGit