diff roundup/mailgw.py @ 5240:86190260f077

Mailgw: Improves diagnostic messages for DEBUG. * Adds debug log messages for bounce mails to aid tracing of emails.
author Bernhard Reiter <bernhard@intevation.de>
date Wed, 10 May 2017 10:36:39 +0200
parents 6bbb6dd97458
children 198b6e810c67
line wrap: on
line diff
--- a/roundup/mailgw.py	Sat Apr 22 15:59:57 2017 -0400
+++ b/roundup/mailgw.py	Wed May 10 10:36:39 2017 +0200
@@ -1519,6 +1519,7 @@
             return self.handle_message(message)
         except MailUsageHelp:
             # bounce the message back to the sender with the usage message
+            self.logger.debug("MailUsageHelp raised, bouncing.")
             fulldoc = '\n'.join(string.split(__doc__, '\n')[2:])
             m = ['']
             m.append('\n\nMail Gateway Help\n=================')
@@ -1527,6 +1528,7 @@
                 subject="Mail Gateway Help")
         except MailUsageError, value:
             # bounce the message back to the sender with the usage message
+            self.logger.debug("MailUsageError raised, bouncing.")
             fulldoc = '\n'.join(string.split(__doc__, '\n')[2:])
             m = ['']
             m.append(str(value))
@@ -1538,6 +1540,7 @@
             self.mailer.bounce_message(message, [sendto[0][1]], m, crypt=crypt)
         except Unauthorized, value:
             # just inform the user that he is not authorized
+            self.logger.debug("Unauthorized raised, bouncing.")
             m = ['']
             m.append(str(value))
             if self.parsed_message:

Roundup Issue Tracker: http://roundup-tracker.org/