{
    "mode": "pydoc",
    "parameter": "poplib",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/poplib/json",
    "generated": "2026-06-02T14:17:49Z",
    "sections": {
        "NAME": {
            "content": "poplib - A POP3 client class.\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/poplib.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Based on the J. Myers POP3 draft, Jan. 96\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.Exception(builtins.BaseException)\nerrorproto\nbuiltins.object\nPOP3\nPOP3SSL\n",
            "subsections": [
                {
                    "name": "class POP3",
                    "content": "|  POP3(host, port=110, timeout=<object object at 0x7f97ad064a30>)\n|\n|  This class supports both the minimal and optional command sets.\n|  Arguments can be strings or integers (where appropriate)\n|  (e.g.: retr(1) and retr('1') both work equally well.\n|\n|  Minimal Command Set:\n|          USER name               user(name)\n|          PASS string             pass(string)\n|          STAT                    stat()\n|          LIST [msg]              list(msg = None)\n|          RETR msg                retr(msg)\n|          DELE msg                dele(msg)\n|          NOOP                    noop()\n|          RSET                    rset()\n|          QUIT                    quit()\n|\n|  Optional Commands (some servers support these):\n|          RPOP name               rpop(name)\n|          APOP name digest        apop(name, digest)\n|          TOP msg n               top(msg, n)\n|          UIDL [msg]              uidl(msg = None)\n|          CAPA                    capa()\n|          STLS                    stls()\n|          UTF8                    utf8()\n|\n|  Raises one exception: 'errorproto'.\n|\n|  Instantiate with:\n|          POP3(hostname, port=110)\n|\n|  NB:     the POP protocol locks the mailbox from user\n|          authorization until QUIT, so be sure to get in, suck\n|          the messages, and quit, each time you access the\n|          mailbox.\n|\n|          POP is a line-based protocol, which means large mail\n|          messages consume lots of python cycles reading them\n|          line-by-line.\n|\n|          If it's available on your mail server, use IMAP4\n|          instead, it doesn't suffer from the two problems\n|          above.\n|\n|  Methods defined here:\n|\n|  init(self, host, port=110, timeout=<object object at 0x7f97ad064a30>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  apop(self, user, password)\n|      Authorisation\n|\n|      - only possible if server has supplied a timestamp in initial greeting.\n|\n|      Args:\n|              user     - mailbox user;\n|              password - mailbox password.\n|\n|      NB: mailbox is locked by server from here to 'quit()'\n|\n|  capa(self)\n|      Return server capabilities (RFC 2449) as a dictionary\n|      >>> c=poplib.POP3('localhost')\n|      >>> c.capa()\n|      {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],\n|       'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],\n|       'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],\n|       'UIDL': [], 'RESP-CODES': []}\n|      >>>\n|\n|      Really, according to RFC 2449, the cyrus folks should avoid\n|      having the implementation split into multiple arguments...\n|\n|  close(self)\n|      Close the connection without assuming anything about it.\n|\n|  dele(self, which)\n|      Delete message number 'which'.\n|\n|      Result is 'response'.\n|\n|  getwelcome(self)\n|\n|  list(self, which=None)\n|      Request listing, return result.\n|\n|      Result without a message number argument is in form\n|      ['response', ['mesgnum octets', ...], octets].\n|\n|      Result when a message number argument is given is a\n|      single response: the \"scan listing\" for that message.\n|\n|  noop(self)\n|      Does nothing.\n|\n|      One supposes the response indicates the server is alive.\n|\n|  pass(self, pswd)\n|      Send password, return response\n|\n|      (response includes message count, mailbox size).\n|\n|      NB: mailbox is locked by server from here to 'quit()'\n|\n|  quit(self)\n|      Signoff: commit changes on server, unlock mailbox, close connection.\n|\n|  retr(self, which)\n|      Retrieve whole message number 'which'.\n|\n|      Result is in form ['response', ['line', ...], octets].\n|\n|  rpop(self, user)\n|      Not sure what this does.\n|\n|  rset(self)\n|      Unmark all messages marked for deletion.\n|\n|  setdebuglevel(self, level)\n|\n|  stat(self)\n|      Get mailbox status.\n|\n|      Result is tuple of 2 ints (message count, mailbox size)\n|\n|  stls(self, context=None)\n|      Start a TLS session on the active connection as specified in RFC 2595.\n|\n|      context - a ssl.SSLContext\n|\n|  top(self, which, howmuch)\n|      Retrieve message header of message number 'which'\n|      and first 'howmuch' lines of message body.\n|\n|      Result is in form ['response', ['line', ...], octets].\n|\n|  uidl(self, which=None)\n|      Return message digest (unique id) list.\n|\n|      If 'which', result contains unique id for that message\n|      in the form 'response mesgnum uid', otherwise result is\n|      the list ['response', ['mesgnum uid', ...], octets]\n|\n|  user(self, user)\n|      Send user name, return response\n|\n|      (should indicate password required).\n|\n|  utf8(self)\n|      Try to enter UTF-8 mode (see RFC 6856). Returns server response.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  encoding = 'UTF-8'\n|\n|  timestamp = re.compile(b'\\\\+OK.[^<]*(<.*>)')\n"
                },
                {
                    "name": "class POP3_SSL",
                    "content": "|  POP3SSL(host, port=995, keyfile=None, certfile=None, timeout=<object object at 0x7f97ad064a30>, context=None)\n|\n|  POP3 client class over SSL connection\n|\n|  Instantiate with: POP3SSL(hostname, port=995, keyfile=None, certfile=None,\n|                             context=None)\n|\n|         hostname - the hostname of the pop3 over ssl server\n|         port - port number\n|         keyfile - PEM formatted file that contains your private key\n|         certfile - PEM formatted certificate chain file\n|         context - a ssl.SSLContext\n|\n|  See the methods of the parent class POP3 for more documentation.\n|\n|  Method resolution order:\n|      POP3SSL\n|      POP3\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, host, port=995, keyfile=None, certfile=None, timeout=<object object at 0x7f97ad064a30>, context=None)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  stls(self, keyfile=None, certfile=None, context=None)\n|      The method unconditionally raises an exception since the\n|      STLS command doesn't make any sense on an already established\n|      SSL/TLS session.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from POP3:\n|\n|  apop(self, user, password)\n|      Authorisation\n|\n|      - only possible if server has supplied a timestamp in initial greeting.\n|\n|      Args:\n|              user     - mailbox user;\n|              password - mailbox password.\n|\n|      NB: mailbox is locked by server from here to 'quit()'\n|\n|  capa(self)\n|      Return server capabilities (RFC 2449) as a dictionary\n|      >>> c=poplib.POP3('localhost')\n|      >>> c.capa()\n|      {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],\n|       'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],\n|       'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],\n|       'UIDL': [], 'RESP-CODES': []}\n|      >>>\n|\n|      Really, according to RFC 2449, the cyrus folks should avoid\n|      having the implementation split into multiple arguments...\n|\n|  close(self)\n|      Close the connection without assuming anything about it.\n|\n|  dele(self, which)\n|      Delete message number 'which'.\n|\n|      Result is 'response'.\n|\n|  getwelcome(self)\n|\n|  list(self, which=None)\n|      Request listing, return result.\n|\n|      Result without a message number argument is in form\n|      ['response', ['mesgnum octets', ...], octets].\n|\n|      Result when a message number argument is given is a\n|      single response: the \"scan listing\" for that message.\n|\n|  noop(self)\n|      Does nothing.\n|\n|      One supposes the response indicates the server is alive.\n|\n|  pass(self, pswd)\n|      Send password, return response\n|\n|      (response includes message count, mailbox size).\n|\n|      NB: mailbox is locked by server from here to 'quit()'\n|\n|  quit(self)\n|      Signoff: commit changes on server, unlock mailbox, close connection.\n|\n|  retr(self, which)\n|      Retrieve whole message number 'which'.\n|\n|      Result is in form ['response', ['line', ...], octets].\n|\n|  rpop(self, user)\n|      Not sure what this does.\n|\n|  rset(self)\n|      Unmark all messages marked for deletion.\n|\n|  setdebuglevel(self, level)\n|\n|  stat(self)\n|      Get mailbox status.\n|\n|      Result is tuple of 2 ints (message count, mailbox size)\n|\n|  top(self, which, howmuch)\n|      Retrieve message header of message number 'which'\n|      and first 'howmuch' lines of message body.\n|\n|      Result is in form ['response', ['line', ...], octets].\n|\n|  uidl(self, which=None)\n|      Return message digest (unique id) list.\n|\n|      If 'which', result contains unique id for that message\n|      in the form 'response mesgnum uid', otherwise result is\n|      the list ['response', ['mesgnum uid', ...], octets]\n|\n|  user(self, user)\n|      Send user name, return response\n|\n|      (should indicate password required).\n|\n|  utf8(self)\n|      Try to enter UTF-8 mode (see RFC 6856). Returns server response.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from POP3:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes inherited from POP3:\n|\n|  encoding = 'UTF-8'\n|\n|  timestamp = re.compile(b'\\\\+OK.[^<]*(<.*>)')\n"
                },
                {
                    "name": "class error_proto",
                    "content": "|  Method resolution order:\n|      errorproto\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                }
            ]
        },
        "DATA": {
            "content": "all = ['POP3', 'errorproto', 'POP3SSL']\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/poplib.py\n\n",
            "subsections": []
        }
    },
    "summary": "poplib - A POP3 client class.",
    "flags": [],
    "examples": [],
    "see_also": []
}