<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I am trying to set up stunnel so that it accepts SSL encrypted traffic from the internet on port 2525 and sends it to my mail server on port 25.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>To create the certificate, I used:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(248, 248, 248); "><FONT class="Apple-style-span" color="#2A313B" face="Courier"><I>sudo openssl req -new -outform PEM -out smtpd.cert \</I></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(248, 248, 248); "><SPAN class="Apple-style-span" style="line-height: 18px;"><FONT class="Apple-style-span" color="#2A313B" face="Courier"><SPAN class="Apple-style-span" style="line-height: normal;"><I>�� </I></SPAN></FONT><FONT class="Apple-style-span" color="#2A313B" face="Courier"><SPAN class="Apple-style-span" style="line-height: normal;"><I>-newkey rsa:2048 -nodes -keyout smtpd.key -keyform PEM \</I></SPAN></FONT></SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(248, 248, 248); "><SPAN class="Apple-style-span" style="line-height: 18px;"><FONT class="Apple-style-span" color="#2A313B" face="Courier"><SPAN class="Apple-style-span" style="line-height: normal;"><I>�� </I></SPAN></FONT><FONT class="Apple-style-span" color="#2A313B" face="Courier"><SPAN class="Apple-style-span" style="line-height: normal;"><I>-days 365 -x509</I></SPAN></FONT></SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; background-color: rgb(248, 248, 248); "><FONT class="Apple-style-span" color="#2A313B" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; background-color: rgb(248, 248, 248); "><FONT class="Apple-style-span" color="#000000">My stunnel.conf is:</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 18px; background-color: rgb(248, 248, 248); "><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><BR class="khtml-block-placeholder"></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Sample stunnel configuration file by Michal Trojnara 2002-2006</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Some options used here may not be adequate for your particular configuration</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Certificate/key is needed in server mode and optional in client mode</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; The default certificate is provided only for testing and should not</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; be used in a production environment</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;cert = stunnel.pem</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>cert = /smtpd.cert</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;key = stunnel.pem</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>key = /smtpd.key</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Some performance tunings</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>socket = l:TCP_NODELAY=1</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>socket = r:TCP_NODELAY=1</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Workaround for Eudora bug</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;options = DONT_INSERT_EMPTY_FRAGMENTS</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Authentication stuff</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;verify = 2</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Don't forget to c_rehash CApath</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;CApath = certs</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; It's often easier to use CAfile</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;CAfile = certs.pem</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Don't forget to c_rehash CRLpath</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;CRLpath = crls</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Alternatively you can use CRLfile</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;CRLfile = crls.pem</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Some debugging stuff useful for troubleshooting</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;debug = 7</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;output = stunnel.log</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Use it for client mode</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;client = yes</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; Service-level configuration</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;[pop3s]</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;accept� = 995</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;connect = 110</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;[imaps]</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;accept� = 993</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;connect = 143</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;[ssmtp]</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;accept� = 465</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;connect = 25</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;[https]</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;accept� = 443</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;connect = 80</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>;TIMEOUTclose = 0</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000"><FONT class="Apple-style-span" face="Courier"><I>; vim:ft=dosini</I></FONT></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I><BR class="khtml-block-placeholder"></I></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000">I am trying it in standalone mode.</FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Using Stunnel 4.04.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>OpenSSL 0.9.7i 14 Oct 2005</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Output of�gcc -v is:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>Using built-in specs.</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>Target: powerpc-apple-darwin8</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>Configured with: /private/var/tmp/gcc/gcc-5341.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>Thread model: posix</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>gcc version 4.0.1 (Apple Computer, Inc. build 5341)</I></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Whenever I try to start Stunnel, I get a message saying that there is no such file.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Eg:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>$ stunnel -p /smtpd.cert -d 2525 -r 25� � � </I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>2006.10.01 00:36:46 LOG3[638:2684415368]: -p: No such file or directory (2)</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>Syntax:</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>stunnel [filename] | -help | -version | -sockets</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>� � filename� � - use specified config file instead of /sw/etc/stunnel/stunnel.conf</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>� � -help� � �� - get config file help</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>� � -version� � - display version and defaults</I></FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier"><I>� � -sockets� � - display default socket options</I></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I am using Mac OS X 10.4.8, Stunnel was built using Fink.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Does anybody have any suggestions as to what I am doing wrong?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>James.</DIV></BODY></HTML>