GNU Info

Info Node: (python2.1-lib.info)POP3 Objects

(python2.1-lib.info)POP3 Objects


Next: POP3 Example Prev: poplib Up: poplib
Enter node , (file) or (file)node

POP3 Objects
------------

All POP3 commands are represented by methods of the same name, in
lower-case; most return the response text sent by the server.

An `POP3' instance has the following methods:

`getwelcome()'
     Returns the greeting string sent by the POP3 server.

`user(username)'
     Send user command, response should indicate that a password is
     required.

`pass_(password)'
     Send password, response includes message count and mailbox size.
     Note: the mailbox on the server is locked until `quit()' is called.

`apop(user, secret)'
     Use the more secure APOP authentication to log into the POP3
     server.

`rpop(user)'
     Use RPOP authentication (similar to UNIX r-commands) to log into
     POP3 server.

`stat()'
     Get mailbox status.  The result is a tuple of 2 integers:
     `(MESSAGE COUNT, MAILBOX SIZE)'.

`list([which])'
     Request message list, result is in the form `(RESPONSE, ['mesg_num
     octets', ...])'.  If WHICH is set, it is the message to list.

`retr(which)'
     Retrieve whole message number WHICH, and set its seen flag.
     Result is in form  `(RESPONSE, ['line', ...], OCTETS)'.

`dele(which)'
     Flag message number WHICH for deletion.  On most servers deletions
     are not actually performed until QUIT (the major exception is
     Eudora QPOP, which deliberately violates the RFCs by doing pending
     deletes on any disconnect).

`rset()'
     Remove any deletion marks for the mailbox.

`noop()'
     Do nothing.  Might be used as a keep-alive.

`quit()'
     Signoff:  commit changes, unlock mailbox, drop connection.

`top(which, howmuch)'
     Retrieves the message header plus HOWMUCH lines of the message
     after the header of message number WHICH. Result is in form
     `(RESPONSE, ['line', ...], OCTETS)'.

     The POP3 TOP command this method uses, unlike the RETR command,
     doesn't set the message's seen flag; unfortunately, TOP is poorly
     specified in the RFCs and is frequently broken in off-brand
     servers.  Test this method by hand against the POP3 servers you
     will use before trusting it.

`uidl([which])'
     Return message digest (unique id) list.  If WHICH is specified,
     result contains the unique id for that message in the form
     `'RESPONSE MESGNUM UID', otherwise result is list `(RESPONSE,
     ['mesgnum uid', ...], OCTETS)'.


automatically generated by info2www version 1.2.2.9