too much memory unfortunatelythe default size limit is often too small you can change this limit from , bytes to , , bytes by running this codeimport imaplib imaplib _maxline this should prevent this error message from coming up again you may want to make these two lines part of every imap program you write fetching an email and marking it as read once you have list of uidsyou can call the imapclient object' fetch(method to get the actual email content the list of uids will be fetch()' first argument the second argument should be the list ['body[]']which tells fetch(to download all the body content for the emails specified in your uid list let' continue our interactive shell example rawmessages imapobj fetch(uids['body[]']import pprint pprint pprint(rawmessages{ {'body[]''delivered-tomy_email_address@example com\ \ 'receivedby with smtp id --snip-'\ \ '=_part_ --\ \ ''seq' }import pprint and pass the return value from fetch()stored in the variable rawmessagesto pprint pprint(to "pretty printitand you'll see that this return value is nested dictionary of messages with uids as the keys each message is stored as dictionary with two keys'body[]and 'seqthe 'body[]key maps to the actual body of the email the 'seqkey is for sequence numberwhich has similar role to the uid you can safely ignore it as you can seethe message content in the 'body[]key is pretty unintelligible it' in format called rfc which is designed for imap servers to read but you don' need to understand the rfc formatlater in this the pyzmail module will make sense of it for you when you selected folder to search throughyou called select_folder(with the readonly=true keyword argument doing this prevents you from accidentally deleting an email--but it also means that emails will not get marked as read if you fetch them with the fetch(method if you do want emails to be marked as read when you fetch themyou'll need to pass readonly=false to select_folder(if the selected folder is already in read-only modeyou can reselect the current folder with another call to select_folder()this time with the readonly=false keyword argumentimapobj select_folder('inbox'readonly=false