function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
narendra.metacunarendra.metacu 

Email2case : Failed to connect to SFDC service

I am getting this error and cant get solution after heavy solution in email2case

Attempting to start service com.sforce.mail.EmailService with configuration file D:\\EmailAgent\\email2case.txt


[main] ERROR com.sforce.mail.GenericClient  - Failed to connect to SFDC service

com.sforce.ws.ConnectionException: Failed to send request to https://www.salesforce.com/services/Soap/u/8.0

    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:79)
    at com.sforce.soap.partner.wsc.PartnerConnection.login(PartnerConnection.java:734)
    at com.sforce.mail.GenericClient.login(GenericClient.java:267)
    at com.sforce.mail.GenericClient.getConnection(GenericClient.java:179)
    at com.sforce.mail.GenericClient.<init>(GenericClient.java:135)
    at com.sforce.mail.ImapClient.<init>(ImapClient.java:40)
    at com.sforce.mail.ImapSSLClient.<init>(ImapSSLClient.java:31)
    at com.sforce.mail.EmailService.loadService(EmailService.java:156)
    at com.sforce.SalesforceAgent.main(SalesforceAgent.java:138)
Caused by: java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
    at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:99)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:72)

email2case.txt :
<configFile>
    <server1>
        <url>smtp.xyz.com</url>
        <protocol>IMAPS</protocol>
        <userName>abc@xyz.com</userName>
        <password>********</password>
    <port>465</port>
        <interval>10</interval>
        <inbox>Inbox</inbox>
        <readbox>Read</readbox>
        <errorbox>Errors</errorbox>
    </server1>
</configFile>


<configFile>
    <sfdcLogin>
        <url>https://www.salesforce.com/services/Soap/u/8.0</url>
        <userName>abc@xyz.com</userName>
        <password>*****************************</password>
        <loginRefresh>1</loginRefresh>
        <timeout>15</timeout>
    </sfdcLogin>
    <notify>
        <notifyEmail>abc@xyz.com</notifyEmail>
        <from>abc@xyz.com</from>
        <host>https://mail.google.com</host>
        <port>993</port>
        <user>narendra.metacube@gmail.com</user>
        <password>********</password>
        <service>com.sforce.mail.SMTPNotification</service>
    </notify>
    <attachments>
        <largeAttachmentDirectory>D:\\EmailAgent\\</largeAttachmentDirectory>
        <largeAttachmentURLPrefix>D:\\EmailAgent\\</largeAttachmentURLPrefix>
<largeAttachmentSize>5</largeAttachmentSize>
    </attachments>
    <services>
        <com.sforce.mail.EmailService>D:\\EmailAgent\\email2case.txt</com.sforce.mail.EmailService>
    </services>
</configFile>

Pat McQueenPat McQueen
Hello,

The connection timeout that you see is typically beacuse the host can not reach salesforce.com.  Can you ping salesforce.com from that host?  Should you configure a proxy?

Pat
narendra.metacunarendra.metacu
yes you are right

https://www.salesforce.com/services/Soap/u/9.0 it was the url i given in sfdcconfig.txt but the url is ...soap/u/8.0 as i checked on my apex explorer.

now its working fine
thanks
mjackmetavantemjackmetavante
I'm seeing the same problem. Apex Explorer is able to connect, but the email2case agent is encountering errors even though they are using the same URL and credentials. Any thoughts?
456456

Hi,

 

I have indeed problems with the EmailAgent to connect to SFDC via a proxy.

Is it possible for the EmailAgent to go through a proxy?

I cannot find any settings in the config files who can do so.

 

Thanks!

Marc

 

stmfaizanstmfaizan

Hi, 

I have a similar issue and want to know how to overcome this.

 

Can you ping salesforce.com from that host?  - How to ping salesforce.com and how to find out the host?

Please suggest.

 

Regards,

StmF