Four Stars

tPop component - Opening gmail, downloading .zip file to hard drive

Hi Forum,
I am trying to open gmail using tPop compoent. It is giving me the below error mentioned. How to solve this ?
I have given the below details.
Host: "pop.gmail.com"
Port :995
Username : mygmail@gmail.com
Password : mypassword
Output directory : location of a folder in my hard drive(Windows machine)
File Name pattern : TalendDate.getDate("yyyyMMdd-hhmmss") + "_" + (counter_tPOP_1 + 1) + ".mail"
Number of emails to retrieve : 1
Choose the protocol : pop3
Use SSL : checked
Where Am I missing ?
Error message :
-------------------
connecting to socket on port 3509
connected
Exception in component tPOP_1
javax.mail.MessagingException: Connect failed;
nested exception is:
java.net.UnknownHostException: pop.gmail.com
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:210)
at javax.mail.Service.connect(Service.java:295)
at agrometrics.email_data_0_1.email_data.tPOP_1Process(email_data.java:279)
at agrometrics.email_data_0_1.email_data.runJobInTOS(email_data.java:553)
at agrometrics.email_data_0_1.email_data.main(email_data.java:421)
Caused by: java.net.UnknownHostException: pop.gmail.com
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:288)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
at com.sun.mail.pop3.Protocol.<init>(Protocol.java:107)
at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:261)
disconnected
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:206)
... 4 more
Job email_data ended at 10:37 01/11/2013.
11 REPLIES
Moderator

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Hi,
First of all, make sure the net work is good.
Have a try to set the host as "smtp.gmail.com" not "pop.gmail.com".
See my screenshots
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Either ways I tried. Do I need to set any settings in gmail Accounts (POP/SMTP enabled). Already POP is by default enabled. SMTP is not enabled.
I found differences b/w POP and SMTP here
http://www.active-server.com/blog/differences-between-imap-pop-and-smtp/
Last but not the least, I want to download the attached .zip file from email so I must work with POP rather SMTP, right ?
More over, Network is working properly.

Smiley Sad
Moderator

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Hi,
Can you ping your gmail from cmd? Ip address is also Ok for Host entry.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Please find the attached images.. Original credentials(A trail email id and password - there is an attached file in this email).

After the images I am showing the error message here.

Starting job email_data at 12:37 01/11/2013.

connecting to socket on port 3798
connected
Exception in component tPOP_1
javax.mail.MessagingException: Connect failed;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:210)
at javax.mail.Service.connect(Service.java:295)
at agrometrics.email_data_0_1.email_data.tPOP_1Process(email_data.java:287)
at agrometrics.email_data_0_1.email_data.runJobInTOS(email_data.java:561)
at agrometrics.email_data_0_1.email_data.main(email_data.java:429)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
disconnected
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:507)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)
at com.sun.mail.pop3.Protocol.<init>(Protocol.java:107)
at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:261)
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:206)
... 4 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 17 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
... 23 more
Job email_data ended at 12:37 01/11/2013.
Four Stars

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Talend Open Studio for DI version is : 5.1.3.r96646
Moderator

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Hi,
javax.mail.MessagingException: Connect failed;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

From the error information, something wrong your certification(The server certification is expire or not to be trusted?).
You'd better contact to your administrator to make a confirmation.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Hi,
something wrong your certification(The server certification is expire or not to be trusted?)

What is certification ? I am new to this kind of work. I am alone here so I can not contact administrator who may solve this.
Please provide me more inputs.
Thank you.
Sadakar
BI developer
Moderator

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Hi,
Here is an article about http://stackoverflow.com/questions/9619030/resolving-javax-net-ssl-sslhandshakeexception-sun-securit..., hope it will be useful for you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Hi,
               I to have the same requirement that to download the file from email am also getting the same error and i tried all the ways which are showed in the forum. the link i couldn't understood what to do in talend can any one help me out in this?
Thanks,
Lmit
Moderator

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Hi Lmit,
You need to set key store via tSetKeystore.
For information about keystore look at this http://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tPop component - Opening gmail, downloading .zip file to hard drive

Hi,
I'm trying to get emails from the company's server. I set all the parameters of tpop but it give me this error:
Exception in component tPOP_1
javax.mail.MessagingException: Connect failed;
  nested exception is:
java.net.UnknownHostException: mail.company-name.com 
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:148)
at javax.mail.Service.connect(Service.java:275)
at demo.mongodb_emails_child_biware_0_1.mongodb_emails_child_biware.tPOP_1Process(mongodb_emails_child_biware.java:649)
at demo.mongodb_emails_child_biware_0_1.mongodb_emails_child_biware.runJobInTOS(mongodb_emails_child_biware.java:1779)
at demo.mongodb_emails_child_biware_0_1.mongodb_emails_child_biware.main(mongodb_emails_child_biware.java:1577)
Caused by: java.net.UnknownHostException: mail.company-name.com 
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
connecting to socket on port 3352
connected
disconnected
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.pop3.Protocol.<init>(Protocol.java:81)
at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:201)
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:144)
Can someone help please.