Sending mail from FogBugz over secure SMTP (SSL) isn't working - FogBugz Knowledge Exchange most recent 30 from http://fogbugz.stackexchange.com2013-05-23T02:51:20Zhttp://fogbugz.stackexchange.com/feeds/question/892http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://fogbugz.stackexchange.com/questions/892/sending-mail-from-fogbugz-over-secure-smtp-ssl-isnt-workingSending mail from FogBugz over secure SMTP (SSL) isn't workingadambox2009-12-02T18:02:41Z2011-06-28T17:04:00Z
<p>I'm setting up FogBugz 7 to send mail through a mail server using SSL and it's not working</p>
http://fogbugz.stackexchange.com/questions/892/sending-mail-from-fogbugz-over-secure-smtp-ssl-isnt-working/893#893Answer by adambox for Sending mail from FogBugz over secure SMTP (SSL) isn't workingadambox2009-12-02T18:40:14Z2011-06-28T17:04:00Z<h2>FogBugz On Demand</h2>
<p>This article is for locally-installed FogBugz for your server. If you are on FogBugz On Demand, please see <a href="http://fogbugz.stackexchange.com/questions/3571/fogbugz-on-demand-complains-about-an-invalid-ssl-certificate" rel="nofollow">this post</a>.</p>
<hr>
<p>First, if you're not sure that SSL is to blame, here are <a href="http://fogbugz.stackexchange.com/questions/443/email-sending-notification-problems" rel="nofollow">thorough, general debugging steps</a> for outgoing mail problems</p>
<p>If your mail server's certificate is self-signed, check out <a href="http://fogbugz.stackexchange.com/questions/593/why-is-my-self-signed-certificate-no-longer-working-in-fogbugz-7" rel="nofollow">these instructions</a>, but change <code>pop3s://mailserver:995</code> to <code>ssmtp://mailserver:465</code> if you are running on Unix/Mac.</p>
<h2>How SSL over SMTP works</h2>
<p>There are two ways to do SMTP over SSL: Explicit and Implicit. <em>Explicit</em> means you connect to a normal SMTP port (usually 25 or 587) in plaintext, then issue the "starttls" command to switch to SSL-mode. <em>Implicit</em> means you connect to a port that expects everything to be SSL (usually 465).</p>
<p>In FogBugz 7, we support Explicit SSL automatically if you check the "Use SSL" box in Site Settings. This means that connecting to servers like Gmail is much easier: just put in the server, port, and check the box. If the server doesn't support Explicit SSL, then you still have to use Stunnel which is a bit more complicated.</p>
<p>For more info, see <a href="http://blogs.msdn.com/webdav_101/archive/2008/06/02/system-net-mail-with-ssl-to-authenticate-against-port-465.aspx" rel="nofollow">this MSDN article</a>.</p>
<h2>Setting it up in FogBugz 7 or 8</h2>
<h3>I. Determine if the server supports Explicit SSL</h3>
<ol>
<li><p>Telnet to the server at port 25 (or whatever the normal SMTP port is): (e.g. from command line, "telnet testmail.hq.fogcreek.com 25"). If you are on Windows and get a message saying that the command is not found, you're probably on Windows 7. Search Google for "enable telnet windows 7" to get several options to re-enable</p></li>
<li><p>Type "starttls" and hit enter. If Explicit SSL is supported, you should see "220 2.0.0 Ready to start TLS"</p></li>
</ol>
<h3>II. If the server supports Explicit SSL</h3>
<ol>
<li><p>In FogBugz, go to Admin > Site</p></li>
<li><p>Set the SMTP server and port (using the normal, non-SSL port, probably either 25 or 587)</p></li>
<li><p>Check the "Use SSL" box</p></li>
</ol>
<h3>II. If the server only supports Implicit SSL</h3>
<ol>
<li><p>Set up Stunnel. Follow the instructions <a href="http://www.fogcreek.com/FogBugz/blog/post/Using-Gmail-%28or-any-other-secure-SMTP-server%29-for-FogBugz.aspx" rel="nofollow">here</a>, but use these lines in your config:</p>
<pre>[SMTP FogBugz]
accept = 1099
connect = [smtp server]:[smtp port - usually 465]</pre></li>
<li><p>Verify that Stunnel is working using telnet:
1. From a command line, run "telnet localhost 1099". You should see something like "220 [smtp-server]".
2. In telnet, type "starttls". You should see something like "554 5.5.1 Error: TLS already active"</p></li>
<li><p>In FogBugz, go to Admin > Site</p></li>
<li><p>Set the SMTP server to "localhost" and the port to 1099</p></li>
<li><p>Uncheck the "Use SSL" box</p></li>
</ol>
<h2>Certificate Problems</h2>
<p>If FogBugz gives you an error about your certificate when setting up SMTP, or in site diagnostics on the mail sending step, see <a href="http://fogbugz.stackexchange.com/questions/593/why-is-my-self-signed-certificate-not-working-in-fogbugz-7-or-8" rel="nofollow">this guide</a>.</p>