Free Support Forum - aspose.com

Another issue with ImapClient.AppendMessage()

I am using the 3.6.2 fix version of Aspose.Network, and it PUTS a new message on a server fine using AppendMessage(), but if the IMAP server supports UniqueID (Plus) capability, then I get the following exception:
Missing expected ‘APPENDUID’ response

I have verified the response is per the RFC, and tested with another IMAP component, and it seems fine.

Can you take a look at this and let me know how to handle it?

Thanks!
-Ed

Hi Ed,

Thank you for considering Aspose.

I’ll appreciate if you can please send the stack trace, so that we can track down this issue.

Thanks for taking a look here you go:

Code to reproduce:
Aspose.Network.Mail.MailMessage mm = new Aspose.Network.Mail.MailMessage();
mm.TextBody = “None”;
mm.HtmlBody = “None”;
mm.From = "aa@bb.com";
mm.To = "bb@aa.com";
mm.Subject = “A Subject”;
string resultID;
resultID= AsposeClient.AppendMessage(“Inbox”, mm); //Fails Here




Exception:
+ $exception {“Missing expected ‘APPENDUID’ response.”} System.Exception {Aspose.Network.Imap.ImapException}


Stack:
" at Aspose.Network.Imap.ImapClient.x1909144cad306b34(String x8b5b49efcd08ae0a, x24321eeaf184a530 x1f25abf5fb75e795, MessageFlags xebf45bdcaa1fd1e1)\r\n at Aspose.Network.Imap.ImapClient.AppendMessage(String folderName, MailMessage message, MessageFlags flags)\r\n at Aspose.Network.Imap.ImapClient.AppendMessage(String folderName, MailMessage message)\r\n at Aspose_Test_Bed.Form1.btnAsposeUpload_Click(Object sender, EventArgs e) in C:\Users\xxx\Documents\Visual Studio 2005\Projects\xxx\Aspose Test Bed\Form1.cs:line 428"

Hello,

Thanks for your reply.

Our development team is working on this bug. We will get back to you as soon as possible.

Best regards.

Hello,

Could you please try this hotfix?

http://www.aspose.com/products/Aspose.Network/Releases/3.6.0/Aspose.Networkv3.6.3.zip

Let me know if it works.

Thanks for sending the update.

We have tried this and get another error now:

Exception:
{“Fail to append message:Aspose.Network.Imap.x0d5228de32e4575d”}

Stack:
" at Aspose.Network.Imap.ImapClient.x1909144cad306b34(String x8b5b49efcd08ae0a, x24321eeaf184a530 x1f25abf5fb75e795, MessageFlags xebf45bdcaa1fd1e1)\r\n at Aspose.Network.Imap.ImapClient.AppendMessage(String folderName, MailMessage message, MessageFlags flags)\r\n at Aspose.Network.Imap.ImapClient.AppendMessage(String folderName, MailMessage message)\r\n at IPX_Test_Bed.Form1.btnAsposeUpload_Click(Object sender, EventArgs e)

Hello,

Could you share your imap server for the debugging?

We will promise to use it for debugging only. my email is guangzhou$$aspose.com.

Thank you so much

Could you please try this hotfix?

http://www.aspose.com/products/Aspose.Network/Releases/3.6.0/Aspose.Networkv3.6.3.zip

I have added debugging information in it. Please help to print the exception that you get (Use Exception.ToString() to print out the exception). Therefore, we can locate the bugs.

Thank you so much.

Hi,

Thanks for the new hotfix.

We have tried it, and it still exceptions. The exception and stack are below. I am still working to get you permission to our IMAP server for testing.

Thanks,
-Ed

+ [Aspose.Network.Imap.ImapException] {“Fail to append message:ImapRespone:[OK]”} Aspose.Network.Imap.ImapException


Stack:
" at Aspose.Network.Imap.ImapClient.x1909144cad306b34(String x8b5b49efcd08ae0a, x24321eeaf184a530 x1f25abf5fb75e795, MessageFlags xebf45bdcaa1fd1e1)\r\n at Aspose.Network.Imap.ImapClient.AppendMessage(String folderName, MailMessage message, MessageFlags flags)\r\n at Aspose.Network.Imap.ImapClient.AppendMessage(String folderName, MailMessage message)\r\n

Could you please try this hotfix one more time? I have done the fix according to your report.

http://www.aspose.com/products/Aspose.Network/Releases/3.6.0/Aspose.Networkv3.6.3.zip

Thank you so much.

Hi,

I have tried the new hotfix, and it no longer throw a hard exception. However it is not returning the messige UID either (the response is always null).

So I still do not think it is fixed.

thanks,
-Ed

Hello, Ed,

According to the exception message, the server did not return UID (I don't know what's the root). Could we get the debugging account? We can get more information and locate the root if we can connect to the server.

Thanks

Hi,

I just sent IMAP account login info to the guangzhou email address. Thanks!
-Ed

Hello, Ed,

I have got the debugging account. However, I cannot reproduce your problem.

I can get the UID from the appendmessage function. The server did provide UID and the AppendMessage returned it.

Could you share your code to me. I would like to look into it

Please check the following logs from server:

Reading:* OK EMAILARCHITECT EmailArchitect IMAP4 Service, Version: 2006.7.2.0.2 ready at Tue, 6 Nov 2007 01:39:23 -0500
Writing:A00002 CAPABILITY
Reading:* CAPABILITY IMAP4rev1 IDLE AUTH=CRAM-MD5 AUTHENTICATE STARTTLS UIDPLUS
Reading:A00002 OK CAPABILITY completed
Writing:A00003 LOGIN XXX XXX
Reading:A00003 OK login completed, now in authenticated state
Writing:A00004 APPEND Inbox () "05-Nov-2007 22:36:59 -0800" {253}
Reading:+ Ready for additional command text.
Writing:
Reading:A00004 OK [APPENDUID 1194297104 2] APPEND completed

Yes, I agree the email server is returning the UID just fine, however I am not able to get it from the component.

According to the docs, the following code (I think) should Upload (Apend) a message to the server and return the message UID, however the returned value is always null. As you saw in your testing, the server is returning the UID correctly, however the Aspose component is not. Please let me know if there is something wrong with the code below.

Aspose.Network.Mail.MailMessage aMailMessage= new Aspose.Network.Mail.MailMessage();
aMailMessage.TextBody = “None”;
aMailMessage.HtmlBody = “None”;
aMailMessage.From = "aa@bb.com";
aMailMessage.To = "bb@aa.com";
aMailMessage.Subject = “A Subject”;
string returnedMessageID;
try
{
returnedMessageID= AsposeClient.AppendMessage(“Inbox”, aMailMessage); //This is always returned null

}

Hello,

I have located the root of this problem: the obfuscator did something wrong.

Please try the fix:

http://www.aspose.com/products/Aspose.Network/Releases/3.6.0/Aspose.Networkv3.6.3.zip

Thanks for your help.

With the new hotfix, I now get an exception (Object ref not set to instance of an obj) again. Here is the stack:

StackTrace " at Aspose.Network.Imap.ImapClient.x84cb5117a00a8c09(String xfd6dd6e53b1a26d5, x0d5228de32e4575d xe464d907306ccb86, Boolean x291fabf8727e1df6)\r\n at Aspose.Network.Imap.ImapClient.x84cb5117a00a8c09(String xfd6dd6e53b1a26d5, x0d5228de32e4575d xe464d907306ccb86)\r\n at Aspose.Network.Imap.ImapClient.x68c3ef881eff3713(String xfd6dd6e53b1a26d5, Object[] x874e1670b98e53ec)\r\n at Aspose.Network.Imap.ImapClient.x18dfca7c5fd2402f(String xfd6dd6e53b1a26d5, Object[] x874e1670b98e53ec)\r\n at Aspose.Network.Imap.ImapClient.x1909144cad306b34(String x8b5b49efcd08ae0a, x24321eeaf184a530 x1f25abf5fb75e795, MessageFlags xebf45bdcaa1fd1e1)\r\n at Aspose.Network.Imap.ImapClient.AppendMessage(String folderName, MailMessage message, MessageFlags flags)\r\n at Aspose.Network.Imap.ImapClient.AppendMessage(String folderName, MailMessage message)\r\n

Hello,

I reset the obfuscator settings again. I append 200 messages to the server with no errors, please help to try again.

http://www.aspose.com/products/Aspose.Network/Releases/3.6.0/Aspose.Networkv3.6.3.1.zip

Thanks for your help. I really apprecate that.

Best Regards.

Yes, I think this build works!! I just did some quick tests, and it seems good.

Thanks for all the effort here!!

-Ed

Dear Ed,

Thanks for your help on this.

If everything goes fine, could you please remove the debugging mail account provied to us?

Best regards.