On this page
poplib.POP3_SSL
Prev: poplib.POP3 | Up: poplib
Rel: poplib.error_proto, poplib.POP3
Ref: docs.python.org — poplib.POP3_SSL
Tags: #public #python3 #stdlib #poplib
Import
import poplib
from poplib import POP3_SSL
Signature & Overview
poplib.POP3_SSL(host, port=995, *, timeout=<object object at 0x1040b4980>, context=None)
POP3 client class over SSL connection Instantiate with: POP3_SSL(hostname, port=995, context=None) hostname - the hostname of the pop3 over ssl server
Methods & Attributes
POP3_SSL.apop(self, user, password)— Authorisation - only possible if server has supplied a timestamp in initial greeting.POP3_SSL.capa(self)— Return server capabilities (RFC 2449) as a dictionary >>> c=poplib.POP3('localhost') >>> c.capa()POP3_SSL.close(self)— Close the connection without assuming anything about it.POP3_SSL.dele(self, which)— Delete message number 'which'.POP3_SSL.getwelcome(self)—POP3_SSL.getwelcomemethod/property.POP3_SSL.list(self, which=None)— Request listing, return result.POP3_SSL.noop(self)— Does nothing.POP3_SSL.pass_(self, pswd)— Send password, return response (response includes message count, mailbox size).POP3_SSL.quit(self)— Signoff: commit changes on server, unlock mailbox, close connection.POP3_SSL.retr(self, which)— Retrieve whole message number 'which'.POP3_SSL.rpop(self, user)— Send RPOP command to access the mailbox with an alternate user.POP3_SSL.rset(self)— Unmark all messages marked for deletion.POP3_SSL.set_debuglevel(self, level)—POP3_SSL.set_debuglevelmethod/property.POP3_SSL.stat(self)— Get mailbox status.POP3_SSL.stls(self, context=None)— The method unconditionally raises an exception since the STLS command doesn't make any sense on an already established SSL/TLS session.POP3_SSL.top(self, which, howmuch)— Retrieve message header of message number 'which' and first 'howmuch' lines of message body.POP3_SSL.uidl(self, which=None)— Return message digest (unique id) list.POP3_SSL.user(self, user)— Send user name, return response (should indicate password required).POP3_SSL.utf8(self)— Try to enter UTF-8 mode (see RFC 6856). Returns server response.
Usage
import poplib
# Encrypted POP3 over TLS (port 995)
assert issubclass(poplib.POP3_SSL, poplib.POP3)
Gotchas
- Always pass
timeout=and wrap intry ... finally: conn.quit().
REPL Inspect
from poplib import POP3_SSL
help(POP3_SSL)
Linked from
Related notes
- tuts/python3/stdlib_module/poplib/error_proto Linked here; links to this page; shared tags: #poplib, #stdlib
- tuts/python3/stdlib_module/poplib/POP3 Linked here; links to this page; shared tags: #poplib, #stdlib
- tuts/python3/stdlib_module/poplib Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib