0 votes

Hello

-I am getting the exception as "ServerException was unhandled Tried to read 1659263 bytes, only 1425408 received. Please make sure that antivirus and firewall software are disabled or configured correctly".

-I am getting this exception when I try to read email from an account.
this line "var eml = imap.GetMessageByUID(uid);" in the code gives the exception.

Below is the code in which I am getting the exception

        Imap imap = new Imap();
        imap.ConnectSSL("xyz.com", 993);
        imap.UseBestLogin("xxx@xxx.com", "abc");
        imap.Select("TempTry");
        List<long> lst = imap.Search(Flag.Undeleted);
        foreach (long uid in lst)
        {
            var eml = imap.GetMessageByUID(uid);
            IMail email = new MailBuilder()
            .CreateFromEml(eml);
            Console.WriteLine(email.Subject);
            Console.WriteLine(email.Text);
        }  
by (200 points)
Are you using the latest version of Mail.dll?
Please turn on logging (https://www.limilabs.com/blog/logging-in-mail-dll) and contact us via the support email (you can find it in the footer on the bottom of the page).

1 Answer

0 votes

This error is raised by Mail.dll, however it is the result of an IMAP server behaving incorrectly.

The message is clear: "tried to read X bytes, only Y received" - which means that the server hasn't send the required data. In other words server failed to return entire message.

Most likely this server has some message limit and it is enforcing it in this bizarre and incorrect way.

Have you disabled AV and firewall as the exception asked?
(This ensures the problem is not a faulty AV program)

by (297k points)
...