Uploaded image for project: 'Alfresco'
  1. Alfresco
  2. ALF-21637

IMAP server immediatly closes connection on IMAP SEARCH commands

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Community Edition 201602 GA
    • Fix Version/s: None
    • Component/s: IMAP
    • Security Level: external (External user)
    • Labels:
      None
    • Environment:
      Server: Ubuntu Server 14.04, Alfresco Community 201604
      Clients: Windows 10, tested with Outlook 2013 and Windows Mail 17.6868
    • Security Severity:
      None
    • Triage:
      ACE

      Description

      The Outlook Clients we tested with (versions below) issue a "UID SEARCH" or "SEARCH" command shortly after authenticating to an IMAP server - like this:

      SEARCH UNDELETED SINCE 11-Feb-2016
      or
      UID SEARCH SINCE 08-May-2016

      All SEARCH commands fail on Alfresco community 201604 - no result to the SEARCH command is returned, and the IMAP connection either runs into a timeout, or is closed immediately. It does not seem to matter if SEARCH or UID SEARCH is used, or which SEARCH expression

      Example session with telnet:

      1 login admin password
      1 OK LOGIN completed.
      2 select INBOX

      • 10 EXISTS
      • 0 RECENT
      • OK [UNSEEN 2] Message 2 is the first unseen
      • OK [UIDVALIDITY 1462872941] UIDs valid
      • OK [UIDNEXT 889] Predicted next UID
      • FLAGS (\Answered \Deleted \Draft \Flagged \Seen)
      • OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen)] Limited
        2 OK [READ-WRITE] SELECT completed.
        3 SEARCH SEEN
        Connection closed by foreign host.

      This renders IMAP completly useless for Outlook Clients - no mails are displayed.

        Attachments

          Issue Links

            Activity

            Hide
            deas0815 Andreas Steffan added a comment - - edited

            Ok, I tracked this down.

            Turns out that Alfresco 5.1 started introducing a non-dummy imap search command implementation which is broken. Seems the root cause boils down to not treating CR (\r) correctly.

            A quick shot backport of `SearchCommand` from https://github.com/greenmail-mail-test/greenmail to current Alfresco HEAD code fixed "SEARCH SEEN" for me, "UID SEARCH SINCE " and "SEARCH UNDELETED SINCE" remained broken - most likely due to the same date parsing problem.

            By the way: Is "works in EE" a valid reason to close issues raised against CE? Did you guys try reproducing the issue using Outlook 2013 against the CE version mentioned in the description?

            Show
            deas0815 Andreas Steffan added a comment - - edited Ok, I tracked this down. Turns out that Alfresco 5.1 started introducing a non-dummy imap search command implementation which is broken. Seems the root cause boils down to not treating CR (\r) correctly. A quick shot backport of `SearchCommand` from https://github.com/greenmail-mail-test/greenmail to current Alfresco HEAD code fixed "SEARCH SEEN" for me, "UID SEARCH SINCE " and "SEARCH UNDELETED SINCE" remained broken - most likely due to the same date parsing problem. By the way: Is "works in EE" a valid reason to close issues raised against CE? Did you guys try reproducing the issue using Outlook 2013 against the CE version mentioned in the description?
            Hide
            deas0815 Andreas Steffan added a comment -

            Assuming that 5.1 Enterprise uses the same greenmail code as CE 201604, maybe it is that Outlook 2013 used by Scott does not issue the SEARCH commands breaking the communication. Having seen the underlying greenmail code, this is pretty much remains the only explanation I can come up with. Maybe you guys at Alfresco can verify this by using a tool like tcpdump.

            Show
            deas0815 Andreas Steffan added a comment - Assuming that 5.1 Enterprise uses the same greenmail code as CE 201604, maybe it is that Outlook 2013 used by Scott does not issue the SEARCH commands breaking the communication. Having seen the underlying greenmail code, this is pretty much remains the only explanation I can come up with. Maybe you guys at Alfresco can verify this by using a tool like tcpdump.
            Hide
            rohitthakral Rohit Thakral added a comment -

            Hi Guys

            We have worked with Microsoft and they have released https://support.microsoft.com/kb/3216722

            I hope this is helpful in fixing the issue but I see it is not assigned to any future versions. Any plans?

            Thanks
            Rohit

            Show
            rohitthakral Rohit Thakral added a comment - Hi Guys We have worked with Microsoft and they have released https://support.microsoft.com/kb/3216722 I hope this is helpful in fixing the issue but I see it is not assigned to any future versions. Any plans? Thanks Rohit
            Hide
            douglascrp Douglas Cassiano Rodrigues Paes added a comment - - edited

            I am facing the same problem.
            In my case, the Alfresco version is 201702-GA

            Show
            douglascrp Douglas Cassiano Rodrigues Paes added a comment - - edited I am facing the same problem. In my case, the Alfresco version is 201702-GA
            Hide
            resplin Richard Esplin added a comment -

            @Rohit Thakrai: Thanks for linking to the MS KB. It's helpful.

            We would like to address this issue, but do not currently have any work on the IMAP server scheduled. It is likely to continue to sit for some time.

            Show
            resplin Richard Esplin added a comment - @Rohit Thakrai: Thanks for linking to the MS KB. It's helpful. We would like to address this issue, but do not currently have any work on the IMAP server scheduled. It is likely to continue to sit for some time.

              People

              • Assignee:
                resplin Richard Esplin
                Reporter:
                cibex cibex GmbH
              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Date of First Response: