I’m able to connect to hMailServer mailbox over IMAP/TLS using Outlook but Aspose.Mail throws an exception.
System.OperationCanceledException
HResult=0x8013153B
Message=Operation has been canceled
Source=Aspose.Email
StackTrace:
at #=zHdLovjEEIod1mV72IF09M1E9Zvpw.#=zBGkfXas=(IAsyncResult #=zS9deMoU=)
at #=zHdLovjEEIod1mV72IF09M1E9Zvpw.#=zsFvFw3A=()
at #=z5f$tMCpGuWPXNsZ4baqOjm5cEK2YH2NSd_RI70U=.#=z8nYA1rQ=(#=zYRwXGXKU9cRRmCIKilOt9F_OXQBfkBaQ6w== #=zTDXZlVY=)
at #=zu$FnsJBaomaGGgGs$h2dPwP9seOK.#=zALMMRY$3NG8v(Int32 #=zioqX20U=, #=zYRwXGXKU9cRRmCIKilOt9F_OXQBfkBaQ6w== #=zJ5$sVuc=)
at #=zHdLovjEEIod1mV72IF09M1E9Zvpw.#=zr6S0mjEYND1Y()
at #=zHdLovjEEIod1mV72IF09M1E9Zvpw.#=znDtpZrs=(AsyncCallback #=z8q99aUU=, Object #=z2RXhc3k=)
at Aspose.Email.Clients.Imap.ImapClient.BeginListMessages(IConnection connection, String folderName, Int64 modificationSequence, Boolean retrieveRecursively, IEnumerable`1 messageExtraFields, AsyncCallback callback, Object state)
at Aspose.Email.Clients.Imap.ImapClient.ListMessages(String folderName)
at ConsoleApp13.Program.Main(String[] args) in …\Visual Studio 2017\Projects\ConsoleApp13\ConsoleApp13\Program.cs:line 25
Using the following code to connect
var client = new ImapClient();
client.Host = "127.0.0.1";
client.Port = 993;
client.Username = "...";
client.Password = "...";
client.SecurityOptions = SecurityOptions.SSLImplicit;
client.SupportedEncryption = EncryptionProtocols.Tls12;
var messages = client.ListMessages("Inbox");
I have observed the information shared by you. Can you please share the credentials for the test account that is reproducing issue on your end and that we may use on our end to verify the issue. Please share the requested information so that we may proceed further to help you out.
I can’t see how that would possibly matter but fine by me.
The following code works just fine, IMAP over unencrypted connection
static void Main(string[] args)
{
var client = new ImapClient();
client.Host = "127.0.0.1";
client.Port = 143;
client.Username = "jira";
client.Password = "jira123";
var messages = client.ListMessages("Inbox");
}
The following fails, only difference is the SSL certificate and TLS encryption on 993. Connecting using Outlook or other commercial e-mail clients works fine.
Thank you for sharing the information with us. I have been able to observe the issue and a ticket with ID EMAILNET-39583 has been added in our issue tracking system to further investigate and resolve the ticket. This thread has been linked with the issue so that you may be notified once it will be addressed.
I like to inform that this issue has been marked resolved in 19.11 and. This version of Aspose.Email will be rolled out soon for customers. I request for your patience.
Hi @Adnan.Ahmad,
we have now tried version 19.11 with the exact same setup as originally described in this post and we still get the EXACT same error. How is it exactly you have resolved this problem?
To verfiy my email server and TLS setup I tried using the S22.Imap client libary with the following source code and it works just fine.
using (var client = new ImapClient("127.0.0.1", 993, "...", "...", AuthMethod.Login, true))
{
var uids = client.Search(SearchCondition.Unseen());
var messages = client.GetMessages(uids);
Console.WriteLine($"Found {messages.Count()} messages.");
}
If we were not already heavily invested in the Aspose.Mail client library for e-mail post processing I would not mind switching to the S22 libraries, but this would amount to a lot of development and testing resources being redirected. We would prefer if you could solve this issue as promised, twice…
NO, all the code you need is included in my first post… The certificate is installed on the email server, you shouldn’t load the certificate from the client certificate store.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.