Fetching mail from a POP3 server using php

Somewhat surprisingly, PHP’s imap library can be also used for working with POP3 mailboxes. Most of the advanced IMAP features won’t work, of course (e.g. folders or fetching message parts), but the basic POP3 functionality is implemented. The main difference is the option string that you’re passing to imap_open – to quote that page: // … Read more

How can I fetch emails via POP or IMAP through a proxy?

You don’t need to dirtily hack imaplib. You could try using the SocksiPy package, which supports socks4, socks5 and http proxy (connect): Something like this, obviously you’d want to handle the setproxy options better, via extra arguments to a custom __init__ method, etc. from imaplib import IMAP4, IMAP4_SSL, IMAP4_PORT, IMAP4_SSL_PORT from socks import sockssocket, PROXY_TYPE_SOCKS4, … Read more