summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/mail/testing
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-12-16 21:04:01 +0200
committerKali Kaneko <kali@leap.se>2017-12-22 20:03:30 +0100
commit90503627ef5047cd7e6e253266f0b25f2b1daa4d (patch)
treec4e5908db4d5e81e97a4d0f920af7ef44b5ab971 /src/leap/bitmask/mail/testing
parentf4a3c23be148a822352d484c263ead0e4fd2b907 (diff)
[refactor] Use sender interface in outgoing service
Diffstat (limited to 'src/leap/bitmask/mail/testing')
-rw-r--r--src/leap/bitmask/mail/testing/smtp.py22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/leap/bitmask/mail/testing/smtp.py b/src/leap/bitmask/mail/testing/smtp.py
index 834433f3..36628187 100644
--- a/src/leap/bitmask/mail/testing/smtp.py
+++ b/src/leap/bitmask/mail/testing/smtp.py
@@ -2,7 +2,6 @@ from twisted.mail import smtp
from leap.bitmask.mail.smtp.gateway import SMTPFactory, LOCAL_FQDN
from leap.bitmask.mail.smtp.gateway import SMTPDelivery
-from leap.bitmask.mail.outgoing.service import outgoingFactory
TEST_USER = u'anotheruser@leap.se'
@@ -11,21 +10,12 @@ class UnauthenticatedSMTPServer(smtp.SMTP):
encrypted_only = False
- def __init__(self, soledads, keyms, opts, encrypted_only=False):
+ def __init__(self, outgoing_s, soledad_s, encrypted_only=False):
smtp.SMTP.__init__(self)
userid = TEST_USER
- keym = keyms[userid]
-
- class Opts:
- cert = '/tmp/cert'
- key = '/tmp/cert'
- hostname = 'remote'
- port = 666
-
- outgoing = outgoingFactory(
- userid, keym, Opts, check_cert=False)
- avatar = SMTPDelivery(userid, keym, encrypted_only, outgoing)
+ outgoing = outgoing_s[userid]
+ avatar = SMTPDelivery(userid, encrypted_only, outgoing)
self.delivery = avatar
def validateFrom(self, helo, origin):
@@ -42,10 +32,8 @@ class UnauthenticatedSMTPFactory(SMTPFactory):
encrypted_only = False
-def getSMTPFactory(soledad_s, keymanager_s, sendmail_opts,
- encrypted_only=False):
+def getSMTPFactory(outgoing_s, soledad_s, encrypted_only=False):
factory = UnauthenticatedSMTPFactory
factory.encrypted_only = encrypted_only
- proto = factory(
- soledad_s, keymanager_s, sendmail_opts).buildProtocol(('127.0.0.1', 0))
+ proto = factory(outgoing_s, soledad_s).buildProtocol(('127.0.0.1', 0))
return proto