I would like to receive the email body
as an ascii string.
It is highly unlikely that you won't be able to do this: What if it isn't ascii? Even if everything is in English it might contain characters outside the ascii range. imaplib
's documentation is not going into any encoding questions, so I suppose the data arrives as byte strings, and I'd expect them to be utf-8 encoded. Other libraries might provide you with Unicode strings, which you can encode in any encoding you fancy (but utf-8 is a good choice).
However, I suppose you don't really mean "ascii" but what you think of as "plain text" -- a text, not html, version of the email. It might be a multipart mail, in which case you can extract the "text/plain" part from the string you receive. If it isn't, and the mail body was html only, you can use a third-party library. There are a number of options, discussed in this SO thread.