allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject git commit: [#7073] add general error handling to smtp_server's message handling
Date Thu, 23 Jan 2014 18:19:19 GMT
Updated Branches:
  refs/heads/master aca71c4e7 -> 10ce13ec6


[#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/10ce13ec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/10ce13ec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/10ce13ec

Branch: refs/heads/master
Commit: 10ce13ec65210f890c99d14e992b445d12880736
Parents: aca71c4
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Jan 22 15:53:45 2014 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu Jan 23 18:18:50 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/10ce13ec/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