From f24e5e8283231c2027d1a4284592ff7ef982ead1 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 2 Sep 2012 09:33:57 -0400 Subject: [PATCH] pg.py|mailpipe: add --trust-email-infrastructure. --- bin/pg.py | 7 ++++++- pygrader/mailpipe.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/pg.py b/bin/pg.py index 6832dd3..da00e1f 100755 --- a/bin/pg.py +++ b/bin/pg.py @@ -142,6 +142,11 @@ if __name__ == '__main__': '-r', '--respond', default=False, action='store_const', const=True, help=('Send automatic response emails to acknowledge incoming ' 'messages.')) + mailpipe_parser.add_argument( + '-t', '--trust-email-infrastructure', + default=False, action='store_const', const=True, + help=('Send automatic response emails even if the target has not ' + 'registered a PGP key.')) todo_parser = subparsers.add_parser( 'todo', help=_todo.__doc__.splitlines()[0]) @@ -198,7 +203,7 @@ if __name__ == '__main__': else: kwargs[attr].extend(course.find_people(name=person)) for attr in ['dry_run', 'mailbox', 'output', 'input_', 'max_late', - 'old', 'statistics']: + 'old', 'statistics', 'trust_email_infrastructure']: if hasattr(args, attr): kwargs[attr] = getattr(args, attr) elif args.func == _test_smtp: diff --git a/pygrader/mailpipe.py b/pygrader/mailpipe.py index 6c832f0..f704cb3 100644 --- a/pygrader/mailpipe.py +++ b/pygrader/mailpipe.py @@ -89,6 +89,7 @@ class InvalidHandlerMessage (_InvalidSubjectMessage): def mailpipe(basedir, course, stream=None, mailbox=None, input_=None, output=None, continue_after_invalid_message=False, max_late=0, + trust_email_infrastructure=False, handlers={ 'get': _handle_get, 'submit': _handle_submission, @@ -561,7 +562,9 @@ def mailpipe(basedir, course, stream=None, mailbox=None, input_=None, handler( basedir=basedir, course=course, message=message, person=person, subject=subject, - max_late=max_late, dry_run=dry_run) + max_late=max_late, + trust_email_infrastructure=trust_email_infrastructure, + dry_run=dry_run) except _InvalidMessage as error: error.course = course error.message = original -- 2.26.2