diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2014-12-28 01:31:08 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2014-12-28 01:31:08 +0100 |
commit | 7627c1faabce8398845d0687338cc8e052fcd0dc (patch) | |
tree | fcb8bcb09f7a2351cef21b96754ee69e8f115265 /pygn2m | |
parent | 8e8a89e3dc6d6da2e9f230e316f4c3372013bb85 (diff) | |
download | pygn-7627c1faabce8398845d0687338cc8e052fcd0dc.tar.gz |
Switch news2mail to pure email.Message based system.
Fixes #10
Fixes #3
Diffstat (limited to 'pygn2m')
-rwxr-xr-x | pygn2m | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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) |