diff options
Diffstat (limited to 'src/leap/bitmask/mail/testing')
-rw-r--r-- | src/leap/bitmask/mail/testing/smtp.py | 22 |
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 |