allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#7073] add general error handling to smtp_server's message handling
Date Wed, 22 Jan 2014 15:57:23 GMT
Updated Branches:
  refs/heads/db/7073 [created] 84244a50a


[#7073] add general error handling to smtp_server's message handling

Overriding asyncore's log_info (used by handle_error) might work, or
overriding synchat's handle_read with error trapping might be better
since it'd be at a higher level, but those would require extra work
since it seems it'd have to be done on smtpd.SMTPChannel not
smtpd.SMTPServer


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/84244a50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/84244a50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/84244a50

Branch: refs/heads/db/7073
Commit: 84244a50ae827918897a836b5b63879e026bdd99
Parents: 1a9552e
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Jan 22 15:53:45 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Jan 22 15:53:45 2014 +0000

----------------------------------------------------------------------
 Allura/allura/command/smtp_server.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/84244a50/Allura/allura/command/smtp_server.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/smtp_server.py b/Allura/allura/command/smtp_server.py
index b113072..a055d8a 100644
--- a/Allura/allura/command/smtp_server.py
+++ b/Allura/allura/command/smtp_server.py
@@ -50,8 +50,11 @@ class SMTPServerCommand(base.Command):
 class MailServer(smtpd.SMTPServer):
 
     def process_message(self, peer, mailfrom, rcpttos, data):
-        base.log.info('Msg Received from %s for %s', mailfrom, rcpttos)
-        base.log.info(' (%d bytes)', len(data))
-        allura.tasks.mail_tasks.route_email.post(
-            peer=peer, mailfrom=mailfrom, rcpttos=rcpttos, data=data)
-        base.log.info('Msg passed along')
+        try:
+            base.log.info('Msg Received from %s for %s', mailfrom, rcpttos)
+            base.log.info(' (%d bytes)', len(data))
+            allura.tasks.mail_tasks.route_email.post(
+                peer=peer, mailfrom=mailfrom, rcpttos=rcpttos, data=data)
+            base.log.info('Msg passed along')
+        except Exception:
+            base.log.exception('Error handling msg')


Mime
View raw message