diff options
Diffstat (limited to 'pygn2m')
-rwxr-xr-x | pygn2m | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -44,7 +44,7 @@ def parse_cmdline(): parser.add_argument('-T', '--test', help='test mode (not send article via SMTP)', action='store_true') - parser.add_argument('-V', '--verbose', help='verbose output', + parser.add_argument('-v', '--verbose', help='verbose output', action='store_true') opts = parser.parse_args() @@ -74,12 +74,12 @@ try: check and set pyg's internal variables """ - n2m = news2mail.news2mail() - owner = None - # it returns only test, other parms are set directly in the actual # parameter args = parse_cmdline() + + n2m = news2mail.news2mail(verbose=args.verbose) + owner = None # check if n2m has some file prefercences set on commandline if args.wlfile is None: @@ -96,9 +96,6 @@ try: wl = whitelist.whitelist(wl, log) - # reads stdin and parses article separating head from body - n2m.readfile() - """phase 2: check whitelist for user's permission """ @@ -137,12 +134,9 @@ try: open smtp connection and send e-mail """ - if len(n2m.headers) > 0: - wl.logmsg(n2m.heads_dict, wl.ACCEPT, owner) - if not args.test: - n2m.sendarticle() - else: - print('Error: No Headers!!!') + wl.logmsg(n2m.heads_dict, wl.ACCEPT, owner) + if not args.test: + n2m.sendarticle() except KeyboardInterrupt: print('Keyboard Interrupt') |