def close(self): mbx = self.my_config.mailbox.values()[0] if mbx: pop3 = self.session.config.open_mailbox(self.session, FormatMbxId(mbx._key), prefer_local=False, from_cache=True) if pop3: pop3.close()