3 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Problem with fetc...
FromSent OnAttachments
xiuleifeidohk08 xiuleifeidohk08Jul 17, 2001 12:52 am 
Daniel BiddleJul 17, 2001 3:22 am 
Sam VarshavchikJul 17, 2001 4:49 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] Problem with fetch commandActions...
From:Daniel Biddle (del@osian.net)
Date:Jul 17, 2001 3:22:40 am
List:net.sourceforge.lists.courier-users

On Tue, Jul 17, 2001 at 03:52:29PM +0800, xiuleifeidohk08 xiuleifeidohk08 wrote:

We're using Easy Mail object 5.0 to parse mail from Courier IMAP. There is problem with subject with double quot(") in it e.g Subject:The "hill" is very steep. What happen is that the object crash when doing a "fetch envelope" to get the subject.

The object *crashes*? If so, there's something wrong with it: it shouldn't crash no matter what input it's given.

However, the object works fine with other IMAP servers. So I believe the problem lies with the way Courier IMAP handle the double quote(") symbol in its fetch envelope implementation.

This is the result of "fetch envelope" using Courier IMAP:

* 4 FETCH (ENVELOPE ("Tue, 17 Jul 2001 14:49:17 +0800" "The \"hill\" is very steep" (("postm" NIL "postm" "2bit.com")) (("postm" NIL "postm" "2bit.com")) (("postm" NIL "postm" "2bit.com")) (("yw@2bit.com" NIL "yws" "2bit.com")) NIL NIL NIL "<5.0.2.1.0.20010717144733.01b0c990@167.216.239.108>"))

This is the result of "fetch envelope" using the IMAP that has no problem.

* 139 FETCH (ENVELOPE ("Tue, 17 Jul 2001 14:49:39 +0800" {24}The "hill" is very steep (("shm" NIL "yws" "2bit.com")) (("shm" NIL "yws" "2bit.com")) (("shm" NIL "yws" "2bit.com")) (("yws" NIL "yws" "maxis.net.my")) NIL NIL NIL "<5.0.2.1.0.20010717144919.01b0f8c0@167.216.239.108>"))

I presume there was a CRLF after } in the result you actually got, since it's required by the protocol.

See the difference? Courier IMAP escape the " symbol with a \ while other IMAP use a byte count {24} at the front..so there's no problem with " being in the subject.

See <http://www.isi.edu/in-notes/rfc2060.txt>, in particular these productions:

# env_subject ::= nstring # # nstring ::= string / nil # # string ::= quoted / literal # # quoted ::= <"> *QUOTED_CHAR <"> # # QUOTED_CHAR ::= <any TEXT_CHAR except quoted_specials> / # "\" quoted_specials # # quoted_specials ::= <"> / "\" # # literal ::= "{" number "}" CRLF *CHAR8 # ;; Number represents the number of CHAR8 octets

Note that it allows any string to be either quoted or literal (length prefixed). An ENVELOPE subject is such a string:

response > response_data > message_data > msg_att > envelope envelope > env_subject > nstring > string string > quoted > QUOTED_CHAR > quoted_specials string > literal

This seems like a flaw in Courier-IMAP.

It's not - Courier-IMAP is working perfectly reasonably, and within the letter of the specification. If the EasyMail IMAP4 Object assumes that env_subject is always a literal, it has the flaw, not Courier-IMAP.

Any idea how do I solve this and will this problem be rectified?

Ask Quiksoft if this has been fixed yet (I couldn't find a change log on the Web site). You may have to upgrade to version 6.