2 messages in org.python.python-bugs-list[ python-Bugs-917120 ] imaplib: incor...
FromSent OnAttachments
SourceForge.netMar 16, 2004 1:36 am 
SourceForge.netMar 16, 2004 1:48 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:[ python-Bugs-917120 ] imaplib: incorrect quoting in commandsActions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 16, 2004 1:36:40 am
List:org.python.python-bugs-list

Bugs item #917120, was opened at 2004-03-16 19:36 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=917120&group_id=5470

Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Tony Meyer (anadelonbrin) Assigned to: Nobody/Anonymous (nobody) Summary: imaplib: incorrect quoting in commands

Initial Comment: imaplib incorrectly chooses to quote some arguments.

In particular, doing "UID FETCH # BODY.PEEK[]" results in the BODY.PEEK[] being quoted, and it should not (according to the RFC), which means the command fails. This is demonstrated below. It's possible (and likely) that other UID FETCH arguments are incorrectly quoted.

This occurs with anon cvs python of 16/3/04, and 2.3.3. Windows XP SP1.

I'm happy to provide more info if required, just let me know. I could try and work up a patch, but it would be better from someone really familiar with imaplib so that I don't screw up legitimate quoting.

import imaplib i = imaplib.IMAP4("server") i.login("username", "password") ('OK', ['LOGIN Ok.']) i.select() ('OK', ['38']) i.debug = 4 i.uid("FETCH", "96", "BODY")

29:14.23 > GKGP7 UID FETCH 96 BODY 29:14.40 < * 31 FETCH (UID 96 BODY (("text" "plain" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 32 0)("text" "html" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 368 10) "alternative")) 29:14.40 < GKGP7 OK FETCH completed. (&#039;OK&#039;, [&#039;31 (UID 96 BODY (("text" "plain" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 32 0)("text" "html" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 368 10) "alternative"))&#039;])

i.uid("FETCH", "96", "BODY.PEEK[]")

29:17.04 > GKGP8 UID FETCH 96 "BODY.PEEK[]" 29:17.21 < GKGP8 NO Error in IMAP command received by server. 29:17.21 NO response: Error in IMAP command received by server. (&#039;NO&#039;, [&#039;Error in IMAP command received by server.&#039;])

i.logout()

29:31.26 > GKGP9 LOGOUT 29:31.42 < * BYE Courier-IMAP server shutting down 29:31.42 BYE response: Courier-IMAP server shutting down 29:31.42 < GKGP9 OK LOGOUT completed (&#039;BYE&#039;, [&#039;Courier-IMAP server shutting down&#039;])

----------------------------------------------------------------------