Results 1 to 4 of 4

Thread: Zimbra closing active IMAP connections

  1. #1 is offline Starter Member
    Join Date
    Jul 2009
    Rep Power

    Default Zimbra closing active IMAP connections


    I'm having a problem attempting to move a large mailbox from one Zimbra server to another (ZCS 5.0.9) using imapsync. The imapsync appears to be failing on the same message (a large file) on every attempt.

    I believe from the below logs that the Zimbra SessionCache is timing out the session because it has seen no new commands even though the Zimbra IMAP library is continuing to transfer data...
    2009-07-24 11:04:09,288 INFO  [Timer-3] [] SessionCache - Removed 1 idle sessions (IMAP). 34 active sessions remain.
    2009-07-24 11:04:09,307 INFO  [ImapSSLServer-27510] [] ProtocolHandler - Exception occurred while handling connection Socket is closed
            at com.zimbra.cs.imap.ImapHandler.fetch(
            at com.zimbra.cs.imap.ImapHandler.doFETCH(
            at com.zimbra.cs.imap.ImapHandler.executeRequest(
            at com.zimbra.cs.imap.TcpImapHandler.processCommand(
            at com.zimbra.cs.tcpserver.ProtocolHandler.processConnection(
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Source)
    I have run imapsync in debug mode and the server is clearly continuing to transfer the message until the socket is closed by the SessionCache underneath it.

    Does anyone know of any variables that I can tweak to extend the session cache timeout for IMAP connections?

    -- Greg

  2. #2 is offline Starter Member
    Join Date
    Jul 2009
    Rep Power


    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/
    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/
    public void requestReceived(MinaRequest req) throws IOException {
    if (i4selected != null)
    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/
        /** 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

  3. #3
    marcusg is offline Intermediate Member
    Join Date
    Jan 2011
    Rep Power

    Default Bump...

    I'm having the same issue, only it's because the user has so many folders while imapsync is calculating the folders zimbra times out and it all dies from there.

    Did you ever open a bug for this?
    If so where?

    Did it ever get resolved?
    If so how?

  4. #4
    FritzBrause is offline Partner (VAR/HSP)
    Join Date
    Jan 2008
    Berlin, Germany
    Rep Power


    you may try imapsync with the following options:

    –-nofoldersizes –-useheader Message-ID –-fast
    This will prevent timeouts in most cases unless mailboxes are really huge.

    The problem is not the Zimbra IMAP Timeout value but imapsync calculation of folder- and messagesizes.
    Best regards

    Andreas Wolske GmbH

    Zimbra Cloud Hosting, Consulting & Support
    VMware vCloud Powered Serviceprovider

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Sudden problem synching with gmail
    By bouchardpie in forum Error Reports
    Replies: 8
    Last Post: 09-09-2010, 09:50 AM
  2. [SOLVED] Zimbra logwatch.
    By nishith in forum Administrators
    Replies: 5
    Last Post: 06-10-2009, 04:42 PM
  3. slapd message error
    By smoke in forum Administrators
    Replies: 7
    Last Post: 04-27-2008, 03:23 PM
  4. Replies: 12
    Last Post: 02-25-2008, 07:28 PM
  5. [SOLVED] Clamav problem ? What's happening ?
    By aNt1X in forum Installation
    Replies: 23
    Last Post: 02-14-2008, 05:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts