Email-based exception handler
This commit is contained in:
@@ -8,7 +8,7 @@ from lxml.etree import parse as parse_xml
|
||||
from dmarcreceiver.model import DBSession, Report, ReportError, ReportRecord, OverrideReason, DKIMResult, SPFResult, metadata, init_model
|
||||
import transaction
|
||||
|
||||
from .util import sendmail
|
||||
from .util import sendmail, install_exception_handler
|
||||
from .config import config
|
||||
|
||||
def parse_metadata(tree):
|
||||
@@ -89,6 +89,10 @@ def receive_report(args):
|
||||
# read email message from stdin
|
||||
msg = message_from_file(sys.stdin)
|
||||
|
||||
# if not running on a tty, install email-based exception handler
|
||||
if not sys.stderr.isatty():
|
||||
install_exception_handler(msg)
|
||||
|
||||
# check for zip file
|
||||
content_type = msg['content-type']
|
||||
if content_type.find(';') != -1:
|
||||
|
||||
Reference in New Issue
Block a user