Aspose.Email giving errors while reading emails from email server

Hi Support,

We are using Aspose.Email(version 17.2.0.0) to read emails from email server.
We are getting a crash on a production server, below is the details:

25 0517ef3c 035f05c7 mscorlib_ni!System.Threading.EventWaitHandle.Reset(<HRESULT 0x80004001>)+0xd

*** ERROR: Module load completed but symbols could not be loaded for Aspose.Email.dll

26 0517ef80 712260cd Aspose_Email!#=qIp8zc_CK6M_jruQg60pbWtdm$p2yYnx7OgmU_WeteppohQm6taD20ADacsrYm9oN.#=qXZv$m9aUGhOlu_HpoosFCg==(<HRESULT 0x80004001>)+0x5f

27 0517ef8c 712529a5 mscorlib_ni!System.Threading.ThreadHelper.ThreadStart_Context(<HRESULT 0x80004001>)+0x9d

26 0536e9c4 0400f9bf mscorlib_ni!System.Threading.WaitHandle.WaitOne(<HRESULT 0x80004001>)+0x12

*** ERROR: Module load completed but symbols could not be loaded for Aspose.Email.dll

27 0536e9fc 0400f749 Aspose_Email!#=z4WPGbd0gVSCKUHVIfWg6ml2Bd0WLPUPpuw==.#=zRr94dNQ=(<HRESULT 0x80004001>)+0x8f

28 0536ea20 712260cd Aspose_Email!#=zlFRyFrQKyUdWfH9eKkoWxU4YW2FY+#=ztBXBlH7QFiflsPanxZBwIUU=.#=zjXlxK2nH99EF0BxqBQ==(<HRESULT 0x80004001>)+0x49

29 0536ea2c 712529a5 mscorlib_ni!System.Threading.ThreadHelper.ThreadStart_Context(<HRESULT 0x80004001>)+0x9d

In .Net Clrstack you do not even see the DLL-Name anymore…

0:012> !clrstack

OS Thread Id: 0x13ac (12)

Child SP IP Call Site

0517ee6c 7704c33c [HelperMethodFrame: 0517ee6c]

0517eedc 712d71b8 DomainNeutralILStubClass.IL_STUB_PInvoke(Microsoft.Win32.SafeHandles.SafeWaitHandle)

0517eee4 7123c63d [InlinedCallFrame: 0517eee4] Microsoft.Win32.Win32Native.ResetEvent(Microsoft.Win32.SafeHandles.SafeWaitHandle)

0517ef38 7123c63d System.Threading.EventWaitHandle.Reset()

0517ef44 035f05c7 #=qIp8zc_CK6M_jruQg60pbWtdm$p2yYnx7OgmU_WeteppohQm6taD20ADacsrYm9oN.#=qXZv$m9aUGhOlu_HpoosFCg==()

0517ef88 712260cd System.Threading.ThreadHelper.ThreadStart_Context(System.Object)

0517ef94 712529a5 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

0517f000 712528b6 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

0517f014 71252871 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

0517f02c 71226028 System.Threading.ThreadHelper.ThreadStart()

0517f170 722feaf6 [GCFrame: 0517f170]

0517f354 722feaf6 [DebuggerU2MCatchHandlerFrame: 0517f354]

Even the THIS-Parameter of the Function is obfuscated…

0517ef44 035f05c7 #=qIp8zc_CK6M_jruQg60pbWtdm$p2yYnx7OgmU_WeteppohQm6taD20ADacsrYm9oN.#=qXZv$m9aUGhOlu_HpoosFCg==()

PARAMETERS:

    this (0x0517ef5c) = 0x0120c32c

0:012> !DumpObj /d 0120c32c

Name: #=qIp8zc_CK6M_jruQg60pbWtdm$p2yYnx7OgmU_WeteppohQm6taD20ADacsrYm9oN

MethodTable: 0314f9c4

EEClass: 0315d288

Size: 96(0x60) bytes

File: S:\Program Files\OnGuard.Services\Aspose.Email.dll

Fields:

  MT    Field   Offset                 Type VT     Attr    Value Name

71351f7c 40003c7 40 System.Boolean 1 instance 1 #=qwKK9bIYPPEwZJTvALqTn6g==

7130d894 40003c8 4 System.Object 0 instance 0120c398 #=qQkjdmofpO7uWINkqFJ6X9JxQnULR5j1gSkn3BKzxhvU=

03160650 40003c9 8 …=, Aspose.Email]] 0 instance 0120c3a4 #=qgfjayJp4mS4fZjyKqBdHUg==

03160650 40003ca c …=, Aspose.Email]] 0 instance 0120c3bc #=q0tYvcFFGTGjBh_9u3i22WQ==

7130d894 40003cb 10 System.Object 0 instance 0120c3d4 #=qcj52uekdXdYkIMG8IYAhu9csovLBdc6cIyuR5_NYHjM=

7130e0e8 40003cc 14 …Threading.Thread 0 instance 00000000 #=q4xjARodhK7iCU_ql8UsHMQ==

7130d894 40003cd 18 System.Object 0 instance 0120c3e0 #=qR5d4XlIT$mw_wZm5Qb78yF1YsFCpEapDBuPYTHxKKWA=

7130e0e8 40003ce 1c …Threading.Thread 0 instance 0121049c #=qjWkg8CackrXSxD4QtrrXQWSPeob2dcPUzuz9cmjPo5A=

7130d894 40003cf 20 System.Object 0 instance 0120c3ec #=q553_imvgIOrkVNADHOCLdtSBX6CvtVmiqhjvLDxr53Q=

0314cabc 40003d0 24 …k9L3cg5bCbb0uobQ= 0 instance 0120c248 #=qNU6WE27LgSV87yIZBG2dGg==

7130d894 40003d1 28 System.Object 0 instance 0120c3f8 #=qlgbTZpmk_XC5Yy9cO90Hcpgbf5mIEvaYb5SMQzA1XSM=

03160a90 40003d2 2c …iKqFj9sKfLGUzRHoS 0 instance 0120c468 #=qUEEWnOLf3Dq_KUmroEt$226OacoypDugoVkuu4sjGbs=

03160a90 40003d3 30 …iKqFj9sKfLGUzRHoS 0 instance 0120c71c #=q3FOoo1cIo05su3qu75AmpHD2$tosdoLm041lRwzF_fA=

71351f7c 40003d4 41 System.Boolean 1 instance 0 #=qvnvIUsbCjNLqjm9VKCMXbl_O7zjKnzDfGh5DbqBKQDE=

7130d894 40003d5 34 System.Object 0 instance 0120c404 #=qBDyzzGezY_vYH3UOf2F44qPnkCrG05eD_d25xuDcTA0=

71352dd4 40003d6 38 …ManualResetEvent 0 instance 0120c410 #=qXQcDtzT2SJ8i6OL4mwoemEv3$Uu2WPf_p83t8YXK3yI=

71352dd4 40003d7 3c …ManualResetEvent 0 instance 0120c43c #=q2v3PZhrsZ7ub5y2CIQhScMidfWCd25DXvn_qfD6J0PY=

7130d4f4 40005d3 44 System.String 0 instance 0120c954 #=q8EnYYAOHKVy3vD4PKmQKGQ==

7062aeb0 40005d4 48 …Expressions.Regex 0 instance 0120c974 #=qtJQ3Orvk6am6nLAiA0u$DPHF4CVLYK$iMve0NCKDV8s=

7062aeb0 40005d5 4c …Expressions.Regex 0 instance 0120eadc #=qiMiN0Fz1W9n9L0uAgcMztw==

7130d894 40005d6 50 System.Object 0 instance 0120c38c #=ql0rxl9KD$tXfsy4Kltze6Iw6qkCskbj_Z4XSdywR_HU=

7130f348 40005d7 58 System.Int32 1 instance 8 #=qlzM9k2GrtVbXXv7LzWe8cA==

71351f7c 40005d8 42 System.Boolean 1 instance 0 #=qOBidwf4PCCFtOxe8Yog$xQ==

7130ff70 40005d9 54 System.Text.Encoding 0 instance 00e62940 #=qFlpQeNUyURaPZyU2kggYzQ==

0:012> lm vmAspose_Email

Browse full module list

start end module name

05760000 05e38000 Aspose_Email (no symbols)

Loaded symbol image file: Aspose.Email.dll

Image path: S:\Program Files\OnGuard.Services\Aspose.Email.dll

Image name: Aspose.Email.dll

Browse all global symbols  functions  data

Using CLR debugging support for all symbols

Has CLR image header, track-debug-data flag not set

Timestamp:        Mon Feb 13 14:03:35 2017 (58A1AEA7)

CheckSum:         006DD76C

ImageSize:        006D8000

File version:     17.2.0.0

Product version:  17.2.0.0

File flags:       0 (Mask 3F)

File OS:          4 Unknown Win32

File type:        2.0 Dll

File date:        00000000.00000000

Translations:     0000.04b0

Information from resource tables:

    CompanyName:      Aspose Pty Ltd.

    ProductName:      Aspose.Email

    InternalName:     Aspose.Email.dll

    OriginalFilename: Aspose.Email.dll

    ProductVersion:   17.2.0.0

    FileVersion:      17.2.0.0

    FileDescription:  Aspose.Email for .NET 4.0

    LegalCopyright:   Copyright 2004-2017 Aspose Pty Ltd.

    LegalTrademarks:  Aspose.Email

    Comments:         Aspose.Email

Please update me why this happen at production server.

@munishOnguard

Thank you for contacting to Aspose Support.

It is requested to kindly share your sample code used to read email from server so that we could investigate in detail.

public List GetMessageList()
{
Aspose.Email.Imap.ImapClient client = new Aspose.Email.Imap.ImapClient();
try
{
client.Host = Config.HostName;
client.Port = Config.Port;
client.SecurityOptions = Config.UseTls == true ? SecurityOptions.SSLImplicit : SecurityOptions.None;
client.Username = Config.UserName;
client.Password = Config.Password;
client.ConnectionTimeout = 45000;
client.Timeout = 45000;
}
catch (Exception ex)
{
throw new ImapException("Creating IMAP client failed: " + ExceptionDetails.Get(ex));
}

        List<IMessage> result = null;

        bool isLoggedIn = false;
        try
        {
            logger.CreateLogEntry("Selecting Inbox");
            client.SelectFolder(ImapFolderInfo.InBox);
            isLoggedIn = true;
        }
        catch (Exception ex)
        {
            isLoggedIn = false;
            throw new ImapException("Logon to IMAP mailbox failed: " + ex.Message, ex);
        }

        if (isLoggedIn)
        {
            ImapMessageInfoCollection messageList = new ImapMessageInfoCollection();
            bool isBadFetch = false; // when getting the content of an empty inbox on Lotus Notes, 
            // the Notes IMAP implementation will throw you a Bad Fetch. 
            try
            {
                logger.CreateLogEntry("Getting message list");
                messageList = client.ListMessages();
            }
            catch (Exception ex)
            {
                isBadFetch = true;
                logger.CreateLogEntry("BAD FETCH error? (" + ex.Message +
                                      "). This is thrown when an empty mailbox on a Notes system is queried.");
            }

            if (!isBadFetch)
            {
                result = new List<IMessage>();
                foreach (ImapMessageInfo info in messageList)
                {
                    logger.CreateLogEntry("Getting message with uniqueId " + info.UniqueId);
                    MailMessage source = client.FetchMessage(info.UniqueId);
                    //Passed level = 0 from here as this is the root message
                    IMessage message = createMessage(source, info.UniqueId, Config.ImportSourceId, 0);
                    result.Add(message);
                }
            }
        }
        return result;
    }

@munishOnguard

We have tested with latest version of our API i.e. Aspose.Email for .NET 18.11 and found no issue with reading emails from mail server. Can you please share the details of you work environment, which version of .NET is in use and please also mention the details of OS as well.

Hi Muzammil khan,

Thanks for the reply. This is also working for our other customers. This occurs only one of our customer. Please suggest the reason of this exception.

@munishOnguard

It looks like compatibility issue with work environment that’s why we need following details for further investigation.

  1. .NET SDK Version
  2. Operating System

Hi MuzammilKan,

I added Aspose Imap logging. Below is the log details:

=========================================


— Aspose.Email IMAP Client diagnostic log —


— Started: 1/3/2019 8:29:01 AM —

Imap server[1|1/3/2019 8:29:02 AM]: * OK The Microsoft Exchange IMAP4 service is ready.
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap client[1|1/3/2019 8:29:02 AM]: AE_2_1_0000 CAPABILITY
Imap client[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap server[1|1/3/2019 8:29:02 AM]: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI STARTTLS SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
Imap server[1|1/3/2019 8:29:02 AM]: AE_2_1_0000 OK CAPABILITY completed.
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap client[1|1/3/2019 8:29:02 AM]: AE_2_1_0001 AUTHENTICATE PLAIN
Imap client[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap server[1|1/3/2019 8:29:02 AM]: +
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap client[1|1/3/2019 8:29:02 AM]: AGRsbGNvcnBcU0EtT05HRE5MMDEtUFJEAGdlemplMTMkQA==
Imap client[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap server[1|1/3/2019 8:29:02 AM]: AE_2_1_0001 OK AUTHENTICATE completed.
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap client[1|1/3/2019 8:29:02 AM]: AE_2_1_0002 CAPABILITY
Imap client[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap server[1|1/3/2019 8:29:02 AM]: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI SASL-IR UIDPLUS ID UNSELECT XPROXY3 CLIENTNETWORKPRESENCELOCATION CHILDREN IDLE NAMESPACE LITERAL+
Imap server[1|1/3/2019 8:29:02 AM]: AE_2_1_0002 OK CAPABILITY completed.
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap client[1|1/3/2019 8:29:02 AM]: AE_2_1_0003 LIST “” “%”
Imap client[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasChildren) “/” Calendar
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasChildren) “/” Contacts
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasNoChildren \Trash) “/” “Deleted Items”
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasNoChildren \Drafts) “/” Drafts
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\Marked \HasNoChildren) “/” INBOX
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasNoChildren) “/” Journal
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasNoChildren \Junk) “/” “Junk Email”
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasNoChildren) “/” Notes
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasNoChildren) “/” Outbox
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasNoChildren \Sent) “/” “Sent Items”
Imap server[1|1/3/2019 8:29:02 AM]: * LIST (\HasNoChildren) “/” Tasks
Imap server[1|1/3/2019 8:29:02 AM]: AE_2_1_0003 OK LIST completed.
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap client[1|1/3/2019 8:29:02 AM]: AE_2_1_0004 SELECT “inbox”
Imap client[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap server[1|1/3/2019 8:29:02 AM]: * 0 EXISTS
Imap server[1|1/3/2019 8:29:02 AM]: * 0 RECENT
Imap server[1|1/3/2019 8:29:02 AM]: * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
Imap server[1|1/3/2019 8:29:02 AM]: * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
Imap server[1|1/3/2019 8:29:02 AM]: * OK [UIDVALIDITY 14] UIDVALIDITY value
Imap server[1|1/3/2019 8:29:02 AM]: * OK [UIDNEXT 13] The next unique identifier value
Imap server[1|1/3/2019 8:29:02 AM]: AE_2_1_0004 OK [READ-WRITE] SELECT completed.
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap client[1|1/3/2019 8:29:02 AM]: AE_2_1_0005 SEARCH UNSEEN
Imap client[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap server[1|1/3/2019 8:29:02 AM]: * SEARCH
Imap server[1|1/3/2019 8:29:02 AM]: AE_2_1_0005 OK SEARCH completed.
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap client[1|1/3/2019 8:29:02 AM]: AE_2_1_0006 NOOP
Imap client[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

Imap server[1|1/3/2019 8:29:02 AM]: AE_2_1_0006 OK NOOP completed.
Imap server[1|1/3/2019 8:29:02 AM]:
1/3/2019 8:29:02 AM

=============================================

Please let me know if there is anything strange in logging.

@munishOnguard

Thank you for your feedback.

The log shows that 0 email exist in inbox. We have tested the IMAP with latest version of our API and it is working fine. So, It is requested to kindly check with latest version and if the issue still exist then share your code with us so that we could investigate in detail.

Moreover, please also mention the following details:

  1. .NET SDK Version
  2. Operating System that you are using

Hi MuzammilKan,

Thanks for the reply.

We already using latest Aspose dll in our latest version of software, but this issue occurs in our older version, same version is working fine for some other customer who is using same version. We can’t upgrade to latest version.

@munishOnguard

We can only suggest and test the latest version of our API and if there would be any issue in current version then that would be addressed in later ones.

Moreover, as you have mentioned that the same version is working with some other customers and for that customer where it is not working, you may need to check compatibility with .NET SDK.

Hi,

I am getting below errors:

AE_74_1_0010 NO EXPUNGE failed.

Similar Aspose thread

@munishOnguard

Thank you for your feedback.

Can you please provide the following details for that machine generating this error:

  1. .NET SDK Version
  2. Operating System

Server LARVESTA (Application server according to CMDB):

Windows 2012 R2

PSChildName Version Release Product


v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
v3.5 3.5.30729.4926
Client 4.7.02053 460805 4.7
Full 4.7.02053 460805 4.7
Client [4.0.0.0]

Server LANTURN (IIS server according to CMDB):

Windows 2012 R2

PSChildName Version Release Product


v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
v3.5 3.5.30729.4926
Client 4.7.02053 460805 4.7
Full 4.7.02053 460805 4.7
Client [4.0.0.0]

@munishOnguard

Thank you for your feedback.

We have logged this issue with ID “EMAILNET-39255” for further investigation. You will automatically be informed here once we have more information to share.

@munishOnguard

We have investigated this issue and we are still unable to reproduce this issue. It looks that you are using outdated version (17.2.0.0) of our library which was released 2/16/2017. Since then many changes were added so It may affect on results.

Moreover, we have simplified your code as follows:

client.SelectFolder(ImapFolderInfo.InBox);
ImapMessageInfoCollection messageList = client.ListMessages();
foreach (ImapMessageInfo info in messageList)
	client.FetchMessage(info.UniqueId);

Furthermore, please feel free to write back to us if you need additional information.

Hi MuzammilKhan,

Thanks for your reply,

Simplified code is same what we have used, so there is no difference.
Also, we are sure that the exception is raised from Aspose dll.

@munishOnguard

It is requested to kindly update Aspose.Email API to the latest version which is 18.12 and then test it.