diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2014-10-01 16:19:58 -0300 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-12-18 11:53:12 -0400 |
commit | 855e96cefe975e50d140e6c8aa7d3407931b25d7 (patch) | |
tree | fd77e256fb259a618b69f6ffb3cabcd2c990eb98 /src/leap/bitmask/services/mail | |
parent | aff470b3efa671f6c04107f718d359054a739bdc (diff) |
Quit Bitmask if there is no polkit agent running.
Closes #6150.
Diffstat (limited to 'src/leap/bitmask/services/mail')
-rw-r--r-- | src/leap/bitmask/services/mail/conductor.py | 8 |
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: |