We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

NTLM on Pop3 client

Hello,
I have a developer OEM subscription for Aspose.Email
My application uses aspose pop3 client to connect to exchange and download email
Now, i need to configure it on a scenario, where (i suppose) exchange is configured to NTLM.
If i try with thunderbird or other, i set “NTLM” in the “authentication method” dropdown, and it works.

How should i configure the aspose pop3 client?

Thanks

Best regards,
Andrea

Hi Andrea,


We are sorry for a delayed response.

At present, I could not find any such option of setting the NTML with Pop3 client. I have requested information from development team and will update you shortly as soon as the information is available. Please spare us a little time in this regard.

Hi Andrea,


I have logged this issue for our development team’s consideration as NETWORKNET-33952 in our issue tracking system and have linked this thread with the logged ticket. Once the fix version is available in this regard, we’ll update you here.

As a side note, with the upcoming release of Aspose.Email, we have implemented the support for authentication using Default Credentials in our ImapClient component that you can use to access mail on exchange server.

hello,
thank you for your attention.
At the moment, i conviced my customer to change the Exchange settings, and remove the NTLM authentication from the POP3 settings, so my application can work.
My application is very light and multi-purpose so i decided not to use IMAP.

Thank you

best regards,
Andrea

Hi Andrea,


Thanks for sharing the feedback.

Its good that for time being you have managed to get the solution of the problem by removing the NTLM authentication. However, if it is required, then you can use the fix version once it is available.

Hi Andrea,


Could you please try the latest version of Aspose.Email for .NET 3.2.1 for this requirement and let us know your feedback? We have included the support for NTLM in this version and would request you to please provide us your feedback. We are collecting test results on different servers and your feedback will be of vital importance in this regard. We appreciate your cooperation in this regard.

hello,
donwloaded the new release, but i cannot find “how” should i specify the NTLM option in POP3 client…

Thanks

Andrea

Hi Andrea,

Please have a look at the following code sample for your kind reference where UseDefaultCredentials flag is set to true for this purpose.

Code Sample:

using (Pop3Client popClient = new
Pop3Client(“[pop-server.com](http://pop-server.com/)”,
995))<o:p></o:p>

{

popClient.EnableSsl = true;

popClient.SecurityMode = Pop3SslSecurityMode.Implicit;

popClient.UseDefaultCredentials = true;

Console.WriteLine("Pop3 client is connecting...");

popClient.Connect(true);

Console.WriteLine("Pop3 client has been connected successfully.");

Pop3MessageInfoCollection messageInfoCol = popClient.ListMessages();

Console.WriteLine(string.Format("Inbox contains: {0} messages", messageInfoCol.Count));

}

Hello,
i'm going to test your code, but i think there's something missing.
If you don't provide the "usual" username and password, which mailbox are you entering in?

In other words... if i'm right, NTLM (default credentials) it's about secure authentication... instead of kerberos or something else.
So, once authenticated the "connection", you have to provide the login information to the pop3, in order to open a certain mailbox.

Anyway... look at a non-microsoft email client (any client different from outlook), go to the account options, then server options.
NTLM is on a dropdown called "authentication method", under "Security settings".... it's not a replacement for the username/password of the mailbox.

So.... if i use your code, it goes ok on Connect(), but when i ListMessages() i get this error: "The server returned an invalid response to the UIDL command."


If I add the login information, just like:
popClient.Username = "user";
popClient.Password = "pass";

then i get this error on Connect(): "User command error:-ERR Command is not valid in this state.User command error:-ERR Command is not valid in this state."

Hi Andrea,


We use NTLM for default user where user name and password is not required as the main reason to use NTLM is possibility to use default credentials. And with default credentials used, we don’t have to use Username and password as these are obtained from the underlying OS. You can have a look about such information in the articles as follow:

Regarding the error you mentioned, it seems that the connection has been set successfully and the problem arises at some other point. Could you please tell us:

  1. Which server version you are using?
  2. code snippet that gives raise to this error and your network setup details?
Also, can you please try the IMAP the same way as you have tried my code for POP3 and see what is the behavior. Please let us know your feedback and we’ll look into it for further assistance to you.

Hello,

I know a few about NTLM, and how should be used.....

Anyway, it's possible to use NTLM in combination with basic authentication. If you open the configuration of any email client (not Outlook) you can see how is used... In my scenario, i need NTLM to authenticate against the Exchange server, and the basic authentication to gain access to the right mailbox.

I configured my email client (seamonkey or thunderbird), and it works fine, with NTLM enabled.

About the server, i'm testing on Exchange 2010 SP3, configured for NTLM using this settings:

http://technet.microsoft.com/en-us/library/bb124498%28v=exchg.141%29.aspx

About my codde, here is the code:

Pop3Client myClient = new Aspose.Email.Pop3.Pop3Client();

myClient.UseDefaultCredentials = true;

myClient.Host = "SERVERNAME";

myClient.Port = 110;

myClient.Username = "Andrea";

myClient.Password = "password";

myClient.Connect(true);

Pop3MessageInfoCollection messageInfoCol = myClient.ListMessages();

myClient.Disconnect();

myClient.Dispose();

If i run it with username and password, i get this error on the "Connect()" command:

"User command error:-ERR Command is not valid in this state.User command error:-ERR Command is not valid in this state." "User command error:-ERR Command is not valid in this state.User command error:-ERR Command is not valid in this state."

If i remove the lines with username and password, i get this error on the "ListMessages()" command:

"The server returned an invalid response to the UIDL command.The server returned an invalid response to the UIDL command."

Hi Andrea,


Thank you for the feedback.

I have reopened the ticket attached to this issue for further investigation by the development team. We will write back here in case we need some additional information or have an update for you. We regret the inconvenience caused to you in this regard.