I spent a bit more time digging through Zimbra code and I've come to believe that this may be a bug. I will file shortly unless anyone disagrees.
Here are the two problems I found:
1. The Imap idle connection timeouts are hard-coded to 30 minutes
From cs/imap/ImapFolder.java
Code:
public static final int IMAP_IDLE_TIMEOUT_SEC = 30 * Constants.SECONDS_PER_MINUTE;
public static final long IMAP_IDLE_TIMEOUT_MSEC = IMAP_IDLE_TIMEOUT_SEC * Constants.MILLIS_PER_SECOND;
...
getSessionIdleLifetime() then returns IMAP_IDLE_TIMEOUT_MSEC;
2. The lastAccessed variable on the session is only updated when a new request is received.
From cs/imap/MinaHandler.java
Code:
public void requestReceived(MinaRequest req) throws IOException {
...
if (i4selected != null)
i4selected.updateAccessTime();
... If an underway request is not finished before the 30 minutes timeout the session will be expired by the SessionCache manager.
From the documentation of SessionCache in cs/session/SessionCache.java:
Code:
/** Adds a {@link Session} to the cache and assigns it a session ID if it
* doesn't already have one. When a reigistered <code>Session</code> ages
* out of the cache due to extended idle time, its {@link Session#doCleanup()}
* method is invoked and its session ID is unset.
* @param session The <code>Session</code> to add to the cache
* @return the session ID assigned to the Session
* @see Session#getSessionIdleLifetime() */ I believe that I'm running into a problem where I have a very large message that is taking longer than 30 minutes to transfer. Since the Imap client does not make any new requests in those 30 minutes (its still processing its last request) the SessionCache manager expires its session which causes the connection to get closed which results in the traceback from my original post.
-- Greg