From f04a260dbc4642b6602f1b3f8ad1d1153702e9d7 Mon Sep 17 00:00:00 2001 From: Mathias Rav Date: Tue, 16 May 2017 22:03:06 -0400 Subject: [PATCH] Fixes for Python 2 --- emailtunnel/mailhole.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emailtunnel/mailhole.py b/emailtunnel/mailhole.py index 88b264b..3de5bb9 100644 --- a/emailtunnel/mailhole.py +++ b/emailtunnel/mailhole.py @@ -21,7 +21,7 @@ def should_mailhole(self, message, recipient, sender): def deliver_mailhole(self, message, recipients, sender, mailhole_key): with requests.Session() as session: message_bytes = re.sub(br'(\r\n|\n|\r)', b'\r\n', - message.as_bytes()) + message.as_binary()) for rcpt in recipients: data = dict( key=mailhole_key, @@ -62,7 +62,7 @@ def deliver(self, message, recipients, sender): if not requests: print("You must `pip install requests`!") if ordinary_rcpts: - super().deliver(message, ordinary_rcpts, sender) + super(MailholeRelayMixin, self).deliver(message, ordinary_rcpts, sender) assert re.match(MailholeRelayMixin.mailhole_pattern, 'test@hotmail.com')