imaplib

Module imaplib |
[hide private]
[frames] | no frames]

# Module imaplib

source code

    IMAP4 client.

    Based on RFC 2060.

    Public class:           IMAP4
    Public variable:        Debug
    Public functions:       Internaldate2tuple
                            Int2AP
                            ParseFlags
                            Time2Internaldate

Version: 2.58

Classes | [hide private]
| IMAP4 IMAP4 client class.
| IMAP4_SSL IMAP4 client class over SSL connection Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile]]]]) host - host's name (default: localhost); port - port number (default: standard IMAP4 SSL port).
| IMAP4_stream IMAP4 client class over a stream Instantiate with: IMAP4_stream(command) where "command" is a string that can be passed to os.popen2() for more documentation see the docstring of the parent class IMAP4.
| _Authenticator Private class to provide en/decoding for base64-based authentication conversation.

Functions | [hide private]
Int2AP(num) Convert integer to A-P string representation. | source code
Internaldate2tuple(resp) Convert IMAP4 INTERNALDATE to UT. | source code
ParseFlags(resp) Convert IMAP4 flags response to python tuple. | source code
Time2Internaldate(date_time) Convert 'date_time' to IMAP4 INTERNALDATE representation. | source code

Variables | [hide private]
| AllowedVersions = ``(``'``IMAP4REV1``'``,` `'``IMAP4``'``)``
| CRLF = ``'``\r\n``'``
| Commands = ``{``'``APPEND``'``:` `(``'``AUTH``'``,` `'``SELECTED``'``)``,` `'``AUTHENTICATE``'``:` `(``'``...``
| Continuation = `re.compile(r'\+`(` `(?P<``data``>`.`*``)``)``?`')`
| Debug = `0`
| Flags = `re.compile(r'.`*`FLAGS \(`(?P<``flags``>``[^`\)`]``*``)`\)')`
| IMAP4_PORT = `143`
| IMAP4_SSL_PORT = `993`
| InternalDate = `re.compile(r'.`*`INTERNALDATE "`(?P<``day``>``[` 0123`]``[`0`-``...``
| Literal = `re.compile(r'.`*`\{`(?P<``size``>`\d`+``)`\}$')`
| MapCRLF = `re.compile(r'\r\n`|`\r`|`\n')`
| Mon2num = ``{``'``Apr``'``:` 4`,` `'``Aug``'``:` 8`,` `'``Dec``'``:` 12`,` `'``Feb``'``:` 2`,` `'``Jan``'``:` 1`,` `...``
| Response_code = `re.compile(r'\[`(?P<``type``>``[`A`-`Z-`]``+``)``(` `(?P<``data``>``[^`\`...``
| Untagged_response = `re.compile(r'\* `(?P<``type``>``[`A`-`Z-`]``+``)``(` `(?P<``dat``...``
| Untagged_status = `re.compile(r'\* `(?P<``data``>`\d`+``)` `(?P<``type``>``[`A`-`Z-`...``

Function Details | [hide private]

### Internaldate2tuple(resp) | source code
Convert IMAP4 INTERNALDATE to UT. Returns Python time module tuple.

### Time2Internaldate(date_time) | source code
Convert 'date_time' to IMAP4 INTERNALDATE representation. Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'

Variables Details | [hide private]

  ### Commands Value:
      {'APPEND': ('AUTH', 'SELECTED'),
       'AUTHENTICATE': ('NONAUTH'),
       'CAPABILITY': ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'),
       'CHECK': ('SELECTED'),
       'CLOSE': ('SELECTED'),
       'COPY': ('SELECTED'),
       'CREATE': ('AUTH', 'SELECTED'),
       'DELETE': ('AUTH', 'SELECTED'),
      ...

  ### InternalDate Value:
      re.compile(r'.*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][
      a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9
      ][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-\+])(?P<zoneh>[0-9][0-9])(?P<z
      onem>[0-9][0-9])"')

  ### Mon2num Value:
      {'Apr': 4,
       'Aug': 8,
       'Dec': 12,
       'Feb': 2,
       'Jan': 1,
       'Jul': 7,
       'Jun': 6,
       'Mar': 3,
      ...

  ### Response_code Value:
      re.compile(r'\[(?P<type>[A-Z-]+)( (?P<data>[^\]]*))?\]')

  ### Untagged_response Value:
      re.compile(r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?')

  ### Untagged_status Value:
      re.compile(r'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?')