Memory errors when using imaplib with large email attachments

Richard Walkington richard at
Tue Jul 22 13:53:36 CEST 2003


I'm using python to connect to an IMAP server and download mail. When
downloading messages with large attachements (> 10MB) Python socket
module crashes with a memory error. Is there anything I can do about

Below is the trace back from using the imaplib example program from
the documentation to download the mailbox in question.

Thanks in adavance,
Richard Walkington

Traceback (most recent call last):
  File "", line 8, in ?
    typ, data = M.fetch(num, '(RFC822)')
  File "c:\python23\lib\", line 417, in fetch
    typ, dat = self._simple_command(name, message_set, message_parts)
  File "c:\python23\lib\", line 1000, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "c:\python23\lib\", line 830, in _command_complete
    typ, data = self._get_tagged_response(tag)
  File "c:\python23\lib\", line 931, in _get_tagged_response
  File "c:\python23\lib\", line 893, in _get_response
    data =
  File "c:\python23\lib\", line 231, in read
  File "c:\python23\lib\", line 301, in read
    data = self._sock.recv(recv_size)

More information about the Python-list mailing list