diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/bitmask/core/service.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/leap/bitmask/core/service.py b/src/leap/bitmask/core/service.py index 026e51d9..c3672843 100644 --- a/src/leap/bitmask/core/service.py +++ b/src/leap/bitmask/core/service.py @@ -46,7 +46,11 @@ except ImportError as exc: backend = flags.BACKEND if backend == 'default': - from leap.bitmask.core import mail_services + try: + from leap.bitmask.core import mail_services + HAS_MAIL = True + except ImportError: + HAS_MAIL = False from leap.bitmask.bonafide.service import BonafideService elif backend == 'dummy': from leap.bitmask.core.dummy import mail_services @@ -98,10 +102,10 @@ class BitmaskBackend(configurable.ConfigurableService): on_start(self.init_bonafide) on_start(self.init_sessions) - if self._enabled('mail'): + if HAS_MAIL and self._enabled('mail'): on_start(self._init_mail_services) - if self._enabled('vpn'): + if HAS_VPN and self._enabled('vpn'): on_start(self._init_vpn) if self._enabled('zmq'): |