summaryrefslogtreecommitdiff
path: root/src/leap/mail/outgoing/service.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-12-17 01:34:26 -0400
committerKali Kaneko <kali@leap.se>2015-12-21 09:44:19 -0400
commitf87b25c7b942f509372a14ed0ee7073f8f17e053 (patch)
treed03b27375c92f3c727db27bc558a49f13e10ec17 /src/leap/mail/outgoing/service.py
parentea41bb44afee34e8ad6baf917ba461a7e95bf70d (diff)
[tests] make tests use dummy authentication
Diffstat (limited to 'src/leap/mail/outgoing/service.py')
-rw-r--r--src/leap/mail/outgoing/service.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/leap/mail/outgoing/service.py b/src/leap/mail/outgoing/service.py
index 3e14fbd..8d7c0f8 100644
--- a/src/leap/mail/outgoing/service.py
+++ b/src/leap/mail/outgoing/service.py
@@ -73,16 +73,17 @@ class SSLContextFactory(ssl.ClientContextFactory):
return ctx
-def outgoingFactory(userid, keymanager, opts):
+def outgoingFactory(userid, keymanager, opts, check_cert=True):
cert = unicode(opts.cert)
key = unicode(opts.key)
hostname = str(opts.hostname)
port = opts.port
- if not os.path.isfile(cert):
- raise errors.ConfigurationError(
- 'No valid SMTP certificate could be found for %s!' % userid)
+ if check_cert:
+ if not os.path.isfile(cert):
+ raise errors.ConfigurationError(
+ 'No valid SMTP certificate could be found for %s!' % userid)
return OutgoingMail(str(userid), keymanager, cert, key, hostname, port)