From: W. Trevor King Date: Sun, 2 Sep 2012 14:22:26 +0000 (-0400) Subject: mailpipe: respond with the fleshed out message, not the original. X-Git-Tag: v0.3~21 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7823737b1ee074a358175501de23d1466886d323;p=pygrader.git mailpipe: respond with the fleshed out message, not the original. We've just added an author, targets, subject, etc. None of that matters if you send the original version. Also print check that the subject is not None before we remove any subject fields. This shouldn't matter (del-ing a None subject should be a no-op), but it seems safer to print the offending message before messing with it. --- diff --git a/pygrader/mailpipe.py b/pygrader/mailpipe.py index 1cd3f90..fa01d98 100644 --- a/pygrader/mailpipe.py +++ b/pygrader/mailpipe.py @@ -625,12 +625,12 @@ def mailpipe(basedir, course, stream=None, mailbox=None, input_=None, del msg['content-transfer-encoding'] msg.set_payload(new_payload, new_encoding) subject = msg['Subject'] - del msg['Subject'] assert subject is not None, msg + del msg['Subject'] msg = _construct_email( author=author, targets=[person], subject=subject, message=msg) - respond(response.message) + respond(msg) def _load_messages(course, stream, mailbox=None, input_=None, output=None,