I'm getting this error while trying to get number of messages from Yahoo server. I'm doing it per message (i.e. login to yahoo, get list of messages, than later go through list and connect, log in and get it one by one. After some amount of calls (few hundreds) I'm starting to get those messages during login call. Once it's started I cannot log in back in. Here is s a snippet of code:

        using (Imap client = new Imap())
        {
            TlsParameters parameters = new TlsParameters();
            parameters.CertificateVerifier = new Verifier();
            client.Options = ImapOptions.UsePeekForGetMessage;

            client.Timeout = 600000;
            client.Connect(, , parameters, ImapSecurity.Implicit);

            client.Login(, , ImapAuthentication.Auto);

            var folder = client.GetFolderInfo();

            if (folder.IsSelectable)
            {
                client.SelectFolder();

                client.GetMessage(, );

                var message = client.GetMessageInfo(, ImapListFields.FullHeaders);

                return new Foo()
                {
                };
            }
        }

asked 12 Aug '11, 00:05

RebexUser's gravatar image

RebexUser
15
accept rate: 0%


Does this mean you actually connect and log in again and again, once for each message? Most IMAP servers would not like such behavior - if the clients connects too many times within a short time interval, many IMAP servers might temporarily refuse additional connections, which appears to be what is going on with Yahoo as well. Why don't you only connect and log in once when downloading the messages? That would most likely solve the problem.

link

answered 12 Aug '11, 13:27

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×76

Asked: 12 Aug '11, 00:05

Seen: 426 times

Last updated: 12 Aug '11, 13:27