class_docstr: This hook connects to a mail server by using the imap protocol.
  
  .. note:: Please call this Hook as context manager via `with`
      to automatically open and close the connection to the mail server.
  
  :param imap_conn_id: The :ref:`imap connection id <howto/connection:imap>`
      that contains the information used to authenticate the client.
code: def __init__(
      self, imap_conn_id: str = default_conn_name, **kwargs
  ) -> None:
      super().__init__(**kwargs)
      self.imap_conn_id = imap_conn_id
      self.mail_client: imaplib.IMAP4_SSL | imaplib.IMAP4 | None = None
  
imports: from __future__ import annotations
  import email
  import imaplib
  import os
  import re
  import ssl
  from typing import TYPE_CHECKING, Any, Iterable
  from airflow.exceptions import AirflowException
  from airflow.hooks.base import BaseHook
  from airflow.utils.log.logging_mixin import LoggingMixin
label_desc: Use image node_id 1 to create a new ImapHook object from inherited base classes: BaseHook with example: obj = ImapHook(imap_conn_id)