Community Discussions and Support
Mercury S with SSL times out on a slow network

The setup is Pegasus sending mail using SMTP and START TLS, and Mercury S receiving it. Sender and receiver are on different different ISPs. Most of the time this works perfectly.

Once in a while, the sender's internet connection becomes heavily congested (too many YouTube users) and 'ping' response times from the sender PC to its nearest ISP router are 3000 milliseconds or more (normally it's 3-5 milliseconds).

When this kind of congestion is happening, Mercury S consistently times out on receiving. TCP timeout for Pegasus and Mercury S is set to 90 seconds, and yet the TCP log for Mercury S shows an error after only 6 seconds. If I disable START TLS on the sender (Pegasus), email flows without error, so there seems to be a problem with how the Mercury SSL code handles timeouts.

Below are the first three lines and the tail ends of the Mercury and Pegasus Session logs. The first few lines show that the sender and receiver clocks are in synch, so the times at the tail end are meaningful. You can see Mercury gave up way before 90 seconds had elapsed, and that some packets were taking about 3 seconds to travel between sender and receiver (the '354 OK' line was received by Pegasus 3 seconds after it was sent) . Actual IP addresses have been changed.

Mercury S log:

15:47:47.282: Connection from 999.999.210.200, Wed Aug 05 15:47:47 2009<lf>
15:47:47.282: << 220-mail.receiver.com ESMTP server ready.<cr><lf>220-Use of this server for unauthorised relaying of mail is forbidden.<cr><lf>
15:47:50.625: >> EHLO cedar.sender.com<cr><lf>

[stuff deleted]

15:48:08.511: << 235 Authentication successful.<cr><lf>
15:48:10.235: >> MAIL FROM:<subelman@sender.com.com><cr><lf>
15:48:10.235: << 250 Sender OK - send RCPTs.<cr><lf>
15:48:14.559: >> RCPT TO:<subelman@receiver.com><cr><lf>
15:48:14.559: << 250 Recipient OK - send RCPT or DATA.<cr><lf>
15:48:17.125: >> DATA<cr><lf>
15:48:17.125: << 354 OK, send data, end with CRLF.CRLF<cr><lf>
15:48:23.083: 18: SSL read error -25 (locus 0, type 0, code 0, 'Timeout on read (select()) after 1 secon')
15:48:24.514: --- Connection closed normally at Wed Aug 05 15:48:24 2009. ---
15:48:24.514:

Pegasus Log:

15:47:47.421 [*] Connection established to 000.000.145.173
15:47:50.781 >> 0045 220-mail.receiver.com ESMTP server ready.\0D\0A
15:47:50.781 >> 0072 220-Use of this server for unauthorised relaying of mail is forbidden.\0D\0A
15:47:50.781 << 0023 EHLO cedar.sender.com\0D\0A

[Stuff deleted]

 15:48:10.375 >> 0032 235 Authentication successful.\0D\0A
15:48:10.375 << 0037 MAIL FROM:<subelman@sender.com>\0D\0A
15:48:14.703 >> 0029 250 Sender OK - send RCPTs.\0D\0A
15:48:14.703 << 0031 RCPT TO:<subelman@receiver.com>\0D\0A
15:48:17.265 >> 0039 250 Recipient OK - send RCPT or DATA.\0D\0A
15:48:17.265 << 0006 DATA\0D\0A
15:48:20.656 >> 0039 354 OK, send data, end with CRLF.CRLF\0D\0A
15:48:20.656 << 0052 From: "Eduardo Subelman" <subelman@sender.com>\0D\0A
15:48:20.656 << 0052 Organization: No organization at all..\0D\0A
  [about 500 more lines of email body deleted from here]
15:48:20.656 << 0020 <div align="left">\0D\0A
15:48:20.656 << 0014 &nbsp;</div>\0D\0A
15:48:20.656 << 0009 </body>\0D\0A
15:48:20.656 << 0009 </html>\0D\0A
15:48:20.656 << 0003 .\0D\0A
15:48:26.187 24: SSL flush error -42 (locus 0, type 0, code 10054, 'WSAECONNRESET: Connection was reset by the remote host executing a close')
15:48:26.187 18: SSL read error -42 (locus 0, type 0, code 10054, 'WSAECONNRESET: Connection was reset by the remote host executing a close')
15:48:28.406 << 0006 QUIT\0D\0A
15:48:28.406 19: SSL write error -42 (locus 0, type 0, code 10054, 'WSAECONNRESET: Connection was reset by the remote host executing a close')

 

&lt;p&gt;The setup is Pegasus sending mail using SMTP and START TLS, and Mercury S receiving it. Sender and receiver are on different different ISPs. Most of the time this works perfectly.&lt;/p&gt;&lt;p&gt;Once in a while, the sender&#039;s internet connection becomes heavily congested (too many YouTube users) and &#039;ping&#039; response times from the sender PC to its nearest ISP router are 3000 milliseconds or more (normally it&#039;s 3-5 milliseconds).&lt;/p&gt;&lt;p&gt;When this kind of congestion is happening, Mercury S consistently times out on receiving. TCP timeout for Pegasus and Mercury S is set to 90 seconds, and yet the TCP log for Mercury S shows an error after only 6 seconds. If I disable START TLS on the sender (Pegasus), email flows without error, so there seems to be a problem with how the Mercury SSL code handles timeouts.&lt;/p&gt;&lt;p&gt;Below are the first three lines and the tail ends of the Mercury and Pegasus Session logs. The first few lines show that the sender and receiver clocks are in synch, so the times at the tail end are meaningful. You can see Mercury gave up way before 90 seconds had elapsed, and that some packets were taking about 3 seconds to travel between sender and receiver (the &#039;354 OK&#039; line was received by Pegasus 3 seconds after it was sent) . Actual IP addresses have been changed. &lt;/p&gt;&lt;p&gt;Mercury S log: &lt;/p&gt;&lt;p&gt;15:47:47.282: Connection from 999.999.210.200, Wed Aug 05 15:47:47 2009&amp;lt;lf&amp;gt; 15:47:47.282: &amp;lt;&amp;lt; 220-mail.receiver.com ESMTP server ready.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;220-Use of this server for unauthorised relaying of mail is forbidden.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 15:47:50.625: &amp;gt;&amp;gt; EHLO cedar.sender.com&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt;&lt;/p&gt;&lt;p&gt;[stuff deleted] &lt;/p&gt;&lt;p&gt;15:48:08.511: &amp;lt;&amp;lt; 235 Authentication successful.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 15:48:10.235: &amp;gt;&amp;gt; MAIL FROM:&amp;lt;subelman@sender.com.com&amp;gt;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 15:48:10.235: &amp;lt;&amp;lt; 250 Sender OK - send RCPTs.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 15:48:14.559: &amp;gt;&amp;gt; RCPT TO:&amp;lt;subelman@receiver.com&amp;gt;&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 15:48:14.559: &amp;lt;&amp;lt; 250 Recipient OK - send RCPT or DATA.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 15:48:17.125: &amp;gt;&amp;gt; DATA&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 15:48:17.125: &amp;lt;&amp;lt; 354 OK, send data, end with CRLF.CRLF&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 15:48:23.083: 18: SSL read error -25 (locus 0, type 0, code 0, &#039;Timeout on read (select()) after 1 secon&#039;) 15:48:24.514: --- Connection closed normally at Wed Aug 05 15:48:24 2009. --- 15:48:24.514: &lt;/p&gt;Pegasus Log: &lt;p&gt;15:47:47.421 [*] Connection established to 000.000.145.173 15:47:50.781 &amp;gt;&amp;gt; 0045 220-mail.receiver.com ESMTP server ready.\0D\0A 15:47:50.781 &amp;gt;&amp;gt; 0072 220-Use of this server for unauthorised relaying of mail is forbidden.\0D\0A 15:47:50.781 &amp;lt;&amp;lt; 0023 EHLO cedar.sender.com\0D\0A&lt;/p&gt;&lt;p&gt;[Stuff deleted] &lt;/p&gt;&lt;p&gt;&amp;nbsp;15:48:10.375 &amp;gt;&amp;gt; 0032 235 Authentication successful.\0D\0A 15:48:10.375 &amp;lt;&amp;lt; 0037 MAIL FROM:&amp;lt;subelman@sender.com&amp;gt;\0D\0A 15:48:14.703 &amp;gt;&amp;gt; 0029 250 Sender OK - send RCPTs.\0D\0A 15:48:14.703 &amp;lt;&amp;lt; 0031 RCPT TO:&amp;lt;subelman@receiver.com&amp;gt;\0D\0A 15:48:17.265 &amp;gt;&amp;gt; 0039 250 Recipient OK - send RCPT or DATA.\0D\0A 15:48:17.265 &amp;lt;&amp;lt; 0006 DATA\0D\0A 15:48:20.656 &amp;gt;&amp;gt; 0039 354 OK, send data, end with CRLF.CRLF\0D\0A 15:48:20.656 &amp;lt;&amp;lt; 0052 From: &quot;Eduardo Subelman&quot; &amp;lt;subelman@sender.com&amp;gt;\0D\0A 15:48:20.656 &amp;lt;&amp;lt; 0052 Organization: No organization at all..\0D\0A &amp;nbsp; [about 500 more lines of email body deleted from here] 15:48:20.656 &amp;lt;&amp;lt; 0020 &amp;lt;div align=&quot;left&quot;&amp;gt;\0D\0A 15:48:20.656 &amp;lt;&amp;lt; 0014 &amp;amp;nbsp;&amp;lt;/div&amp;gt;\0D\0A 15:48:20.656 &amp;lt;&amp;lt; 0009 &amp;lt;/body&amp;gt;\0D\0A 15:48:20.656 &amp;lt;&amp;lt; 0009 &amp;lt;/html&amp;gt;\0D\0A 15:48:20.656 &amp;lt;&amp;lt; 0003 .\0D\0A 15:48:26.187 24: SSL flush error -42 (locus 0, type 0, code 10054, &#039;WSAECONNRESET: Connection was reset by the remote host executing a close&#039;) 15:48:26.187 18: SSL read error -42 (locus 0, type 0, code 10054, &#039;WSAECONNRESET: Connection was reset by the remote host executing a close&#039;) 15:48:28.406 &amp;lt;&amp;lt; 0006 QUIT\0D\0A 15:48:28.406 19: SSL write error -42 (locus 0, type 0, code 10054, &#039;WSAECONNRESET: Connection was reset by the remote host executing a close&#039;)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft