# Certificate/key is needed in server mode and optional in client mode cert = /etc/stunnel/stunnel.pem key = /etc/stunnel/stunnel.pem # Some security enhancements for UNIX systems - comment them out on Win32 # chroot = /chroot/stunnel/ setuid = stunnel setgid = stunnel # PID is created inside chroot jail pid = /run/stunnel/stunnel.pid # Some performance tunings socket = l:TCP_NODELAY=1 socket = r:TCP_NODELAY=1 #compression = rle # Workaround for Eudora bug options = DONT_INSERT_EMPTY_FRAGMENTS # Some debugging stuff useful for troubleshooting #debug = 7 #output = stunnel.log # Use it for client mode client = yes # Service-level configuration [imap] accept = 143 connect = IMAP.EXAMPLE.ORG:IMAP_PORT [smtp] accept = 25 connect = SMTP.EXAMPLE.ORG:SMTP_PORT protocol = smtp protocolUsername = SMTP_USERNAME protocolPassword = SMTP_PASSWORD