Linux Security Cookbook
Recipe 8.14 Securing POP/IMAP with stunnel and SSL
8.14.1 Problem
You want to read mail on a POP or IMAP mail server securely. Your mail client supports SSL, but the mail server does not. 8.14.2 Solution
Use stunnel, installed on the mail server machine. Suppose your client host is myclient, the mail server host is mailhost, and the mail server listens on standard port numbers (110 for POP, 143 for IMAP).
8.14.3 Discussion
This recipe assumes you are not a system administrator on mailhost, and need to get this working just for yourself. If you have root privileges, just configure your mail server to support SSL directly. We create two secure connections to mailhost's port 12345. The stunnel command connects this arbitrary port to the mail server, all locally on mailhost. Then the mail client crosses the network via SSL to connect to port 12345. These two segments together form a complete, secure connection between mail client and mail server. If you remove the -f option, stunnel will fork into the background and log messages to syslog, instead of remaining on the terminal and printing status messages to stderr. 8.14.4 See Also
The directory /usr/share/doc/stunnel-* contains stunnel documentation. The stunnel home page is http://www.stunnel.org. |