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

Email2Case - can't connect to email server

i am trying to set up the email2case plugin, and have all the correct settings (I think).  I have specified to use port 143 on our exchange server, and verified that my username and password are correct.  However, when I launch the program I get this message:
User: xxxx
Message: * BYE Connection refused;
  nested exception is:
        com.sun.mail.iap.ConnectionException: * BYE Connection refused
Any ideas?
Always ThinkinAlways Thinkin
I got the same message until I change the port to 993 for SSL. That changed the behavior. Instead of getting the BYE message, I got no message for 30 minutes. After 30 minutes, I got:
2007-05-01 15:52:08,990 1855629 [Timer-0] ERROR com.sforce.mail.GenericClient  - Unable to connect to mail service.
Message: ;
  nested exception is:

Even though I had my <interval> set to 1 minute (while testing), it waited 30 minutes to poll.

Still banging away at the problem and wishing there was more reference material for the code.
Was there any solution for this issue as I have just installed the email2case add-on and am getting the same error message. Everything looks fine with my config files but get an error message

2007-05-02 09:08:06,513 1985 [main] INFO  com.sforce.SalesforceAgent  - Service\clarkb:Inbox successfully registered
2007-05-02 09:08:06,513 1985 [main] INFO  com.sforce.SalesforceAgent  - com.sforce.mail.EmailService  loaded as a timer service.
2007-05-02 09:08:27,638 23110 [Timer-0] ERROR com.sforce.mail.GenericClient  - Unable to connect to mail service.
User: xxxxxxx\clarkb

Message: Connection timed out: connect;
  nested exception is: Connection timed out: connect
2007-05-02 09:10:27,514 142986 [Timer-0] ERROR com.sforce.mail.GenericClient  - Unable to connect to mail service.
User: xxxxx\clarkb
I finally figured out the issue we were having.  The IMAP service was not set up correctly on the Exchange server, so we had to get our IT team to help figure out the connection issues.  We do not use the SSL port 993; we just use the default.  According to the IT team here, there were also some security settings that were causing the email2case to not be able to connect.
You should make sure the IMAP service on your exchange server is running and accepting connections.  To do this, open up a command line (Start->Run, then type cmd).  At the command prompt type:
telnet  <your_exchange_server_ip>   143
If the service is running you will get an 'OK' response.  This should at least tell you if its an exchange issue or an email2case issue.
Always ThinkinAlways Thinkin
The solution that worked for me was to set the <protocol> in the email2case.txt file to IMAPS instead of just IMAP since I was going through port 993 to use SSL.

Once I made that change, the connection worked and the interval performed as expected.

I found the solution in the Solutions knowledge base in my instance of Sf, there were quite a few other articles in there as well dealing with email2case. I noted that several people had been referred to Sf Customer Support and whenever that's the case, you often find their answers in Solutions, but not here.
Thanks for your quick replies.
Our Exchange server was locking the IMAP service to internal addresses on the LAN. We put in an entry for the salesforce add-in and this resolved the problem.
Thanks for the advice on the solutions in the knowledge base. I'm sure I'll find lots of interesting articles in there to keep me busy with customizing salesforce over the coming weeks.
Vijay RautVijay Raut
Hi Bazza,
I am facing following problem in Email2Case Agent.
If anyone having any idea about same ...... then please do reply to this blog.
I have tried out solution provided by you but..... no breakthrough.... :-(
Following is the error snapshort....
2007-06-07 18:15:14,138 [Thread-1] ERROR Unable to connect to mail service.
User: xxxx.xxxx.xxxx
Message: Connection timed out: connect;
  nested exception is: Connection timed out: connect
Thanks in Advance

Hi Vijay,

Ensure you have got the right settings in the two txt files that you configure as part of the plugin. It may be a small error that is causing authentication failure with your mail server. Other than that check the settings on your mail server to allow connections from the internet (you may want to lock access down to's IP address).

Hope this helps.


Vijay RautVijay Raut

Hi Barry,

Thnx lot for quick reply...

I have checked my txt files..... they are perfect.

About network..... do you mean to say i have to allow IP of SFDC in my smtp server?