Retrieving emails with SSL

POP3_SSL() is the secure version of POP3(). This class takes additional parameters, such as keyfile and certfile, which are used for supplying the SSL certificate files, namely the private key and certificate chain file. Writing for a POP3 client is also very straightforward. To do this, instantiate a mailbox object by initializing the POP3() or POP3_SSL() classes. Then, invoke the user() and pass_() methods to login to the server by using the following command:

mailbox = poplib.POP3_SSL("POP3_SERVER", "SERVER_PORT")mailbox.user('username')mailbox.pass_('password')
You can see the basic POP3 example from the documentation: http://docs.python.org/library/poplib.html#pop3-example.
We can retrieve all of the messages ...

Get Learning Python Networking - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.