Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-2821

ImapMailReceiver: imapFolder.hasNewMessages() always return false if server do not support RECENT flag

    XMLWordPrintable

Details

    Description

      ImapMailReceiver may wait long for some new messages if IMAP server do not support RECENT flag (gmail, CommuniGate ...):

      public void waitForNewMessages() throws MessagingException {
      ...
      if (imapFolder.hasNewMessages())

      { return; }

      ...
      try

      { imapFolder.idle(); }

      ...
      }

      Because imapFolder.hasNewMessages() can return true only if the server supports RECENT flag and the Folder always remain in the open state (see JavaMail 1.4.5 source).

      Perhaps you can replace method hasNewMessages() by searchForNewMessages() here if server do not support RECENT.

      Attachments

        Activity

          People

            grussell Gary Russell
            chemist Alexander Kharitonov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: