Please UseCodeTags next time. I've added them for you this time.
Yashwant Palkar wrote:its giving me an error 530 5.7.1 Client was not authenticated
DEBUG SMTP: got response code 530, with response: 530 5.7.1 Client was not authenticated
It seems you need to login to use this SMTP server.
Try sending like this, instead of using Transport.send(msg):
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP: check mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM
DEBUG SMTP: mechanism LOGIN not supported by server
DEBUG SMTP: mechanism PLAIN not supported by server
DEBUG SMTP: mechanism DIGEST-MD5 not supported by server
java.lang.ClassNotFoundException: jcifs.ntlmssp.Type1Message
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sonicsw.mf.framework.agent.ClassLoaderFactory$DelegateLoader.loadClass(ClassLoaderFactory.java:595)
at com.sonicsw.mf.framework.agent.ClassLoaderFactory$DelegateLoader.loadClass(ClassLoaderFactory.java:553)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.mail.auth.Ntlm.generateType1Msg(Ntlm.java:65)
at com.sun.mail.smtp.SMTPTransport$NtlmAuthenticator.getInitialResponse(SMTPTransport.java:784)
at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:623)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:583)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
I am getting this error while using this code.
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
0
We don't know what "this code" is, but jCIFS is not part of JavaMail or JEE, so it must be used by some other component, possibly the "com.sonicsw.mf.framework" stuff. It has in any case nothing to do with JavaMail.
I advise to get the mail part working as a standalone application -like you did at first- before trying to integrate it elsewhere.
Yashwant Palkar
Greenhorn
Joined: Dec 01, 2010
Posts: 20
posted
0
I have tried it with simple java code.
still giving same error
This is log I am getting from code.
250-SIZE
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-X-ANONYMOUSTLS
250-AUTH NTLM
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-XEXCH50
250 XRDST
DEBUG SMTP: Found extension "SIZE", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "X-ANONYMOUSTLS", arg ""
DEBUG SMTP: Found extension "AUTH", arg "NTLM"
DEBUG SMTP: Found extension "X-EXPS", arg "GSSAPI NTLM"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "XEXCH50", arg ""
DEBUG SMTP: Found extension "XRDST", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<yashwant.palkar@xxx.com>
530 5.7.1 Client was not authenticated
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at TestEMail.main(TestEMail.java:46)
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at TestEMail.main(TestEMail.java:46)
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
0
Show us the code that performs the authentication; is it being called?
Lester Burnham wrote:We don't know what "this code" is, but jCIFS is not part of JavaMail or JEE, so it must be used by some other component, possibly the "com.sonicsw.mf.framework" stuff. It has in any case nothing to do with JavaMail.
I think that's not correct. I believe that recent versions of JavaMail have attempted to include NTLM authentication, and for that they simply used jCIFS to do the authentication. I don't know whether that resulted in a requirement to include jCIFS as a dependency or whether it was somehow included directly in the mail.jar, I'm just saying this based on answers I remember seeing on other forums which were posted by the author of JavaMail.
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
0
I stand corrected: JavaMail doesn't ship with jCIFS, but it can make use of it for NTLM authentication. That's documented in the NTLMNOTES.txt file in the JavaMail distribution.