def METHOD_NAME(self):
    host = self.account.get_config("configured_mail_server")
    port = int(self.account.get_config("configured_mail_port"))
    security = int(self.account.get_config("configured_mail_security"))
    user = self.account.get_config("addr")
    pw = self.account.get_config("mail_pw")
    if security == const.DC_SOCKET_PLAIN:
        ssl_context = None
    else:
        ssl_context = ssl.create_default_context()
        # don't check if certificate hostname doesn't match target hostname
        ssl_context.check_hostname = False
        # don't check if the certificate is trusted by a certificate authority
        ssl_context.verify_mode = ssl.CERT_NONE
    if security == const.DC_SOCKET_STARTTLS:
        self.conn = MailBoxTls(host, port, ssl_context=ssl_context)
    elif security == const.DC_SOCKET_PLAIN or security == const.DC_SOCKET_SSL:
        self.conn = MailBox(host, port, ssl_context=ssl_context)
    self.conn.login(user, pw)
    self.select_folder("INBOX")