Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET IMAP

 AfterLogic Forum : MailBee.NET IMAP
Subject Topic: Error when downloading Envelopes Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jnapier
Newbie
Newbie


Joined: 01 March 2010
Location: United States
Online Status: Offline
Posts: 2
Posted: 01 March 2010 at 6:45pm | IP Logged Quote jnapier

Hi, Im getting an error when attempting to download envelopes from a folder.

This is the error
The server has responded with negative reply. The server responded: MBN00000004 NO The specified message set is invalid..

Stack Trace
Help Link
Stack Trace at c3.a(e9 A_0) at c3.ai() at bc.b(String A_0, fb A_1, Boolean A_2) at bc.a(String A_0, fb A_1, Boolean A_2) at g2.a(String A_0, Boolean A_1) at g2.a(String A_0, Boolean A_1, EnvelopeParts A_2, Int32 A_3, String[] A_4, String[] A_5, Boolean A_6, Boolean A_7) at c0.a(String A_0, Boolean A_1, EnvelopeParts A_2, Int32 A_3, String[] A_4, String[] A_5) at c0.a(Boolean A_0, String A_1, Boolean A_2, EnvelopeParts A_3, Int32 A_4, String[] A_5, String[] A_6) at MailBee.ImapMail.Imap.DownloadEnvelopes(String messageIndexSet, Boolean indexIsUid, EnvelopeParts parts, Int32 bodyPreviewSize, String[] extraHeaders, String[] extraItems) at MailBee.ImapMail.Imap.DownloadEnvelopes(String messageIndexSet, Boolean indexIsUid) at


Code

     //open the bounced welcome email folder on the server
                      imapServer.SelectFolder(settings.WelcomeEmailFolderName);

                
                      //get the envelopes for all the emails in the folder
                      _log.Debug("Retrieving messages from mail server.");
                      EnvelopeCollection envelopes = imapServer.DownloadEnvelopes(Imap.AllMessages, false);

                      if(envelopes.Count <= 0){
                           _log.Info("No messages found in mail folder.");
                           return;
                      }

Any ideas on how to resolve this would be greatly appreciated.

Thanks,
Jesse
Back to Top View jnapier's Profile Search for other posts by jnapier
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 02 March 2010 at 2:16am | IP Logged Quote Igor

I would suggest checking imapServer.MessageCount property prior to calling DownloadEnvelopes method. If there are no messages in selected folder, some mail servers might reject an attempt to download envelopes.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
jnapier
Newbie
Newbie


Joined: 01 March 2010
Location: United States
Online Status: Offline
Posts: 2
Posted: 02 March 2010 at 9:54am | IP Logged Quote jnapier

Yes, it appears that the error was occurring when there were no messages in the folder. I didnt see any examples indicating this needed to be done. Checking the count first resolves the problem.

Thanks.
Back to Top View jnapier's Profile Search for other posts by jnapier
 
bobmorton
Newbie
Newbie
Avatar

Joined: 28 September 2010
Location: United States
Online Status: Offline
Posts: 1
Posted: 01 October 2010 at 8:07pm | IP Logged Quote bobmorton

Oh I got the same error. I can't fixed it yet ... I'll try to do what you say.
Back to Top View bobmorton's Profile Search for other posts by bobmorton
 

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

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

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