Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Envelope data corrupted Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
AengusO
Newbie
Newbie
Avatar

Joined: 26 February 2010
Location: Ireland
Online Status: Offline
Posts: 22
Posted: 26 January 2012 at 6:39am | IP Logged Quote AengusO

Hi, I am a user of MailBee.Net Objects - I am using MailBee ImapMail to download mails in a c# Windows service. The version of my MailBee.Net dll is 6.8.2.827.

On one server, I keep getting an error like this:

MailBee.ImapMail.MailBeeImapInvalidEnvelopeException: The envelope data is corrupted or incorrect. Envelope.IsValid will be false. The invalid envelope message number is: 2.
   at a.c.f.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 a.c.f.a(String A_0, Boolean A_1, Int32 A_2, Boolean A_3)
   at a.c.t.a(String A_0, Boolean A_1, Int32 A_2)
   at a.c.t.a(Boolean A_0, String A_1, Boolean A_2, Int32 A_3)
   at MailBee.ImapMail.Imap.DownloadEntireMessages(String messageIndexSet, Boolean indexIsUid)


Sample code from my c# project:

        /// <summary>
        /// Download mail collection
        /// </summary>
        /// <returns></returns>
        protected override MailMessageCollection DownloadEntireMessages1()
        {
            if (GetNextMails() > 0)
            {
               return imap.DownloadEntireMessages(m_CurrentUids.ToString(), true);
            }
            else
            {
               return null;
            }
        }

       /// <summary>
        /// Check for next mails in box
        /// </summary>
        /// <returns></returns>
        private int GetNextMails()
        {
            return GetNextMails(m_FirstInRange, m_FirstInRange + m_BatchSize - 1);
        }

        /// <summary>
        /// Check for next mails in box
        /// </summary>
        /// <param name="FirstSeq"></param>
        /// <param name="LastSeq"></param>
        /// <returns></returns>
        private int GetNextMails(long FirstSeq, long LastSeq)
        {
            int iRetry = 3;
            while (true)
            {
               try
               {
                    if (CheckLoggedIn())
                    {
                        string SeqSearch = FirstSeq.ToString() + ":" + LastSeq.ToString();
                        m_CurrentUids = (UidCollection)imap.Search(true, SeqSearch, null);
                        return m_CurrentUids.Count;
                    }
               }
               catch (Exception ex)
               {
                    if (--iRetry < 0)
                    {
                        LogHelper.Exception(ex, "Error getting next Mail");
                        throw;
                    }
               }
            }
        }



What does this error occur and how can I get around it ?
Regards,
Aengus O'Sullivan
Back to Top View AengusO's Profile Search for other posts by AengusO
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 26 January 2012 at 11:32am | IP Logged Quote Alex

This usually means the server returns data which cannot be parsed. Some IMAP servers may have flaws in their IMAP implementation. Many servers are tested only against a few popular clients like Outlook and do not correctly support any IMAP commands of syntax Outlook or Thunderbird does not use.

Sometimes, MailBee is able to recover from IMAP syntax violation, you'd check with the latest version.

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

Joined: 26 February 2010
Location: Ireland
Online Status: Offline
Posts: 22
Posted: 02 February 2012 at 4:49am | IP Logged Quote AengusO

Thanks for the reply. Have received latest version of MailBee.Net objects, I am waiting for fix to be applied to live server and tested - will update when I get feedback,

Thanks,
Aengus
Back to Top View AengusO's Profile Search for other posts by AengusO
 
AengusO
Newbie
Newbie
Avatar

Joined: 26 February 2010
Location: Ireland
Online Status: Offline
Posts: 22
Posted: 03 February 2012 at 1:37am | IP Logged Quote AengusO

Have updated server with the latest version of MailBee.NET.dll, still getting same result. What can I do next ? Is there logging I can enable to check whats happening, is there a workaround for this issue ?

Thanks,
Aengus O'Sullivan
Back to Top View AengusO's Profile Search for other posts by AengusO
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6089
Posted: 03 February 2012 at 1:41am | IP Logged Quote Igor

Checking the logs might help indeed. You can enable logging using this property of IMAP object.

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

Joined: 26 February 2010
Location: Ireland
Online Status: Offline
Posts: 22
Posted: 05 March 2012 at 7:20am | IP Logged Quote AengusO

I upgraded to latest version of MailBee.Net and also changed logic to use DownloadEnvelopes instead of download entire messages - this fixed the issue
Back to Top View AengusO's Profile Search for other posts by AengusO
 

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