code: def _digest_md5_authentication(self, login, password, authz_id=""):
          
          code, data, challenge = \
              self.__send_command("AUTHENTICATE", [b"DIGEST-MD5"],
                                  withcontent=True, nblines=1)
          dmd5 = DigestMD5(challenge, "sieve/%s" % self.srvaddr)
  
          code, data, challenge = self.__send_command(
              '"%s"' % dmd5.response(login, password, authz_id),
              withcontent=True, nblines=1
          )
          if not challenge:
              return False
          if not dmd5.check_last_challenge(login, password, challenge):
              self.errmsg = "Bad challenge received from server"
              return False
          code, data = self.__send_command('""')
          if code == "OK":
              return True
          return False
docs: SASL DIGEST-MD5 authentication
  
          :param login: username
          :param password: clear password
          :return: True on success, False otherwise.