File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/webapp/mail_handlers.py", line 70, in post
self.receive(mail.InboundEmailMessage(self.request.body))
最简单的解决方案是post
在您自己的处理程序中覆盖该方法以捕获错误:
import logging
from google.appengine.ext.webapp.mail_handlers import InboundMailHandler
class MyInboundMailHandler(InboundMailHandler):
def post(self):
try:
super(MyInboundMailHandler, self).post()
except LookupError as ex:
logging.warning('Could not process message because %s.', ex)
def receive(self, mail_message):
# Process message