title: ImapLib get gmail id mail(python)
body: <p>Sorry for my english. For example i have link like this</p>
  
  <pre><code>https://mail.google.com/mail/u/0/?source=sync&amp;tf=1&amp;view=pt&amp;th=1614fcf57d5cb6ec1&amp;search=all
  </code></pre>
  
  <p>where <code>1614fcf57d5cb6ec1</code> it uuid message. By this link i can view pdf mail. For work with mail i use imaplib. I try get this uuid gmail message like this:</p>
  
  <p><code>mail.get('Message-id')</code></p>
  
  <p>but it give me id like this: <code>3CB8978E-60DD-41B1-AA2E-0685219513F3@happyplugs.com</code> </p>
  
  <p>My question: Hav i can get id gmail message use imaplib?</p>
  
  <p>UPD:</p>
  
  <pre><code>IMAP_SERVER = 'imap.gmail.com'
  IMAP_PORT = '993'
  IMAP_USE_SSL = True
  
   def __init__(self):
          print("MailBox __init__")
          self.user = '123@gmail.com'
          self.password = '123'
          if IMAP_USE_SSL:
              self.imap = imaplib.IMAP4_SSL(IMAP_SERVER, IMAP_PORT)
          else:
              self.imap = imaplib.IMAP4(IMAP_SERVER, IMAP_PORT)
  
      def __enter__(self):
          print("MailBox __enter__")
          self.imap.login(self.user, self.password)
          return self
  
      def __exit__(self, exc_type, exc_val, exc_tb):
          self.imap.close()
          self.imap.logout()
  
  def get_google_id():
   self.imap.select('Inbox')
  status, response = self.imap.search(None, 'ALL')
  
          if status == 'OK':
              items = response[0].split()
              for email_id in reversed(items):
                  status, response = self.imap.fetch(email_id, "(RFC822)")
                  if status == 'OK':
                      email_body = response[0][1]
                      mail = email.message_from_bytes(email_body)
  
                      id_mess = mail.get('Message-id') //this give me not gmail mail id
  </code></pre>