Error when decoding an attachment with python from an email obtained with the Gmail API
I hope someone can help me.
I am trying to download the attachments of an email where DMARC reports arrive from a domain, I download them using the Gmail API, according to the API documentation the file is downloaded through a base64 encoded string which I obtain correctly “apparently”, but when I try to decode that string with python to obtain the file I get an error that says that the base64 string is not recognized as a valid string and it is possible that it is corrupt.
To rule out that the chain is too long, I tried downloading it in parts and then joining it, but the error continues.