Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
oguedda
Contributor III
Contributor III

Error using tsendmail

Hi All,

I am getting below error while tsendmail component

Exception in component tSendMail_1

Platform: Talend Open Studio 7.3.1

I am using a private mail server

i am using the SSL certificate and without any certificate in SMTP port 25 it works

Even with STARTTLS does not work

Exception in component tSendMail_1 (test_job

_piiff

)

javax.mail.MessagingException: Exception reading response;

 nested exception is:

     javax.net.ssl.SSLException: Unsupported or unrecognized SSL message

     at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462)

     at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)

     at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)

     at javax.mail.Service.connect(Service.java:297)

     at javax.mail.Service.connect(Service.java:156)

     at javax.mail.Service.connect(Service.java:105)

     at javax.mail.Transport.send0(Transport.java:168)

     at javax.mail.Transport.send(Transport.java:98)

     at local_project.test_job_piiff_0_1.test_job_piiff.tSendMail_1Process(test_job_piiff.java:8538)

     at local_project.test_job_piiff_0_1.test_job_piiff.tREST_1Process(test_job_piiff.java:8167)

     at local_project.test_job_piiff_0_1.test_job_piiff.runJobInTOS(test_job_piiff.java:8824)

     at local_project.test_job_piiff_0_1.test_job_piiff.main(test_job_piiff.java:8673)

Caused by: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message

     at sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(Unknown Source)

     at sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)

     at sun.security.ssl.SSLTransport.decode(Unknown Source)

     at sun.security.ssl.SSLSocketImpl.decode(Unknown Source)

     at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)

     at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)

     at sun.security.ssl.SSLSocketImpl.ensureNegotiated(Unknown Source)

     at sun.security.ssl.SSLSocketImpl.access$200(Unknown Source)

     at sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)

     at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)

     at java.io.BufferedInputStream.fill(Unknown Source)

     at java.io.BufferedInputStream.read(Unknown Source)

     at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)

     at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440)

     ... 11 more

0695b00000H8IrCAAV.png

Please help me out in resolving the same.

Thanks,

Oussama

Labels (2)
11 Replies
gjeremy1617088143

HI Oussama , maybe the port is wrong

could you try 465 instead?

maybe you have to add the certificate before sending the mail :

https://community.talend.com/s/article/Three-ways-to-set-a-truststore-for-an-SSL-TLS-connection-in-a...

Send me Love and Kudos

oguedda
Contributor III
Contributor III
Author

Hello gjeremy

Thanks for the reply.

I also tried with port 465 but I had the same error.

I will try to add another component to import the certficat into the job.

Best regards,

Oussama.

 

Anonymous
Not applicable

Hello,

Does this problem come from TLS1.2?

As explained in this page, the TLS 1.0 and TLS 1.1 has been disabled in JDK 8 or 11, try the solutions and let me know if it works.

In addition to that, if you want SSL to be enforced, you may have to include a tSetKeyStore component and give the path where your cert/jks is placed. tSetKeyStore should be before tSendMail

Best regards

Sabrina

 

oguedda
Contributor III
Contributor III
Author

Hello Sabrina,

Thanks for the reply,

 

I checked in the security files but the TLS is not disabled as mentioned on the article and I added the tkeystore to enforced the ssl but I still have the same problem.

 

0695b00000H8UxlAAF.pngreally for once I don't see where the problem could come from 😔

 

Best regards

Oussama

gjeremy1617088143

Maybe your proxy or firewall is the problem

oguedda
Contributor III
Contributor III
Author

I don't think so because I managed to send mail without an ssl or tls certificate on port 25. Is there a way to check if the problem comes from the firewall or the proxy ?

 

gjeremy1617088143

i had the same problem a year ago , when i used port 25 there is no issue but when i use an office365 mail with port 587 it wont work.

you could use telnet to check your smtp port.

you can also create a simple talend job who just send a mail and deploy it an run it on your mail server.

oguedda
Contributor III
Contributor III
Author

I have already tested telnet on port 587 of my mail server and it worked, that's why i thought that really the problem is not with my server but with my talend script. So how did you manage to solve your problem?

 

gjeremy1617088143

have you tried with port 465 for SMTPS ?