diff options
Diffstat (limited to 'pygm2n')
-rwxr-xr-x | pygm2n | 26 |
1 files changed, 5 insertions, 21 deletions
@@ -15,17 +15,13 @@ Gets news article and sends it via SMTP. """ from __future__ import print_function -import sys -import nntplib -import logging -logging.basicConfig(level=logging.DEBUG) import argparse - +import logging import mail2news +import nntplib +import sys - -sys.path.append('/usr/lib/pyg') - +# logging.basicConfig(level=logging.DEBUG) def parse_cmdline(): parser = argparse.ArgumentParser( @@ -44,7 +40,6 @@ def parse_cmdline(): help='NNTP server password (for authentication)') parser.add_argument('-P', '--port', default='') parser.add_argument('-e', '--envellope', default='') - parser.add_argument('-w', '--wlfile') parser.add_argument('-l', '--logfile') parser.add_argument('-T', '--test', action='store_true', @@ -76,23 +71,12 @@ try: """ opt = parse_cmdline() - m2n = mail2news.mail2news(verbose=opt.verbose) + m2n = mail2news.mail2news(opt) owner = None - # reads stdin and parses article separating head from body - m2n.readfile(opt) - # m2n.parseemail() - - """phase 2: - check whitelist for user's permission - """ - """phase 3: format rfc 822 headers from input article """ - - m2n.message['X-Gateway'] = 'pyg {0} {1}'.format( - mail2news.VERSION, mail2news.DESC) m2n.renameheads() # rename useless heads m2n.removeheads() # remove other heads |