diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-01 00:12:28 -0400 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-01 00:52:34 -0400 |
commit | 662aed784218a45efbf563ff6150fcb9f1aa81aa (patch) | |
tree | 9ac2f47fb24f50d3ada1a4a4a0819d6ef909901e /src/leap/bitmask/mail/smtp | |
parent | 2a46b146135aa5694eb9de288c24037051268fdf (diff) |
[refactor] fix imports after merging submodules
Diffstat (limited to 'src/leap/bitmask/mail/smtp')
-rw-r--r-- | src/leap/bitmask/mail/smtp/README.rst | 2 | ||||
-rw-r--r-- | src/leap/bitmask/mail/smtp/__init__.py | 7 | ||||
-rw-r--r-- | src/leap/bitmask/mail/smtp/bounces.py | 4 | ||||
-rw-r--r-- | src/leap/bitmask/mail/smtp/gateway.py | 22 |
4 files changed, 15 insertions, 20 deletions
diff --git a/src/leap/bitmask/mail/smtp/README.rst b/src/leap/bitmask/mail/smtp/README.rst index 1d3a9038..ec2c8c48 100644 --- a/src/leap/bitmask/mail/smtp/README.rst +++ b/src/leap/bitmask/mail/smtp/README.rst @@ -41,4 +41,4 @@ Running tests Tests are run using Twisted's Trial API, like this:: - python setup.py test -s leap.mail.gateway.tests + python setup.py test -s leap.bitmask.mail.gateway.tests diff --git a/src/leap/bitmask/mail/smtp/__init__.py b/src/leap/bitmask/mail/smtp/__init__.py index 9fab70a7..5f7fe669 100644 --- a/src/leap/bitmask/mail/smtp/__init__.py +++ b/src/leap/bitmask/mail/smtp/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # __init__.py -# Copyright (C) 2013 LEAP +# Copyright (C) 2013-2016 LEAP # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. - """ SMTP gateway helper function. """ @@ -25,12 +24,10 @@ from twisted.internet import reactor from twisted.internet.error import CannotListenError from leap.common.events import emit_async, catalog - -from leap.mail.smtp.gateway import SMTPFactory +from leap.bitmask.mail.smtp.gateway import SMTPFactory logger = logging.getLogger(__name__) - SMTP_PORT = 2013 diff --git a/src/leap/bitmask/mail/smtp/bounces.py b/src/leap/bitmask/mail/smtp/bounces.py index 7a4674b9..8260c1b0 100644 --- a/src/leap/bitmask/mail/smtp/bounces.py +++ b/src/leap/bitmask/mail/smtp/bounces.py @@ -21,8 +21,8 @@ import time from email.message import Message from email.utils import formatdate -from leap.mail.constants import INBOX_NAME -from leap.mail.mail import Account +from leap.bitmask.mail.constants import INBOX_NAME +from leap.bitmask.mail.mail import Account # TODO implement localization for this template. diff --git a/src/leap/bitmask/mail/smtp/gateway.py b/src/leap/bitmask/mail/smtp/gateway.py index e49bbe82..16e1af97 100644 --- a/src/leap/bitmask/mail/smtp/gateway.py +++ b/src/leap/bitmask/mail/smtp/gateway.py @@ -29,6 +29,7 @@ The following classes comprise the SMTP gateway service: * EncryptedMessage - An implementation of twisted.mail.smtp.IMessage that knows how to encrypt/sign itself before sending. """ +from email import generator from email.Header import Header from zope.interface import implements @@ -42,20 +43,17 @@ from twisted.python import log from leap.common.check import leap_assert_type from leap.common.events import emit_async, catalog -from leap.mail import errors -from leap.mail.cred import LocalSoledadTokenChecker -from leap.mail.utils import validate_address -from leap.mail.rfc3156 import RFC3156CompliantGenerator -from leap.mail.outgoing.service import outgoingFactory -from leap.mail.smtp.bounces import bouncerFactory -from leap.keymanager.errors import KeyNotFound +from leap.bitmask.mail import errors +from leap.bitmask.mail.cred import LocalSoledadTokenChecker +from leap.bitmask.mail.utils import validate_address +from leap.bitmask.mail.rfc3156 import RFC3156CompliantGenerator +from leap.bitmask.mail.outgoing.service import outgoingFactory +from leap.bitmask.mail.smtp.bounces import bouncerFactory +from leap.bitmask.keymanager.errors import KeyNotFound # replace email generator with a RFC 3156 compliant one. -from email import generator - generator.Generator = RFC3156CompliantGenerator - LOCAL_FQDN = "bitmask.local" @@ -237,7 +235,7 @@ class SMTPDelivery(object): mail or not. :type encrypted_only: bool :param outgoing_mail: The outgoing mail to send the message - :type outgoing_mail: leap.mail.outgoing.service.OutgoingMail + :type outgoing_mail: leap.bitmask.mail.outgoing.service.OutgoingMail """ self._userid = userid self._outgoing_mail = outgoing_mail @@ -368,7 +366,7 @@ class EncryptedMessage(object): :param user: The recipient of this message. :type user: twisted.mail.smtp.User :param outgoing_mail: The outgoing mail to send the message - :type outgoing_mail: leap.mail.outgoing.service.OutgoingMail + :type outgoing_mail: leap.bitmask.mail.outgoing.service.OutgoingMail """ # assert params leap_assert_type(user, smtp.User) |