From b71cf65a09d4e39ae85ff317e44e3d432f5b37db Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 13 Oct 2012 07:00:27 -0400 Subject: [PATCH] pg.py: add --continue-after-invalid-message (used to be hardcoded True). --- bin/pg.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/pg.py b/bin/pg.py index 27f7888..b8db60e 100755 --- a/bin/pg.py +++ b/bin/pg.py @@ -159,6 +159,11 @@ if __name__ == '__main__': default=False, action='store_const', const=True, help=('Send automatic response emails even if the target has not ' 'registered a PGP key.')) + mailpipe_parser.add_argument( + '-c', '--continue-after-invalid-message', + default=False, action='store_const', const=True, + help=('Send responses to invalid messages and continue processing ' + 'further emails (default is to die with an error message).')) todo_parser = subparsers.add_parser( 'todo', help=_todo.__doc__.splitlines()[0]) @@ -227,7 +232,8 @@ if __name__ == '__main__': else: kwargs[attr].extend(course.find_people(name=person)) for attr in ['dry_run', 'mailbox', 'output', 'input_', 'max_late', - 'old', 'statistics', 'trust_email_infrastructure']: + 'old', 'statistics', 'trust_email_infrastructure', + 'continue_after_invalid_message']: if hasattr(args, attr): kwargs[attr] = getattr(args, attr) elif args.func == _test_smtp: @@ -239,9 +245,6 @@ if __name__ == '__main__': if hasattr(args, attr): kwargs[attr] = getattr(args, attr) - if args.func == _mailpipe: - kwargs['continue_after_invalid_message'] = True - if 'use_color' in func_args: kwargs['use_color'] = args.color -- 2.26.2