adexcel / exjello

Automatically exported from code.google.com/p/exjello
MIT License
0 stars 0 forks source link

mail box login timeout in 20mins? #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
start a pop3 email receiver for about 20 mins then it throws 
IllegalStateException because of http440

What is the expected output? What do you see instead?
the expected output should be attempting to receive mail, but instead it throws 
the exception

What version of the product are you using? On what operating system?
exjello1.0, Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by qiaojunw...@gmail.com on 13 Jun 2011 at 8:25

GoogleCodeExporter commented 8 years ago
https://jira.springsource.org/browse/INT-1942?focusedCommentId=68309#comment-683
09
please take a look at the thread. it is discussing about the problem. 

Original comment by qiaojunw...@gmail.com on 11 Jul 2011 at 9:01

GoogleCodeExporter commented 8 years ago
We originally suspected that there is a problem with the spring mail 
integration library, but after investigating a little bit (and with the help 
from the spring community) we realized that the problem is in exjello library.

The root problem is that the connection for exchange times out (I don't have a 
good explanation why that happens - could be just a security measure for the 
exchange server we use).

In terms of code, as Oleg Zhurakousky of springsource pointed out, the 
following piece of code fails on us (method listFolder in ExchangeConnection):
        int status = client.executeMethod(op);
        stream = op.getResponseBodyAsStream();
        if (status >= 300) {
          throw new IllegalStateException("Unable to obtain " + folder + ".");
        }

What I did as a workaround is the following (all changes are in 
ExchangeConnection):
- created a method that checks if the user is authenticated (isAuthenticated).
- changed the isConnected method to enforce a reconnect:
      if (!isAuthenticated()) {
        connect();
      }
Of course, this is a workaround (with some hazardous potential) and a cleaner 
solution needs to be elaborated, but I think that the concept/direction is 
pretty good: don't let exceptions run away from exjello if session timed out 
(HTTP 440).
I am attaching my version of ExchangeConnection - please don't use it as it is, 
as I didn't do deep testing for it.

Original comment by cristian...@gmail.com on 14 Jul 2011 at 9:23

Attachments: