issues@javamail.java.net

[Bug 3983] New: IMAPMessage.loadEnvelope() may hang on certain IMAP servers

From: <bugzilla-daemon_at_kenai.com>
Date: Fri, 28 Jan 2011 12:09:21 +0000 (GMT)

http://kenai.com/bugzilla/show_bug.cgi?id=3983

           Summary: IMAPMessage.loadEnvelope() may hang on certain IMAP
                    servers
           Product: javamail
           Version: 1.4.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: imap
        AssignedTo: shannon_at_kenai.com
        ReportedBy: volkenborn_at_kenai.com
                CC: issues_at_javamail.kenai.com


Steps to reproduce:

Place this mail in the inbox of the IMAP store:

--
From: anyone_at_anywhere.org
To: someone_at_somewehere.org
Subject: Here goes nothing (or does it
This mail will hang.
--
The trick is to leave an open parenthesis inside the subject, without a
corresponding closing one!
Now as soon as the command
FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
has been issued, no fetch response will return from certain IMAP servers, like
Cyrus or MDaemon.
It's possibly due to incorrect parsing of the envelope string on the mail
server side (containing a lot of parentheses usually).
Some other servers will provide the correct response to
IMAPProtocaol.fetch(seqNo, envCmd) however, like MS Exchange, so you won't
notice the problem there!
If mail.imap.timeout has been set, IMAPMessage will throw a
FolderClosedException after the time has elapsed. If not, the thread will hang
forever!
A possible workaround would be to not use any methods that will call the
loadEnvelope method internally.
Note: it might be a good idea to implement methods to retrieve the date and
size alone so the overhead of loading the envelope along won't be necessary if
it's not used later on.
-- 
Configure bugmail: http://kenai.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.