pg.py: default to continue_after_invalid_message=True when calling mailpipe.
authorW. Trevor King <wking@tremily.us>
Sun, 2 Sep 2012 13:03:33 +0000 (09:03 -0400)
committerW. Trevor King <wking@tremily.us>
Sun, 2 Sep 2012 13:03:33 +0000 (09:03 -0400)
This lets us process a whole mailbox without dying on every invalid
message.  Consider an unfiltered, general-purpose mailbox with lots of
unrelated emails, which can be successfully parsed with
`continue_after_invalid_message`.

bin/pg.py

index 077b3e3a1257f4d06cdbf8302c9445754819b8da..edfe0164b62166b97fbbcb8d861d3f0e3ff8bf0a 100755 (executable)
--- a/bin/pg.py
+++ b/bin/pg.py
@@ -210,6 +210,9 @@ 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