From 855e96cefe975e50d140e6c8aa7d3407931b25d7 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 1 Oct 2014 16:19:58 -0300 Subject: Quit Bitmask if there is no polkit agent running. Closes #6150. --- src/leap/bitmask/services/mail/conductor.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/leap/bitmask/services') 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: -- cgit v1.2.3