(user, auth_string)
Authenticates to IMAP with the given auth_string.

  Prints a debug trace of the attempted IMAP connection.

  Args:
    user: The Gmail username (full email address)
    auth_string: A valid OAuth2 string, as returned by GenerateOAuth2String.
        Must not be base64-encoded, since imaplib does its own base64-encoding.
Authenticates to IMAP with the given auth_string.
Authenticates to IMAP with the given auth_string .
def TestImapAuthentication(user, auth_string):
  """Authenticates to IMAP with the given auth_string.

  Prints a debug trace of the attempted IMAP connection.

  Args:
    user: The Gmail username (full email address)
    auth_string: A valid OAuth2 string, as returned by GenerateOAuth2String.
        Must not be base64-encoded, since imaplib does its own base64-encoding.
  """
  print
  imap_conn = imaplib.IMAP4_SSL('imap.gmail.com')
  imap_conn.debug = 4
  imap_conn.authenticate('XOAUTH2', lambda x: auth_string)
  imap_conn.select('INBOX')
def TestImapAuthentication ( user , auth_string ) : print imap_conn = imaplib . IMAP4_SSL ( 'imap.gmail.com' ) imap_conn . debug = 4 imap_conn . authenticate ( 'XOAUTH2' , lambda x : auth_string ) imap_conn . select ( 'INBOX' )