[issue1598] unexpected response in imaplib

2007-12-11 Thread Scott Moser

New submission from Scott Moser:

I'm running into a problem with imaplib where it is unable to download a
message.  The example code at
http://www.python.org/doc/current/lib/imap4-example.html easily
demonstrates the problem.  

#!/usr/bin/python
import getpass, imaplib

M = imaplib.IMAP4("my.imap.host.tld")
M.login(getpass.getuser(), getpass.getpass())
M.debug = 5
M.select("msg-test")
typ, data = M.search(None, 'ALL')
for num in data[0].split():
typ, data = M.fetch(num, '(RFC822)')
print 'Message %s\n%s\n' % (num, data[0][1])
M.close()
M.logout()

The majority of the messages transfer correctly, but some do not.  I've
put 3 messages in the 'msg-test' folder, and one of them causes the
error below.  

Traceback (most recent call last):
  File "test.py", line 9, in 
typ, data = M.fetch(num, '(RFC822)')
  File "/usr/lib/python2.5/imaplib.py", line 437, in fetch
typ, dat = self._simple_command(name, message_set, message_parts)
  File "/usr/lib/python2.5/imaplib.py", line 1055, in _simple_command
return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python2.5/imaplib.py", line 887, in _command_complete
raise self.abort('command: %s => %s' % (name, val))
imaplib.abort: command: FETCH => unexpected response: ')'

imaplib.py has a comment in _get_tagged_response:
   # Some have reported "unexpected response" exceptions.
   # Note that ignoring them here causes loops.
   # Instead, send me details of the unexpected response and
   # I'll update the code in `_get_response()'.

I can not provide access to the imap host, but I can help debug wherever
possible. 

The most recent log messages are in the file attachment.

--
components: Library (Lib)
files: imaplib-debug.txt
messages: 58482
nosy: smoser
severity: normal
status: open
title: unexpected response in imaplib
type: crash
versions: Python 2.5
Added file: http://bugs.python.org/file8929/imaplib-debug.txt

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1598>
__  34:14.41 > DPAP7 FETCH 4 (RFC822)
  34:14.46 < * 4 FETCH (RFC822 {3721}
  34:14.46  matched r'\* (?P\d+) (?P[A-Z-]+)( (?P.*))?' 
=> ('4', 'FETCH', ' (RFC822 {3721}', '(RFC822 {3721}')
  34:14.46  matched r'.*{(?P\d+)}$' => ('3721',)
  34:14.46 read literal size 3721
  34:14.55 untagged_responses[FETCH] 0 += ["('4 (RFC822 {3721}', '...3883 bytes 
total..')"]
  34:14.55 < r questions. 
  34:14.55 untagged_responses[FETCH] 1 += ["r questions. "]
  34:14.55 < )
  34:14.55 last 10 IMAP4 interactions:
  34:08.94 < * 4 EXISTS
  34:08.94 < * 0 RECENT
  34:08.94 < * OK [UIDVALIDITY 25] UIDs valid
  34:08.94 < * OK [UIDNEXT 6] Predicted next UID
  34:08.94 < * FLAGS (\Flagged \Seen \Answered \Deleted \Draft)
  34:08.94 < * OK [PERMANENTFLAGS (\Flagged \Seen \Answered \Deleted \Draft 
\*)] Permanent flags
  34:08.94 < DPAP2 OK [READ-WRITE] SELECT completed
  34:08.94 > DPAP3 SEARCH ALL
  34:08.99 < * SEARCH 1 2 3 4
  34:08.99 < DPAP3 OK SEARCH completed

the string 'r questions. ' above is the last part of the message.
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1598] unexpected response in imaplib

2008-03-18 Thread Scott Moser

Scott Moser <[EMAIL PROTECTED]> added the comment:

I can recreate this at the moment with the attached mail.  I downloaded
the mail using alpine's "Export".  I don't know what other way I would
have to get it.

I have replaced many company names with XYZ and such, simply to
anonymize the message somewhat.

Added file: http://bugs.python.org/file9727/failed-mail.txt

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1598>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1598] unexpected response in imaplib

2008-03-18 Thread Scott Moser

Scott Moser <[EMAIL PROTECTED]> added the comment:

This is the stderr from the test case above.  Only modification is the
mailbox is 'my-test'.

Added file: http://bugs.python.org/file9728/failed-errorlog.txt

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1598>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1598] unexpected response in imaplib

2008-03-18 Thread Scott Moser

Scott Moser <[EMAIL PROTECTED]> added the comment:

> Can you provide the message or messages which cause the problem 
> when they are put in the IMAP server?

See attached above

>  Can you also provide information on what IMAP server software 
> and version is being used?

Its a lotus notes server.  Just those 2 words are quite likely to make
you think "server bug".  The only reason I have to not think that is
that the only other imap client i've tested (alpine and pine) works
fine.  So if indeed it is a server bug, its one that alpine has worked
around.

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1598>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com