Store copy of msg file just for bouncer, when using

This commit is contained in:
Lance Edgar 2021-12-22 17:54:22 -06:00
parent 4c19bc4118
commit 1910128473

View file

@ -115,7 +115,8 @@ class BounceHandler(object):
to be a bounce etc. to be a bounce etc.
""" """
with open(path, 'rt') as f: with open(path, 'rt') as f:
msg = message_from_string(f.read()) text = f.read()
msg = message_from_string(text)
warnings, failures = self.get_all_failures(msg) warnings, failures = self.get_all_failures(msg)
if failures: if failures:
@ -123,6 +124,7 @@ class BounceHandler(object):
bounce = self.make_bounce(msg, failures) bounce = self.make_bounce(msg, failures)
session.add(bounce) session.add(bounce)
session.flush() session.flush()
self.store_message_file(bounce, text)
self.process_bounce(bounce) self.process_bounce(bounce)
elif warnings: elif warnings: