aboutsummaryrefslogtreecommitdiffstats
path: root/pygm2n
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2014-12-28 01:00:36 +0100
committerMatěj Cepl <mcepl@cepl.eu>2014-12-28 01:04:31 +0100
commit8e8a89e3dc6d6da2e9f230e316f4c3372013bb85 (patch)
tree15c9dc3367154319340ee6e3e368fdfefdacd627 /pygm2n
parentaac353539738870f9ec7f89f66cc2f44f93129cb (diff)
downloadpyg-8e8a89e3dc6d6da2e9f230e316f4c3372013bb85.tar.gz
Work directly on self.message in mail2news.
Diffstat (limited to 'pygm2n')
-rwxr-xr-xpygm2n11
1 files changed, 4 insertions, 7 deletions
diff --git a/pygm2n b/pygm2n
index 9c4e069..81561be 100755
--- a/pygm2n
+++ b/pygm2n
@@ -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')