import email PAYLOAD = """MhME: 1.0 Subject: m From: J Tone: m Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 eId: f0AG AAAA AAAA AAAA AAAAbase6- """ def main(): msg = email.message_from_string(PAYLOAD) for part in msg.walk(): crashes = part.get_payload(decode=True) if __name__ == '__main__': main()