summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2015-06-18 12:34:43 -0300
committerdrebs <drebs@leap.se>2015-06-18 13:55:52 -0300
commit692e6872eb4f13a2ef1bad9db3f2f669b7d9df72 (patch)
tree46bdb132e5d7967734d132d90274ba71206d7d8c
parentdb77e43fe78b0440ea568bc54b31894afe1d42a6 (diff)
[style] pep8 and unused imports cleanup
-rw-r--r--mail/src/leap/mail/outgoing/service.py9
-rw-r--r--mail/src/leap/mail/smtp/gateway.py5
-rw-r--r--mail/src/leap/mail/smtp/rfc3156.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/mail/src/leap/mail/outgoing/service.py b/mail/src/leap/mail/outgoing/service.py
index 60ba8f5..838a908 100644
--- a/mail/src/leap/mail/outgoing/service.py
+++ b/mail/src/leap/mail/outgoing/service.py
@@ -32,7 +32,6 @@ from twisted.python import log
from leap.common.check import leap_assert_type, leap_assert
from leap.common.events import emit, catalog
-from leap.keymanager import KeyManager
from leap.keymanager.openpgp import OpenPGPKey
from leap.keymanager.errors import KeyNotFound, KeyAddressMismatch
from leap.mail import __version__
@@ -169,8 +168,8 @@ class OutgoingMail:
# we don't pass an ssl context factory to the ESMTPSenderFactory
# because ssl will be handled by reactor.connectSSL() below.
factory = smtp.ESMTPSenderFactory(
- "", # username is blank because client auth is done on SSL protocol level
- "", # password is blank because client auth is done on SSL protocol level
+ "", # username is blank, no client auth here
+ "", # password is blank, no client auth here
self._from_address,
recipient.dest.addrstr,
StringIO(msg),
@@ -242,7 +241,7 @@ class OutgoingMail:
def signal_encrypt_sign(newmsg):
emit(catalog.SMTP_END_ENCRYPT_AND_SIGN,
- "%s,%s" % (self._from_address, to_address))
+ "%s,%s" % (self._from_address, to_address))
return newmsg, recipient
def if_key_not_found_send_unencrypted(failure, message):
@@ -261,7 +260,7 @@ class OutgoingMail:
log.msg("Will encrypt the message with %s and sign with %s."
% (to_address, from_address))
emit(catalog.SMTP_START_ENCRYPT_AND_SIGN,
- "%s,%s" % (self._from_address, to_address))
+ "%s,%s" % (self._from_address, to_address))
d = self._maybe_attach_key(origmsg, from_address, to_address)
d.addCallback(maybe_encrypt_and_sign)
return d
diff --git a/mail/src/leap/mail/smtp/gateway.py b/mail/src/leap/mail/smtp/gateway.py
index f6182a2..7dae907 100644
--- a/mail/src/leap/mail/smtp/gateway.py
+++ b/mail/src/leap/mail/smtp/gateway.py
@@ -111,7 +111,10 @@ class SMTPFactory(ServerFactory):
@return: The protocol.
@rtype: SMTPDelivery
"""
- smtpProtocol = SMTPHeloLocalhost(SMTPDelivery(self._userid, self._km, self._encrypted_only, self._outgoing_mail))
+ smtpProtocol = SMTPHeloLocalhost(
+ SMTPDelivery(
+ self._userid, self._km, self._encrypted_only,
+ self._outgoing_mail))
smtpProtocol.factory = self
return smtpProtocol
diff --git a/mail/src/leap/mail/smtp/rfc3156.py b/mail/src/leap/mail/smtp/rfc3156.py
index 62a0675..7d7bc0f 100644
--- a/mail/src/leap/mail/smtp/rfc3156.py
+++ b/mail/src/leap/mail/smtp/rfc3156.py
@@ -19,9 +19,7 @@
Implements RFC 3156: MIME Security with OpenPGP.
"""
-import re
import base64
-from abc import ABCMeta, abstractmethod
from StringIO import StringIO
from twisted.python import log