Connect to an IMAP Server using JavaInternet Message Access Protocol (IMAP) is widely used for retrieving email messages. This article explains how to connect to an IMAP server using Java, and shows how to work with SOCKS or HTTP proxies and SSL‑enabled IMAP servers programmatically.