diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2014-12-28 01:00:36 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2014-12-28 01:04:31 +0100 |
commit | 8e8a89e3dc6d6da2e9f230e316f4c3372013bb85 (patch) | |
tree | 15c9dc3367154319340ee6e3e368fdfefdacd627 /pygm2n | |
parent | aac353539738870f9ec7f89f66cc2f44f93129cb (diff) | |
download | pyg-8e8a89e3dc6d6da2e9f230e316f4c3372013bb85.tar.gz |
Work directly on self.message in mail2news.
Diffstat (limited to 'pygm2n')
-rwxr-xr-x | pygm2n | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -95,9 +95,7 @@ try: format rfc 822 headers from input article """ - m2n.mergeheads() # make unique dict from NNTP and SMTP dicts - - m2n.heads_dict['X-Gateway'] = 'pyg {0} {1}'.format( + m2n.message['X-Gateway'] = 'pyg {0} {1}'.format( mail2news.VERSION, mail2news.DESC) m2n.renameheads() # rename useless heads m2n.removeheads() # remove other heads @@ -105,8 +103,7 @@ try: m2n.sortheads() # sort remaining heads :) if opt.verbose: - for line in m2n.headers: - print(line) + print(m2n.message.as_string()) """phase 4: open smtp connection and send e-mail @@ -117,8 +114,8 @@ try: if not opt.test: try: resp = m2n.sendemail() - except nntplib.NNTPError, message: - print(message) + except nntplib.NNTPError as ex: + print(ex) except KeyboardInterrupt: print('Keyboard Interrupt') |