diff --git a/tailbone/templates/emailbounces/crud.mako b/tailbone/templates/emailbounces/crud.mako index 666c28d9..4433fbb0 100644 --- a/tailbone/templates/emailbounces/crud.mako +++ b/tailbone/templates/emailbounces/crud.mako @@ -11,4 +11,41 @@ % endif %def> +<%def name="head_tags()"> + ${parent.head_tags()} + + +%def> + ${parent.body()} + +
+${message} +diff --git a/tailbone/views/bouncer.py b/tailbone/views/bouncer.py index 1eb743ab..d5a1c684 100644 --- a/tailbone/views/bouncer.py +++ b/tailbone/views/bouncer.py @@ -158,19 +158,25 @@ class EmailBounceCrud(CrudView): fs.config_key.label("Source"), fs.message, fs.bounced, - fs.intended_recipient_address.label("Intended For"), fs.bounce_recipient_address.label("Bounced To"), + fs.intended_recipient_address.label("Intended For"), fs.links, fs.processed, fs.processed_by, ], readonly=True) + if not bounce.processed: + del fs.processed + del fs.processed_by return fs def template_kwargs(self, form): kwargs = super(EmailBounceCrud, self).template_kwargs(form) bounce = form.fieldset.model - kwargs['handler'] = self.get_handler(bounce) + handler = self.get_handler(bounce) + kwargs['handler'] = handler + with open(handler.msgpath(bounce), 'rb') as f: + kwargs['message'] = f.read() return kwargs def process(self):