Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET IMAP

 AfterLogic Forum : MailBee.NET IMAP
Subject Topic: Random security protocol Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 01 August 2011 at 11:44am | IP Logged Quote Alex

Ii still couldn't get how it connects in the last case. Which settings does it use? Or is it completely random?

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
vdumas
Newbie
Newbie
Avatar

Joined: 28 July 2011
Location: Canada
Online Status: Offline
Posts: 12
Posted: 01 August 2011 at 11:54am | IP Logged Quote vdumas

It connects after many retries sometimes and other times faster.
Here is the code:


        public Imap Connect(string server, int port)
        {
            Global.Pipelining = true;
            MailBee.ImapMail.Imap.LicenseKey = _licenseKey;            
            MailBee.ImapMail.Imap imap = null;
            DateTime start = DateTime.Now;
            Global.AutodetectPortAndSslMode = false;

            if (imap == null)
            {
               imap = new Imap();
               imap.ThrowExceptions = false;
               // configure encryption                    
               imap.SslProtocol = MailBee.Security.SecurityProtocol.Tls1;
               imap.SslMode = MailBee.Security.SslStartupMode.OnConnect;
               imap.Log.Enabled = true;
               imap.Log.Filename = "C:\\Temp\\imap_log.txt";
               imap.Log.Clear();              
            }

            ClearLog("Trying " + server + ":" + port + "...");
            int numberOfRetry = 0;

            while (!imap.Connect(server, port) && numberOfRetry < 30 )
            {
               // sleep and retry
               System.Threading.Thread.Sleep(1000);
               this.Log("Re-Trying " + server + ":" + port + "...");
               imap.ResetState();                              &n bsp; 
               this.Update();
               numberOfRetry++;                        
            }

            if (numberOfRetry >= 30)
            {
               this.Log( DateTime.Now + "- Failed for 30 seconds" );
               return null;
            }

            // connect did not throw exception, then sto.Tls1rying
            this.Log( DateTime.Now + "- Success!" );
            return imap;
        }
Back to Top View vdumas's Profile Search for other posts by vdumas
 
vdumas
Newbie
Newbie
Avatar

Joined: 28 July 2011
Location: Canada
Online Status: Offline
Posts: 12
Posted: 03 August 2011 at 7:58am | IP Logged Quote vdumas

It works well when the session ID of the packet is not set (length 0).
Back to Top View vdumas's Profile Search for other posts by vdumas
 
vdumas
Newbie
Newbie
Avatar

Joined: 28 July 2011
Location: Canada
Online Status: Offline
Posts: 12
Posted: 03 August 2011 at 8:33am | IP Logged Quote vdumas

I contact the support because this issue has been causing important problems since march and we need to find a solution to turn SSL packets off.

As described here
http://www.afterlogic.com/forum/forum_posts.asp?TID=3410

We set these:
Global.AutodetectPortAndSslMode = false;
imap = new Imap();
imap.SslMode = MailBee.Security.SslStartupMode.OnConnect;
imap.SslProtocol = MailBee.Security.SecurityProtocol.Tls1;
imap.Connect(imapConfig.Host, imapConfig.Port);

This sends randomly packets that are containing a session ID (SSL). The exchange server does not like those and sends a reset on the connection.
It only accepts TLS packets.

Setting the MailBee.Security.SecurityProtocol.Tls1 should be disabling the SSL session ids, at least after the first attempt when a reset was received.


Back to Top View vdumas's Profile Search for other posts by vdumas
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 03 August 2011 at 8:52am | IP Logged Quote Alex

Try the version for .net 1.1 framework from http://www.afterlogic.com/updates/mailbee_net_1.zip to see if it makes any difference.

.net 2.0+ optimized version uses the .net's standard SslStream class which we have no direct control of while .net 1.1 version can set allowed SSL protocols directly on WinAPI level.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
vdumas
Newbie
Newbie
Avatar

Joined: 28 July 2011
Location: Canada
Online Status: Offline
Posts: 12
Posted: 03 August 2011 at 10:13am | IP Logged Quote vdumas

Same behavior, maybe we should use your active x?
Back to Top View vdumas's Profile Search for other posts by vdumas
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 03 August 2011 at 10:54am | IP Logged Quote Alex

Good idea, it's worth trying.

Also, does it behave the same way on different computers? Maybe, the issue is OS dependent or something like that? Is it possible to get external IP for the server to check from our place, for instance?

regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

<< Prev Page of 2
  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide