[jcifs] how to authenticate, NTLM protected IMAP/POP3 server (Microsoft-exchange)

Michael B Allen mba2000 at ioplex.com
Wed Jul 7 21:52:48 GMT 2004


Hemanth Kumar A said:
> Hi,
> I was trying to write a client program which will connect to NTLM enabled
> IMAP/POP3
> server like Microsoft exchange) using javamail.
>
> When I was trying to implement jcifs, I am able to authenticate with the
> following code
>
> NtlmPasswordAuthentication auth =
>    new NtlmPasswordAuthentication("CORRECT.DOMAIN", "user1", "secret");
> SmbSession.logon(new
> UniAddress(InetAddress.getByName("correct.servername.com")),auth);

This does NTLM authentication with a CIFS server not POP3 or IMAP.

> But how can I correlate above jcifs mechanism into the following situation
>
> POP3Client pop = new POP3Client(); -
> pop.setHost("correctservername");
> pop.setUser("user1");
> pop.setPassword("secret");
> pop.connect(); - This throws "connection refused" error(which is correct
> behavier).
>
> Please can some suggest me, how can achive NTLM authentication for
> IMAP/POP3 server from my client program using jcifs API.

JCIFS and NTLM authentication with POP3/IMAP are largely unrelated. You
have to do what is outlined here:

http://davenport.sourceforge.net/ntlm.html#ntlmPop3Authentication

The jcifs/http/NtlmSsp.java code and friends might help.

Mike


More information about the jcifs mailing list