Connection error while connect to mail server

0 votes
asked Apr 19, 2016 by lijojose (120 points)
retagged Apr 19, 2016 by Tomas Knopp

We are facing problem while connecting to our mail server using rebex.

Below are the component we are using:

We are using .Net framework 3.5.
Microsoft outlook 2012
Rebex 1.0.3588.0.

Below are the connection details we are using:

        string server = "10.242.47.95";
        int port = 110;
        Imap client = new Imap();
        client.Connect(server, port);

While connecting we are getting exception "Invalid IMAP response".
It was working earlier.
Please check it and reply.

Thanks
Lijo

Applies to: Rebex Secure Mail

2 Answers

0 votes
answered Apr 19, 2016 by Tomas Knopp (58,580 points)

The version 3588 of Rebex IMAP is pretty old (from year 2009). There have been many fixes and improvements since then.

That being said, please download the newest version of Rebex Secure Mail (currently 2016 R2) and give it a try in your project.

I checked your support contract and it is expired. Contact us at sales@rebex.net for an renewal offer. There is also the free 30-day trial.

Other users with an active support contract, just login and download the new version.

If updating to new version still does not solve the issue with "Invalid IMAP response", then please create a log of communication and the either post it here, or send it to support@rebex.net. Seeing the log we will be able to help you.

Thanks!

commented Apr 19, 2016 by lijojose (120 points)
Thank you for the quick response.

I will try the trial version and let you know if any issues
commented Apr 19, 2016 by lijojose (120 points)
I downloaded latest DLL but still i got the same error.
Please check the log created.

2016-04-19 22:26:41.663 Opening log file.
2016-04-19 22:26:41.694 Using FileLogWriter version 2.0.5885.0.
2016-04-19 22:26:44.643 DEBUG Imap(1)[9] Info: State changed from 'Disconnected' to 'Connecting'.
2016-04-19 22:26:44.643 INFO Imap(1)[9] Info: Connecting to 10.242.47.95:110 using Imap 2.0.5885.0 (trial version).
2016-04-19 22:26:44.643 INFO Imap(1)[9] Info: Connecting to 10.242.47.95.
2016-04-19 22:26:46.249 DEBUG Imap(1)[9] Info: Connection succeeded.
2016-04-19 22:26:46.515 DEBUG Imap(1)[9] Info: State changed from 'Connecting' to 'Reading'.
2016-04-19 22:26:46.530 INFO Imap(1)[9] Response: +OK The Microsoft Exchange POP3 service is ready.
2016-04-19 22:26:46.577 DEBUG Imap(1)[9] Info: State changed from 'Reading' to 'Disconnected'.
2016-04-19 22:26:46.593 ERROR Imap(1)[9] Info: Rebex.Net.ImapException: Invalid IMAP response.
   at Rebex.Net.Imap.UI(String N, PDW W, String B, Boolean A)
   at Rebex.Net.Imap.WM(String N, Int32 W, TlsParameters B, SslMode A)
0 votes
answered Apr 20, 2016 by Tomas Knopp (58,580 points)

Ah, thanks for the log. The problem is that you are connecting to POP3 server with Rebex IMAP client. These are two different protocols, so in order to connect to POP3 server, you'll need to connect via our Pop3 client. Try this code:

// create POP3 client instance
using (var pop3 = new Rebex.Net.Pop3())
{
    // connect to Exchange POP3 server
    pop3.Connect("exchange");

    // authenticate
    pop3.Login(username, password);

    // get message list
    Pop3MessageCollection list = pop3.GetMessageList();

    // print some info
    Console.WriteLine("{0} email(s) found.", list.Count);

    // download all messages
    foreach (Pop3MessageInfo info in list)
    {
        MailMessage mail = pop3.GetMailMessage(info.SequenceNumber);

        // do something with the mail
        // ...
    }

    // disconnect (required to commit delete operations)
    pop3.Disconnect();
}

See more info at http://www.rebex.net/secure-mail.net/features/pop3.aspx

Moreover, I see that your company owns a license for IMAP component (it was sold separately until 2013). Since then we do not sell it separately, instead we sell the whole Rebex Secure Mail that contains all the mail protocols - IMAP, POP3, SMTP, EWS. For you as an owner of the IMAP component, there is 15% discount on upgrading to Rebex Secure Mail from your old license. See more info at http://blog.rebex.net/mail-and-terminal-emulation-product-list-simplified/

commented Apr 20, 2016 by lijojose (120 points)
Thank you for the reply.

It is connecting fine with Pop3 client.

Also we have the license for below exe:

RebexSecureImap-Full-1.0.3588.0-DotNet2.0.exe, but when we install it we dont have the Pop3.DLL.

Is it separate component ?

Please check it.
commented Apr 20, 2016 by Tomas Knopp (58,580 points)
Your old license from year 2011 only contained the IMAP/SSL client because it was a separate component back then.  It did not contain POP3 client. that's why the Pop3 client is missing. So in order to use POP3 client, you will need to upgrade your license to Rebex Secure Mail.

The upgrade to new version is definitely recommended as it contains many bugfixes, improvements, as well as new additions such as TLS 1.2 and security fixes.

I will send you a link to upgrade your license to your email.
...