From 7627c1faabce8398845d0687338cc8e052fcd0dc Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sun, 28 Dec 2014 01:31:08 +0100 Subject: Switch news2mail to pure email.Message based system. Fixes #10 Fixes #3 --- pygn2m | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'pygn2m') diff --git a/pygn2m b/pygn2m index 4acd2f2..ffe0573 100755 --- a/pygn2m +++ b/pygn2m @@ -100,17 +100,16 @@ try: # reads stdin and parses article separating head from body n2m.readfile() -# n2m.parsearticle() """phase 2: check whitelist for user's permission """ # make a first check of From: address - owner = wl.checkfrom(n2m.nntpheads['From']) + owner = wl.checkfrom(n2m.message['From']) if owner is None: if sys.stdin.isatty() == 1 or args.test: - print ('"%s" is not in whitelist!' % (n2m.nntpheads['From'][:-1])) + print ('"%s" is not in whitelist!' % (n2m.message['From'][:-1])) else: wl.logmsg(n2m.nntpheads, wl.DENY) @@ -123,8 +122,6 @@ try: format rfc 822 headers from input article """ - n2m.mergeheads() # make unique dict from NNTP and SMTP dicts - n2m.addheads() # add some important heads n2m.renameheads() # rename useless heads n2m.removeheads() # remove other heads @@ -133,8 +130,7 @@ try: # prints formatted email message only (without send) if user wants if args.verbose: - for line in n2m.headers: - print(line) + print(n2m.message.as_string()) if owner is None: sys.exit(1) -- cgit