summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/mail/conductor.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/services/mail/conductor.py')
-rw-r--r--src/leap/bitmask/services/mail/conductor.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/leap/bitmask/services/mail/conductor.py b/src/leap/bitmask/services/mail/conductor.py
index 416aff34..0fb9f4fa 100644
--- a/src/leap/bitmask/services/mail/conductor.py
+++ b/src/leap/bitmask/services/mail/conductor.py
@@ -207,6 +207,8 @@ class MailConductor(IMAPControl, SMTPControl):
IMAPControl.__init__(self)
SMTPControl.__init__(self)
+ self._mail_services_started = False
+
self._backend = backend
self._mail_machine = None
self._mail_connection = mail_connection.MailConnection()
@@ -264,10 +266,16 @@ class MailConductor(IMAPControl, SMTPControl):
self.start_smtp_service(download_if_needed=download_if_needed)
self.start_imap_service()
+ self._mail_services_started = True
+
def stop_mail_services(self):
"""
Stop the IMAP and SMTP services.
"""
+ if not self._mail_services_started:
+ logger.debug("Mail services not started.")
+ return
+
self.stop_imap_service()
self.stop_smtp_service()
if self._firewall is not None: