I am trying to read content from Gmail using poplib. The content in my email is mostly base64 encoded but contains some additional symbols. However, when I read the content using poplib, for some reason my original content is base64 encoded again.
Example content in my email: {{{eyJjb250ZW50IjpbeyJjZWxsIjoiQTEiLCJ2YW
Example response that I get from poplib: e3t7ZXlKamIyNTBaVzUwSWpwYmV5SmpaV3hzSWpvaVFURWlMQ0oyWVd
Any suggestions on how to retrieve my original (raw) content (without poplib encoding it again) will be greatly appreciated.
Here is the code that I am using:
messages = [pop_conn.retr(i) for i in range(1, len(pop_conn.list()[1]) + 1)]
psr = parser.FeedParser()
for msg in messages:
psr.feed(str(msg))
mess = psr.close()
payload = mess.get_payload(decode=True)