code: def imap_connect(self):
          
          self.mailbox = imaplib.IMAP4_SSL(self.imap_string, self.port)
          self.mailbox.login(self.uname, self.pwd)
          self.mailbox.select()
docs: Connect to the IMAP mailbox.